All files / src/abap/nodes token_node.ts

86.96% Statements 40/46
100% Branches 6/6
66.67% Functions 6/9
86.96% Lines 40/46

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461x 1x 1x 1x 1x 1x 1x 257846x 257846x 1x 1x     1x 1x     1x 1x     1x 1x 223x 223x 1x 1x 181100x 181100x 1x 1x 311017x 311017x 1x 1x 42016x 42016x 1x 1x 20171x 20171x 1x 1x 1x 1x 1x
import {Token} from "../1_lexer/tokens/_token";
import {INode} from "./_inode";
 
export class TokenNode implements INode {
  private readonly token: Token;
 
  public constructor(token: Token) {
    this.token = token;
  }
 
  public addChild(_n: INode): void {
    throw new Error("TokenNode, Method not implemented.");
  }
 
  public setChildren(_children: INode[]): void {
    throw new Error("TokenNode, Method not implemented.");
  }
 
  public getChildren(): readonly INode[] {
    return [];
  }
 
  public concatTokens(): string {
    return this.token.getStr();
  }
 
  public get(): Token {
    return this.token;
  }
 
  public countTokens(): number {
    return 1;
  }
 
  public getFirstToken(): Token {
    return this.token;
  }
 
  public getLastToken(): Token {
    return this.token;
  }
}
 
export class TokenNodeRegex extends TokenNode {
 
}