Skip to content

Commit

Permalink
Change while type.
Browse files Browse the repository at this point in the history
  • Loading branch information
pyldin601 committed Nov 6, 2017
1 parent 4d12770 commit c83eaef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/parser/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const parseExpression = (tokens: IterableIterator<IToken>, type: IExpressionNode
};

function* generateNodes(tokens: IterableIterator<IToken>, type: NodeType): IterableIterator<INode> {
do {
while (sequentialNodeTypes.has(type)) {
const nextValue = tokens.next();

if (nextValue.done) {
Expand Down Expand Up @@ -108,7 +108,7 @@ function* generateNodes(tokens: IterableIterator<IToken>, type: NodeType): Itera
default:
throw new Error(`Unexpected token - ${token.type}`);
}
} while (sequentialNodeTypes.has(type));
}
}

export default (tokens: IterableIterator<IToken>) => parseExpression(tokens, NodeType.ROOT_EXPRESSION);

0 comments on commit c83eaef

Please sign in to comment.