Skip to content

Commit

Permalink
Optimize script parser (#173)
Browse files Browse the repository at this point in the history
* Implement lazy string literal parsing
* Fix bug in Vector

Signed-off-by: seonghyun kim <[email protected]>
  • Loading branch information
ksh8281 authored and yichoi committed Dec 13, 2018
1 parent 060df09 commit ee036ce
Show file tree
Hide file tree
Showing 9 changed files with 432 additions and 222 deletions.
9 changes: 6 additions & 3 deletions src/parser/ast/FunctionExpressionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,13 @@ class FunctionExpressionNode : public ExpressionNode {
{
CodeBlock* blk = nullptr;
size_t cnt = 0;
for (size_t i = 0; i < context->m_codeBlock->asInterpretedCodeBlock()->childBlocks().size(); i++) {
CodeBlock* c = context->m_codeBlock->asInterpretedCodeBlock()->childBlocks()[i];
const auto& childBlocks = context->m_codeBlock->asInterpretedCodeBlock()->childBlocks();
size_t len = childBlocks.size();
size_t counter = context->m_feCounter;
for (size_t i = 0; i < len; i++) {
CodeBlock* c = childBlocks[i];
if (c->isFunctionExpression()) {
if (cnt == context->m_feCounter) {
if (cnt == counter) {
blk = c;
break;
}
Expand Down
Loading

0 comments on commit ee036ce

Please sign in to comment.