pull/32/merge
SirPython 8 years ago
commit 0f8fb485c8

@ -362,14 +362,14 @@ function tokenizer(input) {
// later be used for `CallExpressions` but for now we only care about the
// character.
//
// We check to see if we have an open parenthesis:
if (char === '(') {
// We check to see if we have either an open or close parenthesis:
if (char === '(' || char === ')') {
// If we do, we push a new token with the type `paren` and set the value
// to an open parenthesis.
// to an open or close parenthesis.
tokens.push({
type: 'paren',
value: '('
value: char
});
// Then we increment `current`
@ -379,18 +379,6 @@ function tokenizer(input) {
continue;
}
// Next we're going to check for a closing parenthesis. We do the same exact
// thing as before: Check for a closing parenthesis, add a new token,
// increment `current`, and `continue`.
if (char === ')') {
tokens.push({
type: 'paren',
value: ')'
});
current++;
continue;
}
// Moving on, we're now going to check for whitespace. This is interesting
// because we care that whitespace exists to separate characters, but it
// isn't actually important for us to store as a token. We would only throw

Loading…
Cancel
Save