All files / src/abap/2_statements/statements modify_line.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  1x 1x 1x     1x       22x       22x 22x 22x 22x 22x 22x 22x 22x   22x 22x   22x   22x         22x      
import {IStatement} from "./_statement";
import {verNot, str, seq, alt, opt, per, plus, optPrio} from "../combi";
import {Source, Color} from "../expressions";
import {Version} from "../../../version";
import {IStatementRunnable} from "../statement_runnable";
 
export class ModifyLine implements IStatement {
 
  public getMatcher(): IStatementRunnable {
 
    const form = seq(alt("INVERSE", "INPUT"),
                     "=",
                     Source);
 
    const from = seq("FROM", Source);
    const value = seq("FIELD VALUE", plus(seq(Source, optPrio(from))));
    const format = seq("FIELD FORMAT", Source, opt(form));
    const lineValue = seq("LINE VALUE FROM", Source);
    const index = seq("INDEX", Source);
    const page = seq("OF PAGE", Source);
    const ocp = str("OF CURRENT PAGE");
    const lineFormat = seq("LINE FORMAT",
                           alt("INPUT OFF", "INVERSE", "RESET", "INTENSIFIED"));
    const onOff = alt("ON", "OFF");
    const intensified = seq("INTENSIFIED", onOff);
 
    const options = per(index, value, format, page, lineFormat, lineValue, ocp, intensified, Color);
 
    const ret = seq("MODIFY",
                    alt("CURRENT LINE",
                        seq("LINE", Source)),
                    opt(options));
 
    return verNot(Version.Cloud, ret);
  }
 
}