From fdafc7da77ca3f62907d74add3b0efaca1b315f5 Mon Sep 17 00:00:00 2001 From: Henri DF Date: Wed, 4 May 2016 15:27:32 -0700 Subject: [PATCH] Remove dead macro-checking code The `check_macros` function wasn't doing anything, and checking is done as part of expansion. --- userspace/falco/lua/compiler.lua | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/userspace/falco/lua/compiler.lua b/userspace/falco/lua/compiler.lua index 0c94f753..59c2eeba 100644 --- a/userspace/falco/lua/compiler.lua +++ b/userspace/falco/lua/compiler.lua @@ -369,23 +369,6 @@ function get_macros(ast, set) return set end -function check_macros(ast) - local macros - if (ast.type == "Rule") then - macros = get_macros(ast.filter, {}) - elseif (ast.type == "MacroDef") then - macros = get_macros(ast.value, {}) - else - error ("Unexpected type: "..t) - end - - for m, _ in pairs(macros) do - if macros[m] == nil then - error ("Undefined macro '"..m.."' used in '"..line.."'") - end - end -end - function print_ast(ast, level) local t = ast.type level = level or 0 @@ -453,9 +436,6 @@ function compiler.compile_line(line, macro_defs) return {} end - -- check that any macros used have already been defined - check_macros(ast) - if (ast.type == "MacroDef") then -- Parsed line is a macro definition, so update our dictionary of macros and -- return