Skip to content

Instantly share code, notes, and snippets.

@patricoferris
Last active October 6, 2019 10:40
Show Gist options
  • Save patricoferris/b96b080b90acd57ab7242301925ced69 to your computer and use it in GitHub Desktop.
Save patricoferris/b96b080b90acd57ab7242301925ced69 to your computer and use it in GitHub Desktop.
(* lowercase definition *)
let lowercase = ['a'-'z' '_']
(* identchar definition *)
let identchar = ['A'-'Z' 'a'-'z' '_' '\'' '0'-'9']
(* Some stuff before *)
| lowercase identchar * as name
{ try Hashtbl.find keyword_table name
with Not_found -> LIDENT name }
| lowercase_latin1 identchar_latin1 * as name
{ warn_latin1 lexbuf; LIDENT name }
(* Some stuff after *)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment