All files / src/abap/2_statements/expressions sql_substring_regexpr.ts

100% Statements 23/23
100% Branches 1/1
100% Functions 1/1
100% Lines 23/23

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 241x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
import {seq, optPrio, altPrio, Expression, ver, tok} from "../combi";
import {IStatementRunnable} from "../statement_runnable";
import {Release} from "../../../version";
import {ParenLeftW, WParenRightW} from "../../1_lexer/tokens";
import {SQLRegexprPattern} from "./sql_regexpr_pattern";
import {SQLRegexprFrom} from "./sql_regexpr_from";
import {SQLRegexprOccurrence} from "./sql_regexpr_occurrence";
import {SQLRegexprGroup} from "./sql_regexpr_group";
 
export class SQLSubstringRegexpr extends Expression {
  public getRunnable(): IStatementRunnable {
    const name = altPrio("SUBSTRING_REGEXPR", "SUBSTR_REGEXPR");
    return ver(Release.v758, seq(
      name,
      tok(ParenLeftW),
      SQLRegexprPattern,
      optPrio(SQLRegexprFrom),
      optPrio(SQLRegexprOccurrence),
      optPrio(SQLRegexprGroup),
      tok(WParenRightW),
    ));
  }
}