|
|
@ -584,7 +584,7 @@ function generateJS( ast, session, options ) {
|
|
|
|
function s( i ) {
|
|
|
|
function s( i ) {
|
|
|
|
|
|
|
|
|
|
|
|
// istanbul ignore next
|
|
|
|
// istanbul ignore next
|
|
|
|
if ( i < 0 ) session.fail( "Rule '" + rule.name + "': Var stack underflow: attempt to use var at index " + i );
|
|
|
|
if ( i < 0 ) session.fatal( "Rule '" + rule.name + "': Var stack underflow: attempt to use var at index " + i );
|
|
|
|
|
|
|
|
|
|
|
|
return "s" + i;
|
|
|
|
return "s" + i;
|
|
|
|
|
|
|
|
|
|
|
@ -663,7 +663,7 @@ function generateJS( ast, session, options ) {
|
|
|
|
// istanbul ignore if
|
|
|
|
// istanbul ignore if
|
|
|
|
if ( thenSp !== elseSp ) {
|
|
|
|
if ( thenSp !== elseSp ) {
|
|
|
|
|
|
|
|
|
|
|
|
session.fail(
|
|
|
|
session.fatal(
|
|
|
|
"Rule '" + rule.name + "', position " + pos + ": "
|
|
|
|
"Rule '" + rule.name + "', position " + pos + ": "
|
|
|
|
+ "Branches of a condition can't move the stack pointer differently "
|
|
|
|
+ "Branches of a condition can't move the stack pointer differently "
|
|
|
|
+ "(before: " + baseSp + ", after then: " + thenSp + ", after else: " + elseSp + ")."
|
|
|
|
+ "(before: " + baseSp + ", after then: " + thenSp + ", after else: " + elseSp + ")."
|
|
|
@ -701,7 +701,7 @@ function generateJS( ast, session, options ) {
|
|
|
|
// istanbul ignore if
|
|
|
|
// istanbul ignore if
|
|
|
|
if ( bodySp !== baseSp ) {
|
|
|
|
if ( bodySp !== baseSp ) {
|
|
|
|
|
|
|
|
|
|
|
|
session.fail(
|
|
|
|
session.fatal(
|
|
|
|
"Rule '" + rule.name + "', position " + pos + ": "
|
|
|
|
"Rule '" + rule.name + "', position " + pos + ": "
|
|
|
|
+ "Body of a loop can't move the stack pointer "
|
|
|
|
+ "Body of a loop can't move the stack pointer "
|
|
|
|
+ "(before: " + baseSp + ", after: " + bodySp + ")."
|
|
|
|
+ "(before: " + baseSp + ", after: " + bodySp + ")."
|
|
|
@ -927,7 +927,7 @@ function generateJS( ast, session, options ) {
|
|
|
|
|
|
|
|
|
|
|
|
// istanbul ignore next
|
|
|
|
// istanbul ignore next
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
session.fail(
|
|
|
|
session.fatal(
|
|
|
|
"Rule '" + rule.name + "', position " + ip + ": "
|
|
|
|
"Rule '" + rule.name + "', position " + ip + ": "
|
|
|
|
+ "Invalid opcode " + bc[ ip ] + "."
|
|
|
|
+ "Invalid opcode " + bc[ ip ] + "."
|
|
|
|
);
|
|
|
|
);
|
|
|
|