Skip to content

Commit

Permalink
subtraction should work for character constants. The results probably…
Browse files Browse the repository at this point in the history
… make the most sense as integers.
  • Loading branch information
JohnEarnest committed Mar 21, 2015
1 parent 2a2b07b commit bb0f717
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion oK.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ function checktype(n, t) {
if (n.t == t) { return n; }
throw new Error(typenames[t]+" expected, found "+typenames[n.t]+".");
}
function n(x) { return checktype(x, 0); }
function n(x) { if (x.t==0||x.t==1) { return x; } return checktype(x, 0); }
function l(x) { return checktype(x, 3); }
function d(x) { return checktype(x, 4); }
function a(x) { if (x.t > 2) { throw new Error("domain error."); } return x; }
Expand Down
1 change: 1 addition & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ test("{(x*2; 1+3*x)(x!2)}" , "{[x](x*2;1+3*x)@x!2}" );
test("{(x*2; 1+3*x)x!2}" , "{[x](x*2;1+3*x)@x!2}" );
test("{(x*2; 1+3*x)x!2}5" , "16" );
test("6 8 20(0)" , "6" );
test('"123"-"0"' , "1 2 3" );

//files();

Expand Down

0 comments on commit bb0f717

Please sign in to comment.