Skip to content

Commit

Permalink
Merge pull request #166 from tetsuo-jp/master
Browse files Browse the repository at this point in the history
  • Loading branch information
gdetrez committed Sep 7, 2016
2 parents fafa3af + 4b3b789 commit d633673
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/src/BNFC/Backend/OCaml/CFtoOCamlLex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,17 @@ rules cf = mkRule "token" $
++
[ (mkRegexMultilineComment b e, "token lexbuf") | (b,e) <- multilineC]
++
-- reserved keywords
[ ( "rsyms"
, "let id = lexeme lexbuf in try Hashtbl.find symbol_table id with Not_found -> failwith (\"internal lexer error: reserved symbol \" ^ id ^ \" not found in hashtable\")" )
| not (null (cfgSymbols cf))]
++
-- user tokens
[ (text n , tokenAction (text t)) | (n,_,t) <- userTokens cf]
++
-- predefined tokens
[ ( "l i*", tokenAction "Ident" ) ]
++
[ ( "rsyms"
, "let id = lexeme lexbuf in try Hashtbl.find symbol_table id with Not_found -> failwith (\"internal lexer error: reserved symbol \" ^ id ^ \" not found in hashtable\")" )
| not (null (cfgSymbols cf))]
++
-- integers
[ ( "d+", "let i = lexeme lexbuf in TOK_Integer (int_of_string i)" )
-- doubles
Expand Down

0 comments on commit d633673

Please sign in to comment.