Skip to content

Instantly share code, notes, and snippets.

@justinj
Created August 1, 2014 21:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinj/8a59c8cf01fbca21175d to your computer and use it in GitHub Desktop.
Save justinj/8a59c8cf01fbca21175d to your computer and use it in GitHub Desktop.
var classifyToken = function(token) {
var kind;
if (token === "λ") { kind = LAMBDA; }
else if (token === ".") { kind = DOT; }
else if (token === "(") { kind = LPAREN; }
else if (token === ")") { kind = RPAREN; }
else { kind = IDENTIFIER; }
return {
kind: kind,
lexeme: token
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment