Browse Source

Merge pull request #13 from oftn/master

add 'deftype' keyword to tokenizer
pull/21/head
Wesley Kerfoot 11 years ago
parent
commit
54ed5f7bac
  1. 2
      errors.js
  2. 6
      tokenize.js

2
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);
};

6
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]);

Loading…
Cancel
Save