[Nice-commit] Nice/src/bossa/parser Parser.jj,1.224,1.225
Brought to you by:
bonniot
From: <ar...@us...> - 2003-12-13 14:06:04
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv32394/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Cleaned up block call implementation a bit. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.224 retrieving revision 1.225 diff -C2 -d -r1.224 -r1.225 *** Parser.jj 12 Dec 2003 20:34:46 -0000 1.224 --- Parser.jj 13 Dec 2003 14:06:00 -0000 1.225 *************** *** 2471,2474 **** --- 2471,2487 ---- } + void PostfixBlocks(Expression exp) : + { LocatedString name; Statement block; } + { + ( + block=Block() + { if ( exp instanceof CallExp && ((CallExp)exp).hasBrackets && ! (exp instanceof NewExp) ) + ((CallExp)exp).addBlockArgument(block, null); + else + throw bossa.util.User.error(exp,"Block arguments can only be added to normal function calls"); + } + ) + } + Statement RealStatementExpression() : { Expression e1; Token first, last; Statement block; } *************** *** 2480,2489 **** e1=PrimaryExpression() ( ! block=Block() ! { if ( e1 instanceof CallExp && ! (e1 instanceof NewExp) ) ! ((CallExp)e1).addBlockArgument(block, null); ! else ! throw bossa.util.User.error(e1,"Block arguments can only be added to normal function calls"); ! } | e1=PostfixStatementExpression(e1, first) ";" --- 2493,2497 ---- e1=PrimaryExpression() ( ! PostfixBlocks(e1) | e1=PostfixStatementExpression(e1, first) ";" *************** *** 2506,2515 **** e1=PrimaryExpression() ( ! block=Block() ! { if ( e1 instanceof CallExp && ! (e1 instanceof NewExp) ) ! ((CallExp)e1).addBlockArgument(block, null); ! else ! throw bossa.util.User.error(e1,"Block arguments can only be added to normal function calls"); ! } | e1=PostfixStatementExpression(e1, first) --- 2514,2518 ---- e1=PrimaryExpression() ( ! PostfixBlocks(e1) | e1=PostfixStatementExpression(e1, first) |