Browse Source

Not session.fail but session.fatal

master
Futago-za Ryuu 3 years ago
parent
commit
b3135690b0
  1. 8
      lib/compiler/passes/generate-js.js

8
lib/compiler/passes/generate-js.js

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

Loading…
Cancel
Save