xast
Version:
AST parsing library
32 lines • 874 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Token = void 0;
const TokenKind_1 = require("./TokenKind");
class Token {
constructor(kind, start, end, line, column, value) {
this.kind = kind;
this.start = start;
this.end = end;
this.line = line;
this.column = column;
this.value = value;
this.prev = null;
this.next = null;
}
get [Symbol.toStringTag]() {
return 'Token';
}
toJSON() {
return {
kind: this.kind,
value: this.value,
line: this.line,
column: this.column,
};
}
getDescription() {
return (0, TokenKind_1.getTokenKindDescription)(this.kind) + (this.value != null ? ` "${this.value}"` : '');
}
}
exports.Token = Token;
//# sourceMappingURL=Token.js.map