Make parser_find_local only actually search locals
authorWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:31:45 +0000 (09:31 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sun, 14 Jan 2018 08:33:05 +0000 (09:33 +0100)
Fixes #163
Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
parser.cpp

index 1404273..c795e40 100644 (file)
@@ -156,7 +156,7 @@ static ast_expression* parser_find_var(parser_t *parser, const char *name)
 {
     bool dummy;
     ast_expression *v;
-    v         = parser_find_local(parser, name, 0, &dummy);
+    v         = parser_find_local(parser, name, PARSER_HT_LOCALS, &dummy);
     if (!v) v = parser_find_global(parser, name);
     return v;
 }