From 5269885f16867330f9655316bfb64b631782342f Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 25 Jan 2013 22:42:11 +0200 Subject: Added array support. --- parser.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'parser.py') diff --git a/parser.py b/parser.py index ad2e87f..ce01011 100755 --- a/parser.py +++ b/parser.py @@ -119,11 +119,15 @@ def p_statement_assign(t): 'statement : expression ASSIGN statement' t[0] = nodes.Assignment(t[1], t[3], t.lineno(1)) -def p_statement_equals(t): +def p_statement_comparison(t): '''statement : statement EQUALS statement | statement NEQUALS statement''' t[0] = nodes.Comparison(t[1], t[2], t[3], t.lineno(1)) +def p_statement_array(t): + '''statement : LBRACKET args RBRACKET''' + t[0] = nodes.ArrayStatement(t[2], t.lineno(1)) + def p_statement_func_call(t): 'statement : expression LPAREN args RPAREN' t[0] = nodes.FunctionCall(t[1], t[3], t.lineno(1)) -- cgit v1.1