diff --git a/super-tiny-compiler-unannotated.js b/super-tiny-compiler-unannotated.js index 6b98eb8..6fb0a9c 100644 --- a/super-tiny-compiler-unannotated.js +++ b/super-tiny-compiler-unannotated.js @@ -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]; diff --git a/super-tiny-compiler.js b/super-tiny-compiler.js index 8ceefe9..16effec 100644 --- a/super-tiny-compiler.js +++ b/super-tiny-compiler.js @@ -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`.