]> git.lizzy.rs Git - metalua.git/commitdiff
use simplified defaults for multisequences in mlp
authorFabien Fleutot <fabien@MacFabien.home>
Sat, 28 Feb 2009 12:21:36 +0000 (13:21 +0100)
committerFabien Fleutot <fabien@MacFabien.home>
Sat, 28 Feb 2009 12:21:36 +0000 (13:21 +0100)
src/compiler/mlp_expr.lua

index 091f92e2c26bf381ec574d2ef5555e0704113a57..213ccde22ec172ba6e4288b0691eefcf00b728bb 100644 (file)
@@ -80,7 +80,8 @@ method_args = gg.multisequence{
    name = "function argument(s)",
    { "{", table_content, "}" },
    { "(", func_args_content, ")", builder = fget(1) },
-   default = function(lx) local r = opt_string(lx); return r and {r} or { } end }
+   { "+{", quote_content, "}" }, 
+   function(lx) local r = opt_string(lx); return r and {r} or { } end }
 
 --------------------------------------------------------------------------------
 -- [func_val] parses a function, from opening parameters parenthese to
@@ -92,7 +93,7 @@ method_args = gg.multisequence{
 -- definitions.
 --------------------------------------------------------------------------------
 func_params_content = gg.list{ name="function parameters",
-   gg.multisequence{ { "...", builder = "Dots" }, default = id },
+   gg.multisequence{ { "...", builder = "Dots" }, id },
    separators  = ",", terminators = {")", "|"} } 
 
 local _func_params_content = function (lx) return func_params_content(lx) end
@@ -163,7 +164,7 @@ expr = gg.expr { name = "expression",
       { "false",                   builder = "False" },
       { "...",                     builder = "Dots" },
       table,
-      default = id_or_literal },
+      id_or_literal },
 
    infix = { name="expr infix op",
       { "+",  prec = 60, builder = opf2 "add"  },