@@ -656,10 +656,8 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
656
656
some ( token. COMMA ) ,
657
657
pf, p) ;
658
658
hi = es. span ;
659
- ex = ast. expr_ext ( pth, es. node , none[ @ast. expr ] ,
660
- none[ @ast. expr ] , ast. ann_none ) ;
661
- // FIXME: Here is probably not the right place for this
662
- ex = expand_syntax_ext ( p, @spanned ( lo, hi, ex) ) . node ;
659
+ ex = expand_syntax_ext ( p, es. span , pth, es. node ,
660
+ none[ @ast. expr ] ) ;
663
661
}
664
662
665
663
case ( token. FAIL ) {
@@ -748,24 +746,23 @@ impure fn parse_bottom_expr(parser p) -> @ast.expr {
748
746
* rust crates. At the moment we have neither.
749
747
*/
750
748
751
- impure fn expand_syntax_ext( parser p, @ ast. expr ext ) -> @ast . expr {
752
- check ( ast. is_ext_expr ( ext ) ) ;
753
- alt ( ext . node ) {
754
- case ( ast . expr_ext ( ?path , ?args , ?body , _ , ?ann ) ) {
755
- check ( _vec. len [ ast. ident ] ( path. node . idents ) > 0 u) ;
756
- auto extname = path. node . idents . ( 0 ) ;
757
- if ( _str. eq ( extname, "fmt" ) ) {
758
- auto expanded = extfmt. expand_syntax_ext ( args, body) ;
759
- auto newexpr = ast. expr_ext ( path, args, body,
760
- some[ @ast. expr ] ( expanded) , ann ) ;
761
-
762
- ret @ spanned ( ext . span , ext . span , newexpr ) ;
763
- } else {
764
- p . err ( "unknown syntax extension" ) ;
765
- }
766
- }
749
+ impure fn expand_syntax_ext( parser p, ast. span sp ,
750
+ & ast. path path , vec [ @ast . expr ] args ,
751
+ option . t [ @ast . expr ] body ) -> ast . expr_ {
752
+
753
+ check ( _vec. len [ ast. ident ] ( path. node . idents ) > 0 u) ;
754
+ auto extname = path. node . idents . ( 0 ) ;
755
+ if ( _str. eq ( extname, "fmt" ) ) {
756
+ auto expanded = extfmt. expand_syntax_ext ( args, body) ;
757
+ auto newexpr = ast. expr_ext ( path, args, body,
758
+ some[ @ast. expr ] ( expanded) ,
759
+ ast . ann_none ) ;
760
+
761
+ ret newexpr ;
762
+ } else {
763
+ p . err ( "unknown syntax extension" ) ;
764
+ fail ;
767
765
}
768
- fail;
769
766
}
770
767
771
768
impure fn extend_expr_by_ident ( parser p, span lo, span hi,
0 commit comments