Skip to content

Commit b4e634c

Browse files
author
Johan Wiltink
committed
add message to syntax error
1 parent 450fd6e commit b4e634c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lambda-calculus.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
Lambda Calculus evaluator supporting:
33
- unlimited recursion
4+
- call by need
45
- fast (ish?) evaluation
56
- shortform syntax
67
@@ -212,7 +213,7 @@ function parseWith(cfg={}) {
212213
console.error(code);
213214
console.error(' '.repeat(i) + '^');
214215
console.error(msg + " at position " + i);
215-
throw new SyntaxError;
216+
throw new SyntaxError(msg);
216217
}
217218
function sp(i) { while ( whitespace.test( code[i] || "" ) ) i++; return i; }
218219
const expect = c => function(i) { return code[i]===c ? sp(i+1) : 0 ; } ;

0 commit comments

Comments
 (0)