Fix closing paren parsing logic

This commit is contained in:
James Kyle 2016-03-31 08:41:54 -07:00
parent 900750c78e
commit 8a18ac0a3c
2 changed files with 4 additions and 4 deletions

View File

@ -99,8 +99,8 @@ function parser(tokens) {
token = tokens[++current];
while (
token.type !== 'paren' ||
token.value !== ')'
(token.type !== 'paren') ||
(token.type === 'paren' && token.value !== ')')
) {
node.params.push(walk());
token = tokens[current];

View File

@ -577,8 +577,8 @@ function parser(tokens) {
// token with a `type` of `'paren'` and a `value` of a closing
// parenthesis.
while (
token.type !== 'paren' ||
token.value !== ')'
(token.type !== 'paren') ||
(token.type === 'paren' && token.value !== ')')
) {
// we'll call the `walk` function which will return a `node` and we'll
// push it into our `node.params`.