Skip to content

Commit

Permalink
[Feature] Lua_selectors: Allow table arguments for selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Aug 19, 2019
1 parent fd1a185 commit 05d6a89
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lualib/lua_selectors/init.lua
Expand Up @@ -214,6 +214,9 @@ local function make_grammar()
local dot = l.P(".")
local semicolon = l.P(":")
local obrace = "(" * spc
local tbl_obrace = "{" * spc
local eqsign = spc * "=" * spc
local tbl_ebrace = spc * "}"
local ebrace = spc * ")"
local comma = spc * "," * spc
local sel_separator = spc * l.S";*" * spc
Expand All @@ -225,7 +228,9 @@ local function make_grammar()
PROCESSOR = l.Ct(atom * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
FUNCTION = l.Ct(atom * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
METHOD = l.Ct(atom / function(e) return '__' .. e end * spc * (obrace * l.V("ARG_LIST") * ebrace)^0),
ARG_LIST = l.Ct((argument * comma^0)^0)
ARG_LIST = l.Ct((l.V("ARG") * comma^0)^0),
ARG = l.Cf(tbl_obrace * l.V("NAMED_ARG") * tbl_ebrace, rawset) + argument,
NAMED_ARG = (l.Ct("") * l.Cg(argument * eqsign * argument * comma^0)^0),
}
end
Expand Down

0 comments on commit 05d6a89

Please sign in to comment.