added $propdoc to AST nodes and some cleanups

hopefully we can make the AST documentation self-generating
This commit is contained in:
Mihai Bazon
2012-10-09 16:25:45 +03:00
parent 9ead49641d
commit 1b0aab2ce9
7 changed files with 181 additions and 51 deletions

View File

@@ -528,7 +528,7 @@ function tokenizer($TEXT, filename) {
regexp += ch;
}
var mods = read_name();
return token("regexp", [ regexp, mods ]);
return token("regexp", new RegExp(regexp, mods));
});
};
@@ -1160,7 +1160,7 @@ function parse($TEXT, options) {
ret = new AST_String({ start: tok, end: tok, value: tok.value });
break;
case "regexp":
ret = new AST_RegExp({ start: tok, end: tok, pattern: tok.value[0], mods: tok.value[1] });
ret = new AST_RegExp({ start: tok, end: tok, value: tok.value });
break;
case "atom":
switch (tok.value) {