Skip to content

Instantly share code, notes, and snippets.

@atungare
atungare / parser.js
Created December 17, 2016 00:15
JS lisp parser
function readToken (token) {
if (token === '(') {
return {
type: 'OPENING_PARENS'
};
} else if (token === ')') {
return {
type: 'CLOSING_PARENS'
};
} else if (token.match(/^\d+$/)) {