12345678910111213141516171819202122 |
- export class SourceInfo {
- static createSourceInfo (token) {
- return new SourceInfo(token.line, token.column, token.text.length);
- }
- static createSourceInfoFromList (tokenA, tokenB) {
- const line = tokenA.line;
- const column = tokenA.column;
-
-
- const size = tokenB.tokenIndex + 1 - tokenA.tokenIndex
- return new SourceInfo(line, column, size);
- }
- constructor (line, column, size) {
- this.line = line;
- this.column = column;
- this.size = size;
- }
- }
|