Permalink
Browse files

[fix] compiler, syntax: we want to be able comment just before separator

  • Loading branch information...
1 parent b924be7 commit e1512f98b21e6dc1a1fa1aebc05db8786a91b517 @BourgerieQuentin BourgerieQuentin committed Feb 9, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 opalang/js_syntax/opa_lexer.trx
  2. +2 −2 opalang/js_syntax/opa_parser.trx
@@ -75,7 +75,7 @@ spacing_nonl <- (whitespace$ / opacomment$)* $
(* opacomment_slash can succeed without parsing a final newline, because
* it happens if your final line is a comment and your file doesn't end with
* a newline *)
-opacomment_slash <- "/" (!newline . $)* newline? $
+opacomment_slash <- "/" (!newline . $)* $
opacomment_star <- "*"
(!"*/" ("/" opacomment_star / . $))*
(=or_eof("*/")):b {{ if not b then error_comment (pos_only _filename _pos_beg _pos_end) }}
@@ -238,7 +238,7 @@ type_binding <-
} : string typedef_node
}}
-let type_maybe rule = (=backtrack(typ:t Opa_lexer.whitespace {{t}}, rule))
+let type_maybe rule = (=backtrack(typ:t Opa_lexer.whitespace !separator {{t}}, rule))
(**
{7 Type constants}
@@ -1438,7 +1438,7 @@ _fail <- &. &(!.) . $
;hint_end_of_callable <- (=careful_deco(& " (")):p {{ push_hint (`function_call (label p)); () }}
/ !"(" $
-separator <- Opa_lexer.maybe_whitespace (semic / Opa_lexer.newline / Opa_lexer.opacomment) pos:p {{ p }}
+separator <- (Opa_lexer.whitespace / Opa_lexer.opacomment)* (semic / Opa_lexer.newline) pos:p {{ p }}
(**
{7 Importing the lexer}

0 comments on commit e1512f9

Please sign in to comment.