Skip to content
Browse files

Accept more symbols in infix constructors.

Factor out the common subset of infixsymbolchar and symbolchar.
  • Loading branch information...
1 parent acd385e commit c7641bdf7cc1b8a2d4fd6f7756da607d99dae325 @yallop committed Aug 1, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 parsing/lexer.mll
View
10 parsing/lexer.mll
@@ -268,10 +268,10 @@ let lowercase_latin1 = ['a'-'z' '\223'-'\246' '\248'-'\255' '_']
let uppercase_latin1 = ['A'-'Z' '\192'-'\214' '\216'-'\222']
let identchar_latin1 =
['A'-'Z' 'a'-'z' '_' '\192'-'\214' '\216'-'\246' '\248'-'\255' '\'' '0'-'9']
-let symbolchar =
- ['!' '$' '%' '&' '*' '+' '-' '.' '/' ':' '<' '=' '>' '?' '@' '^' '|' '~']
let infixsymbolchar =
- ['<' '>' '@' '^' '|' '&' '+' '-' '*' '/' '$' '%' ]
+ ['<' '@' '^' '|' '&' '+' '-' '*' '/' '$' '%' ':' ]
+let symbolchar =
+ infixsymbolchar | ['!' '.' '=' '?' '|' '~' '>']
let decimal_literal =
['0'-'9'] ['0'-'9' '_']*
let hex_literal =
@@ -484,9 +484,9 @@ rule token = parse
| '%' { PERCENT }
| ['*' '/' '%'] symbolchar *
{ INFIXOP3(Lexing.lexeme lexbuf) }
- | "::" infixsymbolchar + symbolchar *
+ | ":" infixsymbolchar + symbolchar *
{ INFIXCON(Lexing.lexeme lexbuf) }
- | "::" { INFIXCON "::" }
+ (* | "::" { INFIXCON "::" } *)
| eof { EOF }
| _
{ raise (Error(Illegal_character (Lexing.lexeme_char lexbuf 0),

0 comments on commit c7641bd

Please sign in to comment.
Something went wrong with that request. Please try again.