All files / src/abap/2_statements/statements insert_internal.ts

100% Statements 18/18
100% Branches 0/0
100% Functions 1/1
100% Lines 18/18

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  1x 1x 1x     1x     67x 67x 67x 67x 67x 67x   67x   67x       67x   67x       67x   67x   67x     67x      
import {IStatement} from "./_statement";
import {str, seq, alt, opt, per, ver, altPrio} from "../combi";
import {Version} from "../../../version";
import {FSTarget, Target, Source, Dynamic, SimpleSource1} from "../expressions";
import {IStatementRunnable} from "../statement_runnable";
 
export class InsertInternal implements IStatement {
 
  public getMatcher(): IStatementRunnable {
    const target = alt(Source, Dynamic);
    const assigning = seq("ASSIGNING", FSTarget);
    const ref = seq("REFERENCE INTO", Target);
    const index = seq("INDEX", Source);
    const initial = str("INITIAL LINE");
    const into = seq("INTO", opt("TABLE"), Target);
 
    const to = seq("TO", Source);
 
    const from = seq("FROM",
                     Source,
                     opt(to));
 
    const foo = per(into, ref, index, assigning);
 
    const lines = seq("LINES OF",
                      target,
                      opt(from));
 
    const src = alt(ver(Version.v740sp02, Source), SimpleSource1);
 
    const tab = seq("TABLE", Source);
 
    const ret = seq("INSERT",
                    altPrio(tab, seq(altPrio(initial, lines, src), foo)));
 
    return ret;
  }
 
}