| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Jython
Revision: 5251
Author: fwierzbicki
Date: 26 Aug 2008 12:51:15
Changes:Moved Subscript creation up a rule - fixed a bunch of unit tests.
Files:| ... | ...@@ -1105,7 +1105,7 @@ | |
| 1105 | 1105 | @after { |
| 1106 | 1106 | $power.tree = $etype; |
| 1107 | 1107 | } |
| 1108 | : atom (t+=trailer[$atom.start])* (options {greedy=true;}:d=DOUBLESTAR factor)? | |
| 1108 | : atom (t+=trailer[$atom.start, $atom.tree])* (options {greedy=true;}:d=DOUBLESTAR factor)? | |
| 1109 | 1109 | { |
| 1110 | 1110 | $etype = (exprType)$atom.tree; |
| 1111 | 1111 | if ($t != null) { |
| ... | ...@@ -1258,33 +1258,32 @@ | |
| 1258 | 1258 | ; |
| 1259 | 1259 | |
| 1260 | 1260 | //trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' NAME |
| 1261 | trailer [Token begin] | |
| 1261 | trailer [Token begin, PythonTree tree] | |
| 1262 | 1262 | : LPAREN |
| 1263 | 1263 | (arglist |
| 1264 | -> ^(LPAREN<Call>[$begin, null, actions.makeExprs($arglist.args), | |
| 1264 | -> ^(LPAREN<Call>[$begin, (exprType)$tree, actions.makeExprs($arglist.args), | |
| 1265 | 1265 | actions.makeKeywords($arglist.keywords), $arglist.starargs, $arglist.kwargs]) |
| 1266 | 1266 | | |
| 1267 | -> ^(LPAREN<Call>[$LPAREN, null, new exprType[0\], new keywordType[0\], null, null]) | |
| 1267 | -> ^(LPAREN<Call>[$LPAREN, (exprType)$tree, new exprType[0\], new keywordType[0\], null, null]) | |
| 1268 | 1268 | ) |
| 1269 | 1269 | RPAREN |
| 1270 | | LBRACK s=subscriptlist[begin] RBRACK | |
| 1271 | -> $s | |
| 1270 | | LBRACK subscriptlist[$begin] RBRACK | |
| 1271 | -> ^(LBRACK<Subscript>[$begin, (exprType)$tree, (sliceType)$subscriptlist.tree, $expr::ctype]) | |
| 1272 | 1272 | | DOT attr |
| 1273 | -> ^(DOT<Attribute>[$begin, null, $attr.text, $expr::ctype]) | |
| 1273 | -> ^(DOT<Attribute>[$begin, (exprType)$tree, $attr.text, $expr::ctype]) | |
| 1274 | 1274 | ; |
| 1275 | 1275 | |
| 1276 | 1276 | //subscriptlist: subscript (',' subscript)* [','] |
| 1277 | subscriptlist[Token begin] returns [exprType etype] | |
| 1277 | subscriptlist[Token begin] | |
| 1278 | 1278 | @init { |
| 1279 | exprType etype = null; | |
| 1279 | sliceType sltype = null; | |
| 1280 | 1280 | } |
| 1281 | 1281 | @after { |
| 1282 | $subscriptlist.tree = etype; | |
| 1282 | $subscriptlist.tree = sltype; | |
| 1283 | 1283 | } |
| 1284 | 1284 | : sub+=subscript (options {greedy=true;}:c1=COMMA sub+=subscript)* (c2=COMMA)? |
| 1285 | 1285 | { |
| 1286 | sliceType s = actions.makeSliceType($begin, $c1, $c2, $sub); | |
| 1287 | etype = new Subscript($begin, null, s, $expr::ctype); | |
| 1286 | sltype = actions.makeSliceType($begin, $c1, $c2, $sub); | |
| 1288 | 1287 | } |
| 1289 | 1288 | ; |
| 1290 | 1289 |
| ... | ...@@ -318,9 +318,7 @@ | |
| 318 | 318 | change to grammar files. If you are working on the grammars you might |
| 319 | 319 | want to comment this out, as a clean is really only needed if you change |
| 320 | 320 | the tokens defined in Python.g (and cleans make the build slow) --> |
| 321 | <antcall target="clean"/> | |
| 322 | 321 | <!-- force jarjar build --> |
| 323 | <property name="jarjar.needed" value="true" /> | |
| 324 | 322 | </target> |
| 325 | 323 | |
| 326 | 324 | <target name ="prepare-output" depends="init,needed-check,clean-if-antlr-needed,make-output-dirs"/> |