All files / src/abap/3_structures/structures class_definition.ts

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

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     8x               8x      
import * as Statements from "../../2_statements/statements";
import {seq, opt, star, beginEnd, sta, sub} from "./_combi";
import {IStructure} from "./_structure";
import {PrivateSection} from "./private_section";
import {ProtectedSection} from "./protected_section";
import {PublicSection} from "./public_section";
import {SetExtendedCheck, TypePools} from "../../2_statements/statements";
import {IStructureRunnable} from "./_structure_runnable";
 
export class ClassDefinition implements IStructure {
 
  public getMatcher(): IStructureRunnable {
    const body = seq(
      opt(sta(SetExtendedCheck)),
      star(sta(TypePools)),
      opt(sub(PublicSection)),
      opt(sub(ProtectedSection)),
      opt(sub(PrivateSection)),
      opt(sta(SetExtendedCheck)));
 
    return beginEnd(sta(Statements.ClassDefinition), body, sta(Statements.EndClass));
  }
 
}