From: <fwi...@us...> - 2008-07-23 18:39:12
|
Revision: 4989 http://jython.svn.sourceforge.net/jython/?rev=4989&view=rev Author: fwierzbicki Date: 2008-07-23 18:39:09 +0000 (Wed, 23 Jul 2008) Log Message: ----------- Offset fixes for Try/Catch and Call. Modified Paths: -------------- branches/asm/grammar/Python.g branches/asm/grammar/PythonWalker.g Modified: branches/asm/grammar/Python.g =================================================================== --- branches/asm/grammar/Python.g 2008-07-23 01:58:01 UTC (rev 4988) +++ branches/asm/grammar/Python.g 2008-07-23 18:39:09 UTC (rev 4989) @@ -818,11 +818,11 @@ // ['else' ':' suite] // ['finally' ':' suite] | // 'finally' ':' suite)) -try_stmt : 'try' COLON trysuite=suite +try_stmt : TRY COLON trysuite=suite ( (except_clause+ (ORELSE COLON elsesuite=suite)? (FINALLY COLON finalsuite=suite)? - -> ^(TryExcept 'try' ^(Body $trysuite) except_clause+ ^(ORELSE $elsesuite)? ^(FINALLY $finalsuite)?)) + -> ^(TryExcept[$TRY] ^(Body $trysuite) except_clause+ ^(ORELSE $elsesuite)? ^(FINALLY $finalsuite)?)) | (FINALLY COLON finalsuite=suite - -> ^(TryFinally 'try' ^(Body $trysuite) ^(FINALLY $finalsuite))) + -> ^(TryFinally[$TRY] ^(Body $trysuite) ^(FINALLY $finalsuite))) ) ; @@ -1158,6 +1158,7 @@ ASSERT : 'assert' ; FINALLY : 'finally' ; DELETE : 'del' ; +TRY : 'try' ; LPAREN : '(' {implicitLineJoiningLevel++;} ; Modified: branches/asm/grammar/PythonWalker.g =================================================================== --- branches/asm/grammar/PythonWalker.g 2008-07-23 01:58:01 UTC (rev 4988) +++ branches/asm/grammar/PythonWalker.g 2008-07-23 18:39:09 UTC (rev 4989) @@ -389,6 +389,7 @@ } else { c = makeCall($Call, $dotted_attr.etype, $arglist.args, $arglist.keywords, $arglist.starargs, $arglist.kwargs); } + c.setCharStopIndex($Call.getCharStopIndex()); decs.add(c); } } @@ -470,6 +471,7 @@ } else { c = makeCall($test.marker, $test.etype, $arglist.args, $arglist.keywords, $arglist.starargs, $arglist.kwargs); } + c.setCharStopIndex($Call.getCharStopIndex()); $etype = c; } ; @@ -814,7 +816,7 @@ @init { List handlers = new ArrayList(); } - : ^(TryExcept tok='try' ^(Body body=stmts) except_clause[handlers]+ (^(ORELSE orelse=stmts))? (^(FINALLY fin=stmts))?) { + : ^(TryExcept ^(Body body=stmts) except_clause[handlers]+ (^(ORELSE orelse=stmts))? (^(FINALLY fin=stmts))?) { List o = null; List f = null; if ($ORELSE != null) { @@ -823,11 +825,11 @@ if ($FINALLY != null) { f = $fin.stypes; } - stmtType te = makeTryExcept($tok, $body.stypes, handlers, o, f); + stmtType te = makeTryExcept($TryExcept, $body.stypes, handlers, o, f); $stmts::statements.add(te); } - | ^(TryFinally tok='try' ^(Body body=stmts) ^(FINALLY fin=stmts)) { - TryFinally tf = makeTryFinally($tok, $body.stypes, $fin.stypes); + | ^(TryFinally ^(Body body=stmts) ^(FINALLY fin=stmts)) { + TryFinally tf = makeTryFinally($TryFinally, $body.stypes, $fin.stypes); $stmts::statements.add(tf); } ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |