@@ -13,18 +13,20 @@ class WalkBlock {
1313 var rewindPos : Int = stream .currentPos ();
1414 while (stream .is (At )) tempStore .push (WalkAt .walkAt (stream ));
1515 if (stream .is (BrOpen )) {
16- if (isBrOpenObjectDecl (parent )) {
17- WalkObjectDecl .walkObjectDecl (stream , parent );
18- return ;
19- }
2016 var openTok : TokenTree = stream .consumeTokenDef (BrOpen );
2117 parent .addChild (openTok );
2218 for (tok in tempStore ) openTok .addChild (tok );
2319
2420 var progress : TokenStreamProgress = new TokenStreamProgress (stream );
2521 while (progress .streamHasChanged ()) {
26- if (stream .is (BrClose )) break ;
27- WalkStatement .walkStatement (stream , openTok );
22+ switch (stream .token ()) {
23+ case BrClose : break ;
24+ case Comma , BkClose , PClose :
25+ var child : TokenTree = stream .consumeToken ();
26+ openTok .addChild (child );
27+ default : WalkStatement .walkStatement (stream , openTok );
28+
29+ }
2830 }
2931 openTok .addChild (stream .consumeTokenDef (BrClose ));
3032 }
@@ -33,16 +35,4 @@ class WalkBlock {
3335 WalkStatement .walkStatement (stream , parent );
3436 }
3537 }
36-
37- static function isBrOpenObjectDecl (token : TokenTree ): Bool {
38- if ((token == null ) || (token .tok == null )) return false ;
39- return switch (token .tok ) {
40- case BkOpen : true ;
41- case Kwd (KwdReturn ): true ;
42- case Kwd (KwdFor ): isBrOpenObjectDecl (token .parent );
43- case Kwd (_ ): false ;
44- case Binop (OpAssign ): true ;
45- default : isBrOpenObjectDecl (token .parent );
46- }
47- }
4838}
0 commit comments