From fcd30be44982cfe79ed777b19b2543fe3e72e239 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 3 Jan 2012 00:37:48 -0700 Subject: +=, -=, *=, /= works with indexed dicts/lists --- src/parser.y | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/parser.y') diff --git a/src/parser.y b/src/parser.y index 2e9eead..2aff29c 100644 --- a/src/parser.y +++ b/src/parser.y @@ -245,6 +245,10 @@ expr: literal | expr tokGtEq expr { bld.addNode( AstNode::tCompGtEq ); } | '(' expr ')' | expr '[' expr ']' { bld.addNode( AstNode::tIndex ); } + | expr '[' expr ']' tokPlusAssign { bld.addNode( AstNode::tIndex ); } expr { bld.addNode( AstNode::tPlusStore ); } + | expr '[' expr ']' tokMinusAssign { bld.addNode( AstNode::tIndex ); } expr { bld.addNode( AstNode::tMinusStore ); } + | expr '[' expr ']' tokTimesAssign { bld.addNode( AstNode::tIndex ); } expr { bld.addNode( AstNode::tMultiplyStore ); } + | expr '[' expr ']' tokDivideAssign { bld.addNode( AstNode::tIndex ); } expr { bld.addNode( AstNode::tDivideStore ); } | expr '[' expr ']' '=' expr { bld.addNode( AstNode::tInsert ); } | '[' ']' { bld.addLiteral( Variable( Variable::tList ) ); } | '[' { bld.addLiteral( Variable( Variable::tList ) ); } listValues ']' -- cgit v1.2.3