diff --git a/errors.js b/errors.js index 466d800..7456886 100644 --- a/errors.js +++ b/errors.js @@ -11,7 +11,7 @@ function JSyntaxError(linenum, charnum, message) { this.errormessage = message; this.stxerror = function() { console.log("Syntax Error\n", - "Line #", this.linenum-2,"\n", + "Line #", this.linenum,"\n", "Near character #", this.charnum, "\n", this.errormessage); }; diff --git a/tokenize.js b/tokenize.js index c7f0036..56de382 100755 --- a/tokenize.js +++ b/tokenize.js @@ -299,6 +299,12 @@ function tokenize(tokstream, matchop) { tokstream = tokstream.substr(5); break; } + var deftype = peek(tokstream, "deftype", "deftype"); + if (deftype) { + tokens.push(["deftype", "deftype", charnum, linenum]); + tokstream = tokstream.substr(7); + break + } var def = peek(tokstream, "def", "def"); if (def) { tokens.push(["def", "def", charnum, linenum]);