From 1b7a5bd1190996edcc1ce2a6fba56478d3beeaac Mon Sep 17 00:00:00 2001 From: Henri DF Date: Mon, 29 Feb 2016 13:36:14 -0800 Subject: [PATCH] compiler: keep source in FunctionCall ASTs --- userspace/digwatch/lua/compiler.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/userspace/digwatch/lua/compiler.lua b/userspace/digwatch/lua/compiler.lua index f9fa99b1..eed9b52d 100644 --- a/userspace/digwatch/lua/compiler.lua +++ b/userspace/digwatch/lua/compiler.lua @@ -167,8 +167,8 @@ local function outputformat (format) return {type = "OutputFormat", value = format} end -local function functioncall (name, args) - return {type = "FunctionCall", name = name, arguments = args} +local function functioncall (str, name, args) + return {type = "FunctionCall", name = name, arguments = args, source = str} end local function rule(filter, output) @@ -217,7 +217,7 @@ local G = { MacroDef = (C(V"Macro") * V"Skip" * V"Colon" * (V"Filter")); FuncArgs = symb("(") * list(V"Value", symb(",")) * symb(")"); - Output = ((V"Name" * V"FuncArgs") / functioncall) + P(1)^0 / outputformat; + Output = (C(V"Name" * V"FuncArgs") / functioncall) + P(1)^0 / outputformat; -- Terminals Value = terminal "Number" + terminal "String" + terminal "BareString";