From b2df86d5ccf49ccc1b4489a4a0ab47175d007df9 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Fri, 25 Jan 2013 21:29:59 +0200 Subject: Renamed EQUALS. --- interpreter.py | 2 +- parser.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/interpreter.py b/interpreter.py index 497498f72..6b229b885 100755 --- a/interpreter.py +++ b/interpreter.py @@ -258,7 +258,7 @@ class Interpreter(): if node is None: return if not isinstance(node, nodes.CodeBlock): - raise InvalidCode('Tried to execute a non-codeblock. Possibly a bug in the parser.') + raise InvalidCode('Line %d: Tried to execute a non-codeblock. Possibly a bug in the parser.' % node.lineno()) statements = node.get_statements() i = 0 while i < len(statements): diff --git a/parser.py b/parser.py index 1c00ab8ff..96cf1f741 100755 --- a/parser.py +++ b/parser.py @@ -33,7 +33,7 @@ tokens = ['LPAREN', 'RBRACE', 'ATOM', 'COMMENT', - 'EQUALS', + 'ASSIGN', 'COMMA', 'DOT', 'STRING', @@ -41,7 +41,7 @@ tokens = ['LPAREN', 'EOL', ] + list(reserved.values()) -t_EQUALS = '=' +t_ASSIGN = '=' t_LPAREN = '\(' t_RPAREN = '\)' t_LBRACKET = '\[' @@ -112,7 +112,7 @@ def p_expression_string(t): t[0] = nodes.StringExpression(t[1], t.lineno(1)) def p_statement_assign(t): - 'statement : expression EQUALS statement' + 'statement : expression ASSIGN statement' t[0] = nodes.Assignment(t[1], t[3], t.lineno(1)) def p_statement_func_call(t): -- cgit v1.2.3