var EX_EOF = {};
-function tokenizer($TEXT, filename) {
+function tokenizer($TEXT, filename, position) {
var S = {
text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''),
filename : filename,
- pos : 0,
- tokpos : 0,
- line : 1,
- tokline : 0,
- col : 0,
- tokcol : 0,
+ pos : position && position.pos || 0,
+ tokpos : position && position.pos || 0,
+ line : position && position.line || 1,
+ tokline : position && position.line || 1,
+ col : position && position.col || 0,
+ tokcol : position && position.col || 0,
newline_before : false,
regex_allowed : false,
comments_before : []
strict : false,
filename : null,
toplevel : null,
- expression : false
+ expression : false,
+ position : { pos: 0, line: 1, col: 0 },
});
var S = {