Skip to content

Commit

Permalink
v.4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikos M committed Sep 9, 2016
1 parent 0f00655 commit bd4b74e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
21 changes: 20 additions & 1 deletion build/prism_grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,25 @@ function empty( state, $id )
return state;
}

function stack_clone( stack, deep )
{
if ( null == stack ) return null;
if ( deep )
{
var stack2 = new Stack( stack.val ), ptr2 = stack2, ptr = stack;
while( ptr.prev )
{
ptr2.prev = new Stack( ptr.prev.val );
ptr = ptr.prev; ptr2 = ptr2.prev;
}
return stack2;
}
else
{
return stack;
}
}

function err_recover( state, stream, token, tokenizer )
{
//var just_space = false;
Expand Down Expand Up @@ -3293,7 +3312,7 @@ function State( unique, s )
self.line = s.line;
self.bline = s.bline;
self.status = s.status;
self.stack = s.stack/*.slice()*/;
self.stack = stack_clone( s.stack, false );
self.token = s.token;
self.block = s.block;
self.outer = s.outer ? [s.outer[0], s.outer[1], new State(unique, s.outer[2])] : null;
Expand Down
Loading

0 comments on commit bd4b74e

Please sign in to comment.