Skip to content

Commit 03f0cad

Browse files
committed
add more debug information over tokens
1 parent f94e01c commit 03f0cad

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

bin/formats/token.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ module.exports = {
3434
var entry = engine.lexer.yytext;
3535
if (names[token]) {
3636
entry = [names[token], entry, engine.lexer.yylloc.first_line];
37+
38+
}
39+
if (engine.parser.debug) {
40+
if (names[token]) {
41+
console.log(names[token], engine.lexer.yylloc.first_line, entry);
42+
} else {
43+
console.log('--> plain', engine.lexer.yylloc.first_line, token);
44+
}
3745
}
3846
jsTok.push(entry);
3947
token = engine.lexer.lex() || EOF;

0 commit comments

Comments
 (0)