@abaplint/cli 2.94.8 → 2.94.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +25 -25
- package/package.json +2 -2
package/build/cli.js
CHANGED
|
@@ -181,7 +181,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
181
181
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
182
182
|
|
|
183
183
|
"use strict";
|
|
184
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Lexer = void 0;\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst tokens_1 = __webpack_require__(/*! ./tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nclass Buffer {\r\n constructor() {\r\n this.buf = \"\";\r\n }\r\n add(s) {\r\n this.buf = this.buf + s;\r\n }\r\n get() {\r\n return this.buf;\r\n }\r\n clear() {\r\n this.buf = \"\";\r\n }\r\n countIsEven(char) {\r\n let count = 0;\r\n for (let i = 0; i < this.buf.length; i += 1) {\r\n if (this.buf.charAt(i) === char) {\r\n count += 1;\r\n }\r\n }\r\n return count % 2 === 0;\r\n }\r\n}\r\nclass Stream {\r\n constructor(raw) {\r\n this.offset = -1;\r\n this.raw = raw;\r\n this.row = 0;\r\n this.col = 0;\r\n }\r\n advance() {\r\n if (this.currentChar() === \"\\n\") {\r\n this.col = 1;\r\n this.row = this.row + 1;\r\n }\r\n if (this.offset === this.raw.length) {\r\n return false;\r\n }\r\n this.col = this.col + 1;\r\n this.offset = this.offset + 1;\r\n return true;\r\n }\r\n getCol() {\r\n return this.col;\r\n }\r\n getRow() {\r\n return this.row;\r\n }\r\n prevChar() {\r\n if (this.offset - 1 < 0) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset - 1, 1);\r\n }\r\n prevPrevChar() {\r\n if (this.offset - 2 < 0) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset - 2, 2);\r\n }\r\n currentChar() {\r\n if (this.offset < 0) {\r\n return \"\\n\"; // simulate newline at start of file to handle star(*) comments\r\n }\r\n else if (this.offset >= this.raw.length) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset, 1);\r\n }\r\n nextChar() {\r\n if (this.offset + 2 > this.raw.length) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset + 1, 1);\r\n }\r\n nextNextChar() {\r\n if (this.offset + 3 > this.raw.length) {\r\n return this.nextChar();\r\n }\r\n return this.raw.substr(this.offset + 1, 2);\r\n }\r\n getRaw() {\r\n return this.raw;\r\n }\r\n getOffset() {\r\n return this.offset;\r\n }\r\n}\r\nclass Lexer {\r\n constructor() {\r\n this.ModeNormal = 1;\r\n this.ModePing = 2;\r\n this.ModeStr = 3;\r\n this.ModeTemplate = 4;\r\n this.ModeComment = 5;\r\n this.ModePragma = 6;\r\n }\r\n run(file, virtual) {\r\n this.virtual = virtual;\r\n this.tokens = [];\r\n this.m = this.ModeNormal;\r\n this.process(file.getRaw());\r\n return { file, tokens: this.tokens };\r\n }\r\n add() {\r\n const s = this.buffer.get().trim();\r\n if (s.length > 0) {\r\n const col = this.stream.getCol();\r\n const row = this.stream.getRow();\r\n let whiteBefore = false;\r\n if (this.stream.getOffset() - s.length >= 0) {\r\n const prev = this.stream.getRaw().substr(this.stream.getOffset() - s.length, 1);\r\n if (prev === \" \" || prev === \"\\n\" || prev === \"\\t\" || prev === \":\") {\r\n whiteBefore = true;\r\n }\r\n }\r\n let whiteAfter = false;\r\n const next = this.stream.nextChar();\r\n if (next === \" \" || next === \"\\n\" || next === \"\\t\" || next === \":\" || next === \",\" || next === \".\" || next === \"\" || next === \"\\\"\") {\r\n whiteAfter = true;\r\n }\r\n let pos = new position_1.Position(row, col - s.length);\r\n if (this.virtual) {\r\n pos = new position_1.VirtualPosition(this.virtual, pos.getRow(), pos.getCol());\r\n }\r\n let tok = undefined;\r\n if (this.m === this.ModeComment) {\r\n tok = new tokens_1.Comment(pos, s);\r\n }\r\n else if (this.m === this.ModePing || this.m === this.ModeStr) {\r\n tok = new tokens_1.StringToken(pos, s);\r\n }\r\n else if (this.m === this.ModeTemplate) {\r\n const first = s.charAt(0);\r\n const last = s.charAt(s.length - 1);\r\n if (first === \"|\" && last === \"|\") {\r\n tok = new tokens_1.StringTemplate(pos, s);\r\n }\r\n else if (first === \"|\" && last === \"{\" && whiteAfter === true) {\r\n tok = new tokens_1.StringTemplateBegin(pos, s);\r\n }\r\n else if (first === \"}\" && last === \"|\" && whiteBefore === true) {\r\n tok = new tokens_1.StringTemplateEnd(pos, s);\r\n }\r\n else if (first === \"}\" && last === \"{\" && whiteAfter === true && whiteBefore === true) {\r\n tok = new tokens_1.StringTemplateMiddle(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Identifier(pos, s);\r\n }\r\n }\r\n else if (s.length > 2 && s.substr(0, 2) === \"##\") {\r\n tok = new tokens_1.Pragma(pos, s);\r\n }\r\n else if (s.length === 1) {\r\n if (s === \".\" || s === \",\") {\r\n tok = new tokens_1.Punctuation(pos, s);\r\n }\r\n else if (s === \"[\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WBracketLeftW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WBracketLeft(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.BracketLeftW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.BracketLeft(pos, s);\r\n }\r\n }\r\n else if (s === \"(\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WParenLeftW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WParenLeft(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.ParenLeftW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.ParenLeft(pos, s);\r\n }\r\n }\r\n else if (s === \"]\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WBracketRightW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WBracketRight(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.BracketRightW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.BracketRight(pos, s);\r\n }\r\n }\r\n else if (s === \")\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WParenRightW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WParenRight(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.ParenRightW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.ParenRight(pos, s);\r\n }\r\n }\r\n else if (s === \"-\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WDashW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WDash(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.DashW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Dash(pos, s);\r\n }\r\n }\r\n else if (s === \"+\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WPlusW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WPlus(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.PlusW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Plus(pos, s);\r\n }\r\n }\r\n else if (s === \"@\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WAtW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WAt(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.AtW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.At(pos, s);\r\n }\r\n }\r\n }\r\n else if (s.length === 2) {\r\n if (s === \"->\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WInstanceArrowW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WInstanceArrow(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.InstanceArrowW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.InstanceArrow(pos, s);\r\n }\r\n }\r\n else if (s === \"=>\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WStaticArrowW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WStaticArrow(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.StaticArrowW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.StaticArrow(pos, s);\r\n }\r\n }\r\n }\r\n if (tok === undefined) {\r\n tok = new tokens_1.Identifier(pos, s);\r\n }\r\n this.tokens.push(tok);\r\n }\r\n this.buffer.clear();\r\n }\r\n process(raw) {\r\n this.stream = new Stream(raw.replace(/\\r/g, \"\"));\r\n this.buffer = new Buffer();\r\n for (;;) {\r\n const current = this.stream.currentChar();\r\n this.buffer.add(current);\r\n const buf = this.buffer.get();\r\n const ahead = this.stream.nextChar();\r\n const aahead = this.stream.nextNextChar();\r\n const prev = this.stream.prevChar();\r\n if (ahead === \"'\" && this.m === this.ModeNormal) {\r\n // start string\r\n this.add();\r\n this.m = this.ModeStr;\r\n }\r\n else if ((ahead === \"|\" || ahead === \"}\")\r\n && this.m === this.ModeNormal) {\r\n // start template\r\n this.add();\r\n this.m = this.ModeTemplate;\r\n }\r\n else if (ahead === \"`\" && this.m === this.ModeNormal) {\r\n // start ping\r\n this.add();\r\n this.m = this.ModePing;\r\n }\r\n else if (aahead === \"##\" && this.m === this.ModeNormal) {\r\n // start pragma\r\n this.add();\r\n this.m = this.ModePragma;\r\n }\r\n else if ((ahead === \"\\\"\" || (ahead === \"*\" && current === \"\\n\"))\r\n && this.m === this.ModeNormal) {\r\n // start comment\r\n this.add();\r\n this.m = this.ModeComment;\r\n }\r\n else if (this.m === this.ModePragma && (ahead === \",\" || ahead === \":\" || ahead === \".\" || ahead === \" \" || ahead === \"\\n\")) {\r\n // end of pragma\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModePing\r\n && buf.length > 1\r\n && current === \"`\"\r\n && aahead !== \"``\"\r\n && ahead !== \"`\"\r\n && this.buffer.countIsEven(\"`\")) {\r\n // end of ping\r\n this.add();\r\n if (ahead === `\"`) {\r\n this.m = this.ModeComment;\r\n }\r\n else {\r\n this.m = this.ModeNormal;\r\n }\r\n }\r\n else if (this.m === this.ModeTemplate\r\n && buf.length > 1\r\n && (current === \"|\" || current === \"{\")\r\n && (prev !== \"\\\\\" || this.stream.prevPrevChar() === \"\\\\\\\\\")) {\r\n // end of template\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModeStr\r\n && current === \"'\"\r\n && buf.length > 1\r\n && aahead !== \"''\"\r\n && ahead !== \"'\"\r\n && this.buffer.countIsEven(\"'\")) {\r\n // end of string\r\n this.add();\r\n if (ahead === \"\\\"\") {\r\n this.m = this.ModeComment;\r\n }\r\n else {\r\n this.m = this.ModeNormal;\r\n }\r\n }\r\n else if (this.m === this.ModeNormal\r\n && (ahead === \" \"\r\n || ahead === \":\"\r\n || ahead === \".\"\r\n || ahead === \",\"\r\n || ahead === \"-\"\r\n || ahead === \"+\"\r\n || ahead === \"(\"\r\n || ahead === \")\"\r\n || ahead === \"[\"\r\n || ahead === \"]\"\r\n || (ahead === \"@\" && buf.trim().length === 0)\r\n || aahead === \"->\"\r\n || aahead === \"=>\"\r\n || ahead === \"\\t\"\r\n || ahead === \"\\n\")) {\r\n this.add();\r\n }\r\n else if (ahead === \"\\n\" && this.m !== this.ModeTemplate) {\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModeTemplate && current === \"\\n\") {\r\n this.add();\r\n }\r\n else if (current === \">\"\r\n && (prev === \"-\" || prev === \"=\")\r\n && ahead !== \" \"\r\n && this.m === this.ModeNormal) {\r\n // arrows\r\n this.add();\r\n }\r\n else if (this.m === this.ModeNormal\r\n && (buf === \".\"\r\n || buf === \",\"\r\n || buf === \":\"\r\n || buf === \"(\"\r\n || buf === \")\"\r\n || buf === \"[\"\r\n || buf === \"]\"\r\n || buf === \"+\"\r\n || buf === \"@\"\r\n || (buf === \"-\" && ahead !== \">\"))) {\r\n this.add();\r\n }\r\n if (!this.stream.advance()) {\r\n break;\r\n }\r\n }\r\n this.add();\r\n }\r\n}\r\nexports.Lexer = Lexer;\r\n//# sourceMappingURL=lexer.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer.js?");
|
|
184
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Lexer = void 0;\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst tokens_1 = __webpack_require__(/*! ./tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nclass Buffer {\r\n constructor() {\r\n this.buf = \"\";\r\n }\r\n add(s) {\r\n this.buf = this.buf + s;\r\n return this.buf;\r\n }\r\n get() {\r\n return this.buf;\r\n }\r\n clear() {\r\n this.buf = \"\";\r\n }\r\n countIsEven(char) {\r\n let count = 0;\r\n for (let i = 0; i < this.buf.length; i += 1) {\r\n if (this.buf.charAt(i) === char) {\r\n count += 1;\r\n }\r\n }\r\n return count % 2 === 0;\r\n }\r\n}\r\nclass Stream {\r\n constructor(raw) {\r\n this.offset = -1;\r\n this.raw = raw;\r\n this.row = 0;\r\n this.col = 0;\r\n }\r\n advance() {\r\n if (this.currentChar() === \"\\n\") {\r\n this.col = 1;\r\n this.row = this.row + 1;\r\n }\r\n if (this.offset === this.raw.length) {\r\n return false;\r\n }\r\n this.col = this.col + 1;\r\n this.offset = this.offset + 1;\r\n return true;\r\n }\r\n getCol() {\r\n return this.col;\r\n }\r\n getRow() {\r\n return this.row;\r\n }\r\n prevChar() {\r\n if (this.offset - 1 < 0) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset - 1, 1);\r\n }\r\n prevPrevChar() {\r\n if (this.offset - 2 < 0) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset - 2, 2);\r\n }\r\n currentChar() {\r\n if (this.offset < 0) {\r\n return \"\\n\"; // simulate newline at start of file to handle star(*) comments\r\n }\r\n else if (this.offset >= this.raw.length) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset, 1);\r\n }\r\n nextChar() {\r\n if (this.offset + 2 > this.raw.length) {\r\n return \"\";\r\n }\r\n return this.raw.substr(this.offset + 1, 1);\r\n }\r\n nextNextChar() {\r\n if (this.offset + 3 > this.raw.length) {\r\n return this.nextChar();\r\n }\r\n return this.raw.substr(this.offset + 1, 2);\r\n }\r\n getRaw() {\r\n return this.raw;\r\n }\r\n getOffset() {\r\n return this.offset;\r\n }\r\n}\r\nclass Lexer {\r\n constructor() {\r\n this.ModeNormal = 1;\r\n this.ModePing = 2;\r\n this.ModeStr = 3;\r\n this.ModeTemplate = 4;\r\n this.ModeComment = 5;\r\n this.ModePragma = 6;\r\n }\r\n run(file, virtual) {\r\n this.virtual = virtual;\r\n this.tokens = [];\r\n this.m = this.ModeNormal;\r\n this.process(file.getRaw());\r\n return { file, tokens: this.tokens };\r\n }\r\n add() {\r\n const s = this.buffer.get().trim();\r\n if (s.length > 0) {\r\n const col = this.stream.getCol();\r\n const row = this.stream.getRow();\r\n let whiteBefore = false;\r\n if (this.stream.getOffset() - s.length >= 0) {\r\n const prev = this.stream.getRaw().substr(this.stream.getOffset() - s.length, 1);\r\n if (prev === \" \" || prev === \"\\n\" || prev === \"\\t\" || prev === \":\") {\r\n whiteBefore = true;\r\n }\r\n }\r\n let whiteAfter = false;\r\n const next = this.stream.nextChar();\r\n if (next === \" \" || next === \"\\n\" || next === \"\\t\" || next === \":\" || next === \",\" || next === \".\" || next === \"\" || next === \"\\\"\") {\r\n whiteAfter = true;\r\n }\r\n let pos = new position_1.Position(row, col - s.length);\r\n if (this.virtual) {\r\n pos = new position_1.VirtualPosition(this.virtual, pos.getRow(), pos.getCol());\r\n }\r\n let tok = undefined;\r\n if (this.m === this.ModeComment) {\r\n tok = new tokens_1.Comment(pos, s);\r\n }\r\n else if (this.m === this.ModePing || this.m === this.ModeStr) {\r\n tok = new tokens_1.StringToken(pos, s);\r\n }\r\n else if (this.m === this.ModeTemplate) {\r\n const first = s.charAt(0);\r\n const last = s.charAt(s.length - 1);\r\n if (first === \"|\" && last === \"|\") {\r\n tok = new tokens_1.StringTemplate(pos, s);\r\n }\r\n else if (first === \"|\" && last === \"{\" && whiteAfter === true) {\r\n tok = new tokens_1.StringTemplateBegin(pos, s);\r\n }\r\n else if (first === \"}\" && last === \"|\" && whiteBefore === true) {\r\n tok = new tokens_1.StringTemplateEnd(pos, s);\r\n }\r\n else if (first === \"}\" && last === \"{\" && whiteAfter === true && whiteBefore === true) {\r\n tok = new tokens_1.StringTemplateMiddle(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Identifier(pos, s);\r\n }\r\n }\r\n else if (s.length > 2 && s.substr(0, 2) === \"##\") {\r\n tok = new tokens_1.Pragma(pos, s);\r\n }\r\n else if (s.length === 1) {\r\n if (s === \".\" || s === \",\") {\r\n tok = new tokens_1.Punctuation(pos, s);\r\n }\r\n else if (s === \"[\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WBracketLeftW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WBracketLeft(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.BracketLeftW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.BracketLeft(pos, s);\r\n }\r\n }\r\n else if (s === \"(\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WParenLeftW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WParenLeft(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.ParenLeftW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.ParenLeft(pos, s);\r\n }\r\n }\r\n else if (s === \"]\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WBracketRightW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WBracketRight(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.BracketRightW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.BracketRight(pos, s);\r\n }\r\n }\r\n else if (s === \")\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WParenRightW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WParenRight(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.ParenRightW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.ParenRight(pos, s);\r\n }\r\n }\r\n else if (s === \"-\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WDashW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WDash(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.DashW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Dash(pos, s);\r\n }\r\n }\r\n else if (s === \"+\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WPlusW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WPlus(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.PlusW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.Plus(pos, s);\r\n }\r\n }\r\n else if (s === \"@\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WAtW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WAt(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.AtW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.At(pos, s);\r\n }\r\n }\r\n }\r\n else if (s.length === 2) {\r\n if (s === \"->\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WInstanceArrowW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WInstanceArrow(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.InstanceArrowW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.InstanceArrow(pos, s);\r\n }\r\n }\r\n else if (s === \"=>\") {\r\n if (whiteBefore === true && whiteAfter === true) {\r\n tok = new tokens_1.WStaticArrowW(pos, s);\r\n }\r\n else if (whiteBefore === true) {\r\n tok = new tokens_1.WStaticArrow(pos, s);\r\n }\r\n else if (whiteAfter === true) {\r\n tok = new tokens_1.StaticArrowW(pos, s);\r\n }\r\n else {\r\n tok = new tokens_1.StaticArrow(pos, s);\r\n }\r\n }\r\n }\r\n if (tok === undefined) {\r\n tok = new tokens_1.Identifier(pos, s);\r\n }\r\n this.tokens.push(tok);\r\n }\r\n this.buffer.clear();\r\n }\r\n process(raw) {\r\n this.stream = new Stream(raw.replace(/\\r/g, \"\"));\r\n this.buffer = new Buffer();\r\n const splits = {};\r\n splits[\" \"] = true;\r\n splits[\":\"] = true;\r\n splits[\".\"] = true;\r\n splits[\",\"] = true;\r\n splits[\"-\"] = true;\r\n splits[\"+\"] = true;\r\n splits[\"(\"] = true;\r\n splits[\")\"] = true;\r\n splits[\"[\"] = true;\r\n splits[\"]\"] = true;\r\n splits[\"\\t\"] = true;\r\n splits[\"\\n\"] = true;\r\n const bufs = {};\r\n bufs[\".\"] = true;\r\n bufs[\",\"] = true;\r\n bufs[\":\"] = true;\r\n bufs[\"(\"] = true;\r\n bufs[\")\"] = true;\r\n bufs[\"[\"] = true;\r\n bufs[\"]\"] = true;\r\n bufs[\"+\"] = true;\r\n bufs[\"@\"] = true;\r\n for (;;) {\r\n const current = this.stream.currentChar();\r\n const buf = this.buffer.add(current);\r\n const ahead = this.stream.nextChar();\r\n const aahead = this.stream.nextNextChar();\r\n if (this.m === this.ModeNormal) {\r\n if (ahead === \"'\") {\r\n // start string\r\n this.add();\r\n this.m = this.ModeStr;\r\n }\r\n else if (ahead === \"|\" || ahead === \"}\") {\r\n // start template\r\n this.add();\r\n this.m = this.ModeTemplate;\r\n }\r\n else if (ahead === \"`\") {\r\n // start ping\r\n this.add();\r\n this.m = this.ModePing;\r\n }\r\n else if (aahead === \"##\") {\r\n // start pragma\r\n this.add();\r\n this.m = this.ModePragma;\r\n }\r\n else if (ahead === \"\\\"\"\r\n || (ahead === \"*\" && current === \"\\n\")) {\r\n // start comment\r\n this.add();\r\n this.m = this.ModeComment;\r\n }\r\n else if (splits[ahead]) {\r\n this.add();\r\n }\r\n else if (ahead === \"@\" && buf.trim().length === 0) {\r\n this.add();\r\n }\r\n else if (aahead === \"->\"\r\n || aahead === \"=>\") {\r\n this.add();\r\n }\r\n else if (current === \">\"\r\n && ahead !== \" \"\r\n && (this.stream.prevChar() === \"-\" || this.stream.prevChar() === \"=\")) {\r\n // arrows\r\n this.add();\r\n }\r\n else if (buf.length === 1\r\n && (bufs[buf]\r\n || (buf === \"-\" && ahead !== \">\"))) {\r\n this.add();\r\n }\r\n }\r\n else if (this.m === this.ModePragma && (ahead === \",\" || ahead === \":\" || ahead === \".\" || ahead === \" \" || ahead === \"\\n\")) {\r\n // end of pragma\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModePing\r\n && buf.length > 1\r\n && current === \"`\"\r\n && aahead !== \"``\"\r\n && ahead !== \"`\"\r\n && this.buffer.countIsEven(\"`\")) {\r\n // end of ping\r\n this.add();\r\n if (ahead === `\"`) {\r\n this.m = this.ModeComment;\r\n }\r\n else {\r\n this.m = this.ModeNormal;\r\n }\r\n }\r\n else if (this.m === this.ModeTemplate\r\n && buf.length > 1\r\n && (current === \"|\" || current === \"{\")\r\n && (this.stream.prevChar() !== \"\\\\\" || this.stream.prevPrevChar() === \"\\\\\\\\\")) {\r\n // end of template\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModeStr\r\n && current === \"'\"\r\n && buf.length > 1\r\n && aahead !== \"''\"\r\n && ahead !== \"'\"\r\n && this.buffer.countIsEven(\"'\")) {\r\n // end of string\r\n this.add();\r\n if (ahead === \"\\\"\") {\r\n this.m = this.ModeComment;\r\n }\r\n else {\r\n this.m = this.ModeNormal;\r\n }\r\n }\r\n else if (ahead === \"\\n\" && this.m !== this.ModeTemplate) {\r\n this.add();\r\n this.m = this.ModeNormal;\r\n }\r\n else if (this.m === this.ModeTemplate && current === \"\\n\") {\r\n this.add();\r\n }\r\n if (!this.stream.advance()) {\r\n break;\r\n }\r\n }\r\n this.add();\r\n }\r\n}\r\nexports.Lexer = Lexer;\r\n//# sourceMappingURL=lexer.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/1_lexer/lexer.js?");
|
|
185
185
|
|
|
186
186
|
/***/ }),
|
|
187
187
|
|
|
@@ -379,7 +379,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
379
379
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
380
380
|
|
|
381
381
|
"use strict";
|
|
382
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.failStar = exports.failCombinator = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;\r\nconst Tokens = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst result_1 = __webpack_require__(/*! ./result */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/result.js\");\r\nclass Regex {\r\n constructor(r) {\r\n this.regexp = r;\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() === 0) {\r\n continue;\r\n }\r\n const token = input.peek();\r\n if (this.regexp.test(token.getStr()) === true) {\r\n result.push(input.shift(new nodes_1.TokenNodeRegex(token)));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal(\\\"\" + this.regexp.source.replace(/\\\\/g, \"\\\\\\\\\") + \"\\\")\";\r\n }\r\n toStr() {\r\n return this.regexp.toString();\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Word {\r\n constructor(s) {\r\n this.s = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [this.s];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().getStr().toUpperCase() === this.s) {\r\n // console.log(\"match, \" + this.s + result.length);\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.s + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"\\\"\" + this.s + \"\\\"\";\r\n }\r\n first() {\r\n return [this.s];\r\n }\r\n}\r\nclass Token {\r\n constructor(s) {\r\n this.name = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().constructor.name.toUpperCase() === this.name) {\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n let text = this.name;\r\n const toke = Tokens;\r\n for (const token in Tokens) {\r\n if (token.toUpperCase() === this.name && toke[token].railroad) {\r\n text = toke[token].railroad();\r\n break;\r\n }\r\n }\r\n return \"Railroad.Terminal('!\\\"\" + text + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"Token \\\"\" + this.name + \"\\\"\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Vers {\r\n constructor(version, runnable, or) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n this.or = or;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n run(r) {\r\n const targetVersion = Combi.getVersion();\r\n if (this.or && targetVersion === this.or) {\r\n return this.runnable.run(r);\r\n }\r\n else if (targetVersion === version_1.Version.OpenABAP) {\r\n if (this.version > version_1.Version.v702) {\r\n return [];\r\n }\r\n else {\r\n return this.runnable.run(r);\r\n }\r\n }\r\n else if (targetVersion >= this.version || targetVersion === version_1.Version.Cloud) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n railroad() {\r\n let text = this.version;\r\n if (this.or) {\r\n text += \" or \" + this.or;\r\n }\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"\" +\r\n text +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"Version(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass VersNot {\r\n constructor(version, runnable) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n run(r) {\r\n if (Combi.getVersion() !== this.version) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n railroad() {\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"not \" +\r\n this.version +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"VersionNot(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass OptionalPriority {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n const res = this.optional.run([input]);\r\n if (res.length > 1) {\r\n result.push(...res);\r\n }\r\n else if (res.length === 0) {\r\n result.push(input);\r\n }\r\n else if (res[0].remainingLength() < input.remainingLength()) {\r\n result.push(...res);\r\n }\r\n else {\r\n result.push(input);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Optional {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n result.push(input);\r\n const res = this.optional.run([input]);\r\n result.push(...res);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Star {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n const result = r;\r\n try {\r\n let res = r;\r\n let input = [];\r\n for (;;) {\r\n input = res;\r\n res = this.sta.run(input);\r\n if (res.length === 0) {\r\n break;\r\n }\r\n result.push(...res);\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof FailStarError) {\r\n return result;\r\n }\r\n throw err;\r\n }\r\n // console.dir(result);\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass StarPrioroity {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n let result = r;\r\n let res = r;\r\n // let input: Result[] = [];\r\n let prev;\r\n for (;;) {\r\n // input = res;\r\n res = this.sta.run(res);\r\n if (res.length === 0) {\r\n if (prev !== undefined) {\r\n // console.log(\"star length: \" + prev.length);\r\n let best = Number.MAX_SAFE_INTEGER;\r\n for (const p of prev) {\r\n if (p.remainingLength() < best) {\r\n result = [p];\r\n best = p.remainingLength();\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n prev = res;\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Plus {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new Star(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass PlusPriority {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new StarPrioroity(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass Sequence {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Sequence, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n let temp = [input];\r\n let match = true;\r\n for (const sequence of this.list) {\r\n temp = sequence.run(temp);\r\n if (temp.length === 0) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n if (match === true) {\r\n result.push(...temp);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Sequence(\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"seq(\" + ret + \")\";\r\n }\r\n first() {\r\n return this.list[0].first();\r\n }\r\n}\r\nclass WordSequence {\r\n constructor(stri) {\r\n this.words = [];\r\n this.stri = stri;\r\n const foo = this.stri.replace(/-/g, \" - \");\r\n const split = foo.split(\" \");\r\n for (const st of split) {\r\n // todo, use Dash token\r\n this.words.push(new Word(st));\r\n }\r\n this.seq = new Sequence(this.words);\r\n }\r\n listKeywords() {\r\n return [this.stri.toString()];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n return this.seq.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.stri + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"str(\" + this.stri + \")\";\r\n }\r\n first() {\r\n return this.words[0].first();\r\n }\r\n}\r\nclass Expression {\r\n constructor() {\r\n this.runnable = undefined;\r\n }\r\n run(r) {\r\n const results = [];\r\n if (this.runnable === undefined) {\r\n this.runnable = this.getRunnable();\r\n }\r\n for (const input of r) {\r\n const temp = this.runnable.run([input]);\r\n for (const t of temp) {\r\n let consumed = input.remainingLength() - t.remainingLength();\r\n if (consumed > 0) {\r\n const originalLength = t.getNodes().length;\r\n const children = [];\r\n while (consumed > 0) {\r\n const sub = t.popNode();\r\n if (sub) {\r\n children.push(sub);\r\n consumed = consumed - sub.countTokens();\r\n }\r\n }\r\n const re = new nodes_1.ExpressionNode(this);\r\n re.setChildren(children.reverse());\r\n const n = t.getNodes().slice(0, originalLength - consumed);\r\n n.push(re);\r\n t.setNodes(n);\r\n }\r\n results.push(t);\r\n }\r\n }\r\n // console.dir(results);\r\n return results;\r\n }\r\n listKeywords() {\r\n // do not recurse, all Expressions are evaluated only on first level\r\n return [];\r\n }\r\n getUsing() {\r\n return [\"expression/\" + this.getName()];\r\n }\r\n getName() {\r\n return this.constructor.name;\r\n }\r\n railroad() {\r\n return \"Railroad.NonTerminal('\" + this.getName() + \"', {href: '#/expression/\" + this.getName() + \"'})\";\r\n }\r\n toStr() {\r\n return \"expression(\" + this.getName() + \")\";\r\n }\r\n first() {\r\n return this.getRunnable().first();\r\n }\r\n}\r\nexports.Expression = Expression;\r\nclass Permutation {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Permutation, length error, got \" + list.length);\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n const copy = this.list.slice();\r\n for (let index = 0; index < this.list.length; index++) {\r\n const temp = this.list[index].run(r);\r\n if (temp.length !== 0) {\r\n // match\r\n result.push(...temp);\r\n const left = copy;\r\n left.splice(index, 1);\r\n if (left.length === 1) {\r\n result.push(...left[0].run(temp));\r\n }\r\n else {\r\n result.push(...new Permutation(left).run(temp));\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.MultipleChoice(0, 'any',\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n const children = this.list.map((e) => { return e.toStr(); });\r\n return \"per(\" + children.join() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass FailCombinatorError extends Error {\r\n}\r\nclass FailStarError extends Error {\r\n}\r\nclass FailCombinator {\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(_r) {\r\n throw new FailCombinatorError();\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('!FailCombinator')\";\r\n }\r\n toStr() {\r\n return \"fail()\";\r\n }\r\n first() {\r\n return [];\r\n }\r\n}\r\n// Note that Plus is implemented with Star\r\nclass FailStar {\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(_r) {\r\n throw new FailStarError();\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('!FailStar')\";\r\n }\r\n toStr() {\r\n return \"fail()\";\r\n }\r\n first() {\r\n return [];\r\n }\r\n}\r\nclass Alternative {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n const temp = sequ.run(r);\r\n result.push(...temp);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\n// prioritized alternative, skip others if match found\r\nclass AlternativePriority {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n // console.log(seq.toStr());\r\n const temp = sequ.run(r);\r\n if (temp.length > 0) {\r\n result.push(...temp);\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\nclass Combi {\r\n static railroad(runnable, complex = false) {\r\n // todo, move method to graph.js?\r\n let type = \"Railroad.Diagram(\";\r\n if (complex === true) {\r\n type = \"Railroad.ComplexDiagram(\";\r\n }\r\n const result = \"Railroad.Diagram.INTERNAL_ALIGNMENT = 'left';\\n\" +\r\n type +\r\n runnable.railroad() +\r\n \").toString();\";\r\n return result;\r\n }\r\n static listKeywords(runnable) {\r\n // todo, move these walkers of the syntax tree to some abstraction?\r\n let res = runnable.listKeywords();\r\n // remove duplicates\r\n res = res.filter((x, i, a) => { return a.indexOf(x) === i; });\r\n return res;\r\n }\r\n // assumption: no pragmas supplied in tokens input\r\n static run(runnable, tokens, version) {\r\n this.ver = version;\r\n const input = new result_1.Result(tokens, 0);\r\n try {\r\n const result = runnable.run([input]);\r\n /*\r\n console.log(\"res: \" + result.length);\r\n for (const res of result) {\r\n console.dir(res.getNodes().map(n => n.get().constructor.name));\r\n console.dir(res.getNodes().map(n => n.concatTokens()));\r\n }\r\n */\r\n for (const res of result) {\r\n if (res.remainingLength() === 0) {\r\n return res.getNodes();\r\n }\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof FailCombinatorError) {\r\n return undefined;\r\n }\r\n throw err;\r\n }\r\n return undefined;\r\n }\r\n static getVersion() {\r\n return this.ver;\r\n }\r\n}\r\nexports.Combi = Combi;\r\n// -----------------------------------------------------------------------------\r\nfunction str(s) {\r\n if (s.indexOf(\" \") > 0 || s.indexOf(\"-\") > 0) {\r\n return new WordSequence(s);\r\n }\r\n else {\r\n return new Word(s);\r\n }\r\n}\r\nexports.str = str;\r\nfunction regex(r) {\r\n return new Regex(r);\r\n}\r\nexports.regex = regex;\r\nfunction tok(t) {\r\n return new Token(t.name);\r\n}\r\nexports.tok = tok;\r\nconst singletons = {};\r\nfunction map(s) {\r\n const type = typeof s;\r\n if (type === \"string\") {\r\n return str(s);\r\n }\r\n else if (type === \"function\") {\r\n // @ts-ignore\r\n const name = s.name;\r\n if (singletons[name] === undefined) {\r\n // @ts-ignore\r\n singletons[name] = new s();\r\n }\r\n return singletons[name];\r\n }\r\n else {\r\n return s;\r\n }\r\n}\r\nfunction seq(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Sequence(list);\r\n}\r\nexports.seq = seq;\r\nfunction alt(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Alternative(list);\r\n}\r\nexports.alt = alt;\r\nfunction altPrio(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new AlternativePriority(list);\r\n}\r\nexports.altPrio = altPrio;\r\nfunction opt(first) {\r\n return new Optional(map(first));\r\n}\r\nexports.opt = opt;\r\nfunction optPrio(first) {\r\n return new OptionalPriority(map(first));\r\n}\r\nexports.optPrio = optPrio;\r\nfunction per(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Permutation(list);\r\n}\r\nexports.per = per;\r\nfunction star(first) {\r\n return new Star(map(first));\r\n}\r\nexports.star = star;\r\nfunction starPrio(first) {\r\n return new StarPrioroity(map(first));\r\n}\r\nexports.starPrio = starPrio;\r\nfunction plus(first) {\r\n return new Plus(map(first));\r\n}\r\nexports.plus = plus;\r\nfunction plusPrio(first) {\r\n return new PlusPriority(map(first));\r\n}\r\nexports.plusPrio = plusPrio;\r\nfunction ver(version, first, or) {\r\n return new Vers(version, map(first), or);\r\n}\r\nexports.ver = ver;\r\nfunction verNot(version, first) {\r\n return new VersNot(version, map(first));\r\n}\r\nexports.verNot = verNot;\r\nfunction failCombinator() {\r\n return new FailCombinator();\r\n}\r\nexports.failCombinator = failCombinator;\r\nfunction failStar() {\r\n return new FailStar();\r\n}\r\nexports.failStar = failStar;\r\n//# sourceMappingURL=combi.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js?");
|
|
382
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.failStar = exports.failCombinator = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;\r\nconst Tokens = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst result_1 = __webpack_require__(/*! ./result */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/result.js\");\r\nclass Regex {\r\n constructor(r) {\r\n this.regexp = r;\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() === 0) {\r\n continue;\r\n }\r\n const token = input.peek();\r\n if (this.regexp.test(token.getStr()) === true) {\r\n result.push(input.shift(new nodes_1.TokenNodeRegex(token)));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal(\\\"\" + this.regexp.source.replace(/\\\\/g, \"\\\\\\\\\") + \"\\\")\";\r\n }\r\n toStr() {\r\n return this.regexp.toString();\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Word {\r\n constructor(s) {\r\n this.s = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [this.s];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().getStr().toUpperCase() === this.s) {\r\n // console.log(\"match, \" + this.s + result.length);\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.s + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"\\\"\" + this.s + \"\\\"\";\r\n }\r\n first() {\r\n return [this.s];\r\n }\r\n}\r\nclass Token {\r\n constructor(s) {\r\n this.name = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().constructor.name.toUpperCase() === this.name) {\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n let text = this.name;\r\n const toke = Tokens;\r\n for (const token in Tokens) {\r\n if (token.toUpperCase() === this.name && toke[token].railroad) {\r\n text = toke[token].railroad();\r\n break;\r\n }\r\n }\r\n return \"Railroad.Terminal('!\\\"\" + text + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"Token \\\"\" + this.name + \"\\\"\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Vers {\r\n constructor(version, runnable, or) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n this.or = or;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n run(r) {\r\n const targetVersion = Combi.getVersion();\r\n if (this.or && targetVersion === this.or) {\r\n return this.runnable.run(r);\r\n }\r\n else if (targetVersion === version_1.Version.OpenABAP) {\r\n if (this.version > version_1.Version.v702) {\r\n return [];\r\n }\r\n else {\r\n return this.runnable.run(r);\r\n }\r\n }\r\n else if (targetVersion >= this.version || targetVersion === version_1.Version.Cloud) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n railroad() {\r\n let text = this.version;\r\n if (this.or) {\r\n text += \" or \" + this.or;\r\n }\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"\" +\r\n text +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"Version(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass VersNot {\r\n constructor(version, runnable) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n run(r) {\r\n if (Combi.getVersion() !== this.version) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n railroad() {\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"not \" +\r\n this.version +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"VersionNot(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass OptionalPriority {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n const res = this.optional.run([input]);\r\n if (res.length > 1) {\r\n result.push(...res);\r\n }\r\n else if (res.length === 0) {\r\n result.push(input);\r\n }\r\n else if (res[0].remainingLength() < input.remainingLength()) {\r\n result.push(...res);\r\n }\r\n else {\r\n result.push(input);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Optional {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n result.push(input);\r\n const res = this.optional.run([input]);\r\n result.push(...res);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Star {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n const result = r;\r\n try {\r\n let res = r;\r\n let input = [];\r\n for (;;) {\r\n input = res;\r\n res = this.sta.run(input);\r\n if (res.length === 0) {\r\n break;\r\n }\r\n result.push(...res);\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof FailStarError) {\r\n return result;\r\n }\r\n throw err;\r\n }\r\n // console.dir(result);\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass StarPriority {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n let result = r;\r\n let res = r;\r\n // let input: Result[] = [];\r\n let prev;\r\n for (;;) {\r\n // input = res;\r\n res = this.sta.run(res);\r\n if (res.length === 0) {\r\n if (prev !== undefined) {\r\n // console.log(\"star length: \" + prev.length);\r\n let best = Number.MAX_SAFE_INTEGER;\r\n for (const p of prev) {\r\n if (p.remainingLength() < best) {\r\n result = [p];\r\n best = p.remainingLength();\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n prev = res;\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Plus {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new Star(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass PlusPriority {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new StarPriority(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass Sequence {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Sequence, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n let temp = [input];\r\n let match = true;\r\n for (const sequence of this.list) {\r\n temp = sequence.run(temp);\r\n if (temp.length === 0) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n if (match === true) {\r\n result.push(...temp);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Sequence(\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"seq(\" + ret + \")\";\r\n }\r\n first() {\r\n return this.list[0].first();\r\n }\r\n}\r\nclass WordSequence {\r\n constructor(stri) {\r\n this.words = [];\r\n this.stri = stri;\r\n const foo = this.stri.replace(/-/g, \" - \");\r\n const split = foo.split(\" \");\r\n for (const st of split) {\r\n // todo, use Dash token\r\n this.words.push(new Word(st));\r\n }\r\n this.seq = new Sequence(this.words);\r\n }\r\n listKeywords() {\r\n return [this.stri.toString()];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n return this.seq.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.stri + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"str(\" + this.stri + \")\";\r\n }\r\n first() {\r\n return this.words[0].first();\r\n }\r\n}\r\nclass Expression {\r\n constructor() {\r\n this.runnable = undefined;\r\n }\r\n run(r) {\r\n const results = [];\r\n if (this.runnable === undefined) {\r\n this.runnable = this.getRunnable();\r\n }\r\n for (const input of r) {\r\n const temp = this.runnable.run([input]);\r\n for (const t of temp) {\r\n let consumed = input.remainingLength() - t.remainingLength();\r\n if (consumed > 0) {\r\n const originalLength = t.getNodes().length;\r\n const children = [];\r\n while (consumed > 0) {\r\n const sub = t.popNode();\r\n if (sub) {\r\n children.push(sub);\r\n consumed = consumed - sub.countTokens();\r\n }\r\n }\r\n const re = new nodes_1.ExpressionNode(this);\r\n re.setChildren(children.reverse());\r\n const n = t.getNodes().slice(0, originalLength - consumed);\r\n n.push(re);\r\n t.setNodes(n);\r\n }\r\n results.push(t);\r\n }\r\n }\r\n // console.dir(results);\r\n return results;\r\n }\r\n listKeywords() {\r\n // do not recurse, all Expressions are evaluated only on first level\r\n return [];\r\n }\r\n getUsing() {\r\n return [\"expression/\" + this.getName()];\r\n }\r\n getName() {\r\n return this.constructor.name;\r\n }\r\n railroad() {\r\n return \"Railroad.NonTerminal('\" + this.getName() + \"', {href: '#/expression/\" + this.getName() + \"'})\";\r\n }\r\n toStr() {\r\n return \"expression(\" + this.getName() + \")\";\r\n }\r\n first() {\r\n return this.getRunnable().first();\r\n }\r\n}\r\nexports.Expression = Expression;\r\nclass Permutation {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Permutation, length error, got \" + list.length);\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n const copy = this.list.slice();\r\n for (let index = 0; index < this.list.length; index++) {\r\n const temp = this.list[index].run(r);\r\n if (temp.length !== 0) {\r\n // match\r\n result.push(...temp);\r\n const left = copy;\r\n left.splice(index, 1);\r\n if (left.length === 1) {\r\n result.push(...left[0].run(temp));\r\n }\r\n else {\r\n result.push(...new Permutation(left).run(temp));\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.MultipleChoice(0, 'any',\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n const children = this.list.map((e) => { return e.toStr(); });\r\n return \"per(\" + children.join() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass FailCombinatorError extends Error {\r\n}\r\nclass FailStarError extends Error {\r\n}\r\nclass FailCombinator {\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(_r) {\r\n throw new FailCombinatorError();\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('!FailCombinator')\";\r\n }\r\n toStr() {\r\n return \"fail()\";\r\n }\r\n first() {\r\n return [];\r\n }\r\n}\r\n// Note that Plus is implemented with Star\r\nclass FailStar {\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(_r) {\r\n throw new FailStarError();\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('!FailStar')\";\r\n }\r\n toStr() {\r\n return \"fail()\";\r\n }\r\n first() {\r\n return [];\r\n }\r\n}\r\nclass Alternative {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n const temp = sequ.run(r);\r\n result.push(...temp);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\n// prioritized alternative, skip others if match found\r\nclass AlternativePriority {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n // console.log(seq.toStr());\r\n const temp = sequ.run(r);\r\n if (temp.length > 0) {\r\n result.push(...temp);\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\nclass Combi {\r\n static railroad(runnable, complex = false) {\r\n // todo, move method to graph.js?\r\n let type = \"Railroad.Diagram(\";\r\n if (complex === true) {\r\n type = \"Railroad.ComplexDiagram(\";\r\n }\r\n const result = \"Railroad.Diagram.INTERNAL_ALIGNMENT = 'left';\\n\" +\r\n type +\r\n runnable.railroad() +\r\n \").toString();\";\r\n return result;\r\n }\r\n static listKeywords(runnable) {\r\n // todo, move these walkers of the syntax tree to some abstraction?\r\n let res = runnable.listKeywords();\r\n // remove duplicates\r\n res = res.filter((x, i, a) => { return a.indexOf(x) === i; });\r\n return res;\r\n }\r\n // assumption: no pragmas supplied in tokens input\r\n static run(runnable, tokens, version) {\r\n this.ver = version;\r\n const input = new result_1.Result(tokens, 0);\r\n try {\r\n const result = runnable.run([input]);\r\n /*\r\n console.log(\"res: \" + result.length);\r\n for (const res of result) {\r\n console.dir(res.getNodes().map(n => n.get().constructor.name));\r\n console.dir(res.getNodes().map(n => n.concatTokens()));\r\n }\r\n */\r\n for (const res of result) {\r\n if (res.remainingLength() === 0) {\r\n return res.getNodes();\r\n }\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof FailCombinatorError) {\r\n return undefined;\r\n }\r\n throw err;\r\n }\r\n return undefined;\r\n }\r\n static getVersion() {\r\n return this.ver;\r\n }\r\n}\r\nexports.Combi = Combi;\r\n// -----------------------------------------------------------------------------\r\nfunction str(s) {\r\n if (s.indexOf(\" \") > 0 || s.indexOf(\"-\") > 0) {\r\n return new WordSequence(s);\r\n }\r\n else {\r\n return new Word(s);\r\n }\r\n}\r\nexports.str = str;\r\nfunction regex(r) {\r\n return new Regex(r);\r\n}\r\nexports.regex = regex;\r\nfunction tok(t) {\r\n return new Token(t.name);\r\n}\r\nexports.tok = tok;\r\nconst singletons = {};\r\nfunction map(s) {\r\n const type = typeof s;\r\n if (type === \"string\") {\r\n return str(s);\r\n }\r\n else if (type === \"function\") {\r\n // @ts-ignore\r\n const name = s.name;\r\n if (singletons[name] === undefined) {\r\n // @ts-ignore\r\n singletons[name] = new s();\r\n }\r\n return singletons[name];\r\n }\r\n else {\r\n return s;\r\n }\r\n}\r\nfunction seq(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Sequence(list);\r\n}\r\nexports.seq = seq;\r\nfunction alt(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Alternative(list);\r\n}\r\nexports.alt = alt;\r\nfunction altPrio(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new AlternativePriority(list);\r\n}\r\nexports.altPrio = altPrio;\r\nfunction opt(first) {\r\n return new Optional(map(first));\r\n}\r\nexports.opt = opt;\r\nfunction optPrio(first) {\r\n return new OptionalPriority(map(first));\r\n}\r\nexports.optPrio = optPrio;\r\nfunction per(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Permutation(list);\r\n}\r\nexports.per = per;\r\nfunction star(first) {\r\n return new Star(map(first));\r\n}\r\nexports.star = star;\r\nfunction starPrio(first) {\r\n return new StarPriority(map(first));\r\n}\r\nexports.starPrio = starPrio;\r\nfunction plus(first) {\r\n return new Plus(map(first));\r\n}\r\nexports.plus = plus;\r\nfunction plusPrio(first) {\r\n return new PlusPriority(map(first));\r\n}\r\nexports.plusPrio = plusPrio;\r\nfunction ver(version, first, or) {\r\n return new Vers(version, map(first), or);\r\n}\r\nexports.ver = ver;\r\nfunction verNot(version, first) {\r\n return new VersNot(version, map(first));\r\n}\r\nexports.verNot = verNot;\r\nfunction failCombinator() {\r\n return new FailCombinator();\r\n}\r\nexports.failCombinator = failCombinator;\r\nfunction failStar() {\r\n return new FailStar();\r\n}\r\nexports.failStar = failStar;\r\n//# sourceMappingURL=combi.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js?");
|
|
383
383
|
|
|
384
384
|
/***/ }),
|
|
385
385
|
|
|
@@ -819,7 +819,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
819
819
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
820
820
|
|
|
821
821
|
"use strict";
|
|
822
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataDefinition = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst Expressions = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass DataDefinition extends combi_1.Expression {\r\n getRunnable() {\r\n const simple = (0, combi_1.opt)((0, combi_1.per)(\"READ-ONLY\", Expressions.Type, Expressions.Length, Expressions.Decimals, Expressions.Value));\r\n const table = (0, combi_1.seq)(Expressions.TypeTable, (0, combi_1.
|
|
822
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataDefinition = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst Expressions = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass DataDefinition extends combi_1.Expression {\r\n getRunnable() {\r\n const simple = (0, combi_1.opt)((0, combi_1.per)(\"READ-ONLY\", Expressions.Type, Expressions.Length, Expressions.Decimals, Expressions.Value));\r\n const table = (0, combi_1.seq)(Expressions.TypeTable, (0, combi_1.optPrio)(\"READ-ONLY\"));\r\n return (0, combi_1.seq)(Expressions.DefinitionName, (0, combi_1.optPrio)(Expressions.ConstantFieldLength), (0, combi_1.alt)(simple, table));\r\n }\r\n}\r\nexports.DataDefinition = DataDefinition;\r\n//# sourceMappingURL=data_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/data_definition.js?");
|
|
823
823
|
|
|
824
824
|
/***/ }),
|
|
825
825
|
|
|
@@ -2777,7 +2777,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
2777
2777
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2778
2778
|
|
|
2779
2779
|
"use strict";
|
|
2780
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Assign = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Assign {\r\n getMatcher() {\r\n const type = (0, combi_1.seq)(\"TYPE\", (0, combi_1.
|
|
2780
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Assign = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Assign {\r\n getMatcher() {\r\n const type = (0, combi_1.seq)(\"TYPE\", (0, combi_1.altPrio)(expressions_1.Dynamic, expressions_1.TypeName));\r\n const like = (0, combi_1.seq)(\"LIKE\", (0, combi_1.altPrio)(expressions_1.Dynamic, expressions_1.Source));\r\n const handle = (0, combi_1.seq)(\"TYPE HANDLE\", expressions_1.Source);\r\n const range = (0, combi_1.seq)(\"RANGE\", expressions_1.Source);\r\n const decimals = (0, combi_1.seq)(\"DECIMALS\", expressions_1.Source);\r\n const casting = (0, combi_1.seq)(\"CASTING\", (0, combi_1.opt)((0, combi_1.alt)(like, handle, (0, combi_1.per)(type, decimals))));\r\n const obsoleteType = (0, combi_1.seq)(\"TYPE\", expressions_1.Source, (0, combi_1.optPrio)(decimals));\r\n const ret = (0, combi_1.seq)(\"ASSIGN\", (0, combi_1.opt)((0, combi_1.seq)(expressions_1.Target, \"INCREMENT\")), expressions_1.AssignSource, \"TO\", expressions_1.FSTarget, (0, combi_1.opt)((0, combi_1.altPrio)(casting, obsoleteType)), (0, combi_1.opt)(range));\r\n return ret;\r\n }\r\n}\r\nexports.Assign = Assign;\r\n//# sourceMappingURL=assign.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign.js?");
|
|
2781
2781
|
|
|
2782
2782
|
/***/ }),
|
|
2783
2783
|
|
|
@@ -2865,7 +2865,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
2865
2865
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2866
2866
|
|
|
2867
2867
|
"use strict";
|
|
2868
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Break = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Break {\r\n getMatcher() {\r\n const next = (0, combi_1.str)(\"AT NEXT APPLICATION STATEMENT\");\r\n const ret = (0, combi_1.
|
|
2868
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Break = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Break {\r\n getMatcher() {\r\n const next = (0, combi_1.str)(\"AT NEXT APPLICATION STATEMENT\");\r\n const ret = (0, combi_1.altPrio)((0, combi_1.seq)(\"BREAK-POINT\", (0, combi_1.optPrio)((0, combi_1.altPrio)(next, expressions_1.Source))), (0, combi_1.seq)(\"BREAK\", expressions_1.FieldSub));\r\n return (0, combi_1.verNot)(version_1.Version.Cloud, ret);\r\n }\r\n}\r\nexports.Break = Break;\r\n//# sourceMappingURL=break.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break.js?");
|
|
2869
2869
|
|
|
2870
2870
|
/***/ }),
|
|
2871
2871
|
|
|
@@ -2931,7 +2931,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
2931
2931
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
2932
2932
|
|
|
2933
2933
|
"use strict";
|
|
2934
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallFunction = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallFunction {\r\n getMatcher() {\r\n const starting = (0, combi_1.seq)(\"STARTING NEW TASK\", expressions_1.SimpleSource2);\r\n const update = (0, combi_1.str)(\"IN UPDATE TASK\");\r\n const unit = (0, combi_1.seq)(\"UNIT\", expressions_1.Source);\r\n const background = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)(\"IN BACKGROUND\", (0, combi_1.
|
|
2934
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallFunction = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallFunction {\r\n getMatcher() {\r\n const starting = (0, combi_1.seq)(\"STARTING NEW TASK\", expressions_1.SimpleSource2);\r\n const update = (0, combi_1.str)(\"IN UPDATE TASK\");\r\n const unit = (0, combi_1.seq)(\"UNIT\", expressions_1.Source);\r\n const background = (0, combi_1.verNot)(version_1.Version.Cloud, (0, combi_1.seq)(\"IN BACKGROUND\", (0, combi_1.altPrio)(\"TASK\", unit)));\r\n const calling = (0, combi_1.seq)(\"CALLING\", expressions_1.MethodName, \"ON END OF TASK\");\r\n const performing = (0, combi_1.seq)(\"PERFORMING\", expressions_1.FormName, \"ON END OF TASK\");\r\n const separate = (0, combi_1.str)(\"AS SEPARATE UNIT\");\r\n const keeping = (0, combi_1.str)(\"KEEPING LOGICAL UNIT OF WORK\");\r\n const options = (0, combi_1.per)(starting, update, background, expressions_1.Destination, calling, performing, separate, keeping);\r\n const dynamic = (0, combi_1.seq)(\"PARAMETER-TABLE\", expressions_1.Source, (0, combi_1.opt)((0, combi_1.seq)(\"EXCEPTION-TABLE\", expressions_1.Source)));\r\n const call = (0, combi_1.seq)(\"CALL\", (0, combi_1.altPrio)(\"FUNCTION\", (0, combi_1.verNot)(version_1.Version.Cloud, \"CUSTOMER-FUNCTION\")), expressions_1.FunctionName, (0, combi_1.opt)(options), (0, combi_1.alt)(expressions_1.FunctionParameters, dynamic));\r\n return call;\r\n }\r\n}\r\nexports.CallFunction = CallFunction;\r\n//# sourceMappingURL=call_function.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_function.js?");
|
|
2935
2935
|
|
|
2936
2936
|
/***/ }),
|
|
2937
2937
|
|
|
@@ -3085,7 +3085,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3085
3085
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3086
3086
|
|
|
3087
3087
|
"use strict";
|
|
3088
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDataBegin = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDataBegin {\r\n getMatcher() {\r\n const occurs = (0, combi_1.seq)(\"OCCURS\", expressions_1.Integer);\r\n const structure = (0, combi_1.seq)(\"BEGIN OF\", (0, combi_1.
|
|
3088
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDataBegin = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDataBegin {\r\n getMatcher() {\r\n const occurs = (0, combi_1.seq)(\"OCCURS\", expressions_1.Integer);\r\n const structure = (0, combi_1.seq)(\"BEGIN OF\", (0, combi_1.optPrio)(\"COMMON PART\"), expressions_1.NamespaceSimpleName, (0, combi_1.optPrio)(\"READ-ONLY\"), (0, combi_1.optPrio)(occurs));\r\n return (0, combi_1.seq)(\"CLASS-DATA\", structure);\r\n }\r\n}\r\nexports.ClassDataBegin = ClassDataBegin;\r\n//# sourceMappingURL=class_data_begin.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_begin.js?");
|
|
3089
3089
|
|
|
3090
3090
|
/***/ }),
|
|
3091
3091
|
|
|
@@ -3096,7 +3096,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3096
3096
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3097
3097
|
|
|
3098
3098
|
"use strict";
|
|
3099
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDataEnd = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDataEnd {\r\n getMatcher() {\r\n const common = (0, combi_1.seq)(\"COMMON PART\", (0, combi_1.optPrio)(expressions_1.NamespaceSimpleName));\r\n const structure = (0, combi_1.seq)(\"END OF\", (0, combi_1.
|
|
3099
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDataEnd = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDataEnd {\r\n getMatcher() {\r\n const common = (0, combi_1.seq)(\"COMMON PART\", (0, combi_1.optPrio)(expressions_1.NamespaceSimpleName));\r\n const structure = (0, combi_1.seq)(\"END OF\", (0, combi_1.altPrio)(common, expressions_1.NamespaceSimpleName));\r\n return (0, combi_1.seq)(\"CLASS-DATA\", structure);\r\n }\r\n}\r\nexports.ClassDataEnd = ClassDataEnd;\r\n//# sourceMappingURL=class_data_end.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_end.js?");
|
|
3100
3100
|
|
|
3101
3101
|
/***/ }),
|
|
3102
3102
|
|
|
@@ -3107,7 +3107,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3107
3107
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3108
3108
|
|
|
3109
3109
|
"use strict";
|
|
3110
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDeferred = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDeferred {\r\n getMatcher() {\r\n
|
|
3110
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDeferred = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassDeferred {\r\n getMatcher() {\r\n return (0, combi_1.seq)(\"CLASS\", expressions_1.ClassName, \"DEFINITION DEFERRED\", (0, combi_1.optPrio)(\"PUBLIC\"));\r\n }\r\n}\r\nexports.ClassDeferred = ClassDeferred;\r\n//# sourceMappingURL=class_deferred.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_deferred.js?");
|
|
3111
3111
|
|
|
3112
3112
|
/***/ }),
|
|
3113
3113
|
|
|
@@ -3118,7 +3118,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3118
3118
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3119
3119
|
|
|
3120
3120
|
"use strict";
|
|
3121
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinition = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ClassDefinition {\r\n getMatcher() {\r\n const create = (0, combi_1.seq)(\"CREATE\", (0, combi_1.
|
|
3121
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassDefinition = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ClassDefinition {\r\n getMatcher() {\r\n const create = (0, combi_1.seq)(\"CREATE\", (0, combi_1.altPrio)(\"PUBLIC\", \"PROTECTED\", \"PRIVATE\"));\r\n const level = (0, combi_1.altPrio)(\"CRITICAL\", \"HARMLESS\", \"DANGEROUS\");\r\n const risk = (0, combi_1.seq)(\"RISK LEVEL\", level);\r\n const time = (0, combi_1.altPrio)(\"LONG\", \"MEDIUM\", \"SHORT\");\r\n const duration = (0, combi_1.seq)(\"DURATION\", time);\r\n const blah = (0, combi_1.per)(expressions_1.ClassGlobal, expressions_1.ClassFinal, \"ABSTRACT\", (0, combi_1.seq)(\"INHERITING FROM\", expressions_1.SuperClassName), create, \"FOR TESTING\", risk, \"SHARED MEMORY ENABLED\", duration, (0, combi_1.ver)(version_1.Version.v754, (0, combi_1.seq)(\"FOR BEHAVIOR OF\", expressions_1.NamespaceSimpleName)), expressions_1.ClassFriends);\r\n const def = (0, combi_1.seq)(\"DEFINITION\", (0, combi_1.optPrio)(blah));\r\n return (0, combi_1.seq)(\"CLASS\", expressions_1.ClassName, def);\r\n }\r\n}\r\nexports.ClassDefinition = ClassDefinition;\r\n//# sourceMappingURL=class_definition.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition.js?");
|
|
3122
3122
|
|
|
3123
3123
|
/***/ }),
|
|
3124
3124
|
|
|
@@ -3151,7 +3151,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3151
3151
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3152
3152
|
|
|
3153
3153
|
"use strict";
|
|
3154
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassLocalFriends = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassLocalFriends {\r\n getMatcher() {\r\n
|
|
3154
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ClassLocalFriends = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ClassLocalFriends {\r\n getMatcher() {\r\n return (0, combi_1.seq)(\"CLASS\", expressions_1.ClassName, \"DEFINITION LOCAL FRIENDS\", (0, combi_1.plusPrio)(expressions_1.ClassName));\r\n }\r\n}\r\nexports.ClassLocalFriends = ClassLocalFriends;\r\n//# sourceMappingURL=class_local_friends.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_local_friends.js?");
|
|
3155
3155
|
|
|
3156
3156
|
/***/ }),
|
|
3157
3157
|
|
|
@@ -3173,7 +3173,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3173
3173
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3174
3174
|
|
|
3175
3175
|
"use strict";
|
|
3176
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Clear = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Clear {\r\n getMatcher() {\r\n const wit = (0, combi_1.seq)(\"WITH\", expressions_1.Source);\r\n const mode = (0, combi_1.
|
|
3176
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Clear = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Clear {\r\n getMatcher() {\r\n const wit = (0, combi_1.seq)(\"WITH\", expressions_1.Source);\r\n const mode = (0, combi_1.altPrio)(\"IN CHARACTER MODE\", \"IN BYTE MODE\");\r\n return (0, combi_1.seq)(\"CLEAR\", expressions_1.Target, (0, combi_1.optPrio)(wit), (0, combi_1.optPrio)(mode));\r\n }\r\n}\r\nexports.Clear = Clear;\r\n//# sourceMappingURL=clear.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/clear.js?");
|
|
3177
3177
|
|
|
3178
3178
|
/***/ }),
|
|
3179
3179
|
|
|
@@ -3261,7 +3261,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3261
3261
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3262
3262
|
|
|
3263
3263
|
"use strict";
|
|
3264
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Concatenate = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Concatenate {\r\n getMatcher() {\r\n const mode = (0, combi_1.seq)(\"IN\", (0, combi_1.
|
|
3264
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Concatenate = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Concatenate {\r\n getMatcher() {\r\n const mode = (0, combi_1.seq)(\"IN\", (0, combi_1.altPrio)(\"BYTE\", \"CHARACTER\"), \"MODE\");\r\n const blanks = (0, combi_1.str)(\"RESPECTING BLANKS\");\r\n const sep = (0, combi_1.seq)(\"SEPARATED BY\", expressions_1.Source);\r\n const options = (0, combi_1.per)(mode, blanks, sep);\r\n const sourc = (0, combi_1.seq)(expressions_1.Source, (0, combi_1.plus)(expressions_1.Source));\r\n const lines = (0, combi_1.seq)(\"LINES OF\", expressions_1.Source);\r\n return (0, combi_1.seq)(\"CONCATENATE\", (0, combi_1.altPrio)(lines, sourc), \"INTO\", expressions_1.Target, (0, combi_1.optPrio)(options));\r\n }\r\n}\r\nexports.Concatenate = Concatenate;\r\n//# sourceMappingURL=concatenate.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/concatenate.js?");
|
|
3265
3265
|
|
|
3266
3266
|
/***/ }),
|
|
3267
3267
|
|
|
@@ -3426,7 +3426,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3426
3426
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3427
3427
|
|
|
3428
3428
|
"use strict";
|
|
3429
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataEnd = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass DataEnd {\r\n getMatcher() {\r\n const common = (0, combi_1.seq)(\"COMMON PART\", (0, combi_1.optPrio)(expressions_1.DefinitionName));\r\n const structure = (0, combi_1.seq)(\"END OF\", (0, combi_1.
|
|
3429
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DataEnd = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass DataEnd {\r\n getMatcher() {\r\n const common = (0, combi_1.seq)(\"COMMON PART\", (0, combi_1.optPrio)(expressions_1.DefinitionName));\r\n const structure = (0, combi_1.seq)(\"END OF\", (0, combi_1.altPrio)(common, expressions_1.DefinitionName));\r\n const valid = (0, combi_1.seq)(\"VALID BETWEEN\", expressions_1.ComponentName, \"AND\", expressions_1.ComponentName);\r\n return (0, combi_1.seq)(\"DATA\", structure, (0, combi_1.optPrio)(valid));\r\n }\r\n}\r\nexports.DataEnd = DataEnd;\r\n//# sourceMappingURL=data_end.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_end.js?");
|
|
3430
3430
|
|
|
3431
3431
|
/***/ }),
|
|
3432
3432
|
|
|
@@ -3459,7 +3459,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3459
3459
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3460
3460
|
|
|
3461
3461
|
"use strict";
|
|
3462
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DeleteDatabase = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst sql_client_1 = __webpack_require__(/*! ../expressions/sql_client */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_client.js\");\r\nclass DeleteDatabase {\r\n getMatcher() {\r\n const where = (0, combi_1.seq)(\"WHERE\", (0, combi_1.
|
|
3462
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DeleteDatabase = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst sql_client_1 = __webpack_require__(/*! ../expressions/sql_client */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/sql_client.js\");\r\nclass DeleteDatabase {\r\n getMatcher() {\r\n const where = (0, combi_1.seq)(\"WHERE\", (0, combi_1.altPrio)(expressions_1.SQLCond, expressions_1.Dynamic));\r\n const from = (0, combi_1.seq)(\"FROM\", expressions_1.DatabaseTable, (0, combi_1.optPrio)(sql_client_1.SQLClient), (0, combi_1.optPrio)(expressions_1.DatabaseConnection), (0, combi_1.opt)(where));\r\n const table = (0, combi_1.seq)(expressions_1.DatabaseTable, (0, combi_1.optPrio)(sql_client_1.SQLClient), (0, combi_1.optPrio)(expressions_1.DatabaseConnection), \"FROM\", (0, combi_1.opt)(\"TABLE\"), expressions_1.SQLSourceSimple);\r\n const ret = (0, combi_1.seq)(\"DELETE\", (0, combi_1.altPrio)(from, table));\r\n return ret;\r\n }\r\n}\r\nexports.DeleteDatabase = DeleteDatabase;\r\n//# sourceMappingURL=delete_database.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_database.js?");
|
|
3463
3463
|
|
|
3464
3464
|
/***/ }),
|
|
3465
3465
|
|
|
@@ -3943,7 +3943,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
3943
3943
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
3944
3944
|
|
|
3945
3945
|
"use strict";
|
|
3946
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Events = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Events {\r\n getMatcher() {\r\n const exporting = (0, combi_1.seq)(\"EXPORTING\", (0, combi_1.plus)(expressions_1.MethodParamOptional));\r\n return (0, combi_1.seq)((0, combi_1.
|
|
3946
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Events = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Events {\r\n getMatcher() {\r\n const exporting = (0, combi_1.seq)(\"EXPORTING\", (0, combi_1.plus)(expressions_1.MethodParamOptional));\r\n return (0, combi_1.seq)((0, combi_1.altPrio)(\"CLASS-EVENTS\", \"EVENTS\"), expressions_1.EventName, (0, combi_1.optPrio)(exporting));\r\n }\r\n}\r\nexports.Events = Events;\r\n//# sourceMappingURL=events.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js?");
|
|
3947
3947
|
|
|
3948
3948
|
/***/ }),
|
|
3949
3949
|
|
|
@@ -4053,7 +4053,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4053
4053
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4054
4054
|
|
|
4055
4055
|
"use strict";
|
|
4056
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Find = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Find {\r\n getMatcher() {\r\n // SUBMATCHES handling is a workaround\r\n const options = (0, combi_1.per)(\"IGNORING CASE\", \"RESPECTING CASE\", \"IN BYTE MODE\", \"IN CHARACTER MODE\", (0, combi_1.seq)(\"OF\", expressions_1.Source), (0, combi_1.seq)(\"FROM\", expressions_1.Source), (0, combi_1.seq)(\"TO\", expressions_1.Source), (0, combi_1.seq)(\"MATCH OFFSET\", expressions_1.Target), (0, combi_1.seq)(\"MATCH LINE\", expressions_1.Target), (0, combi_1.seq)(\"MATCH COUNT\", expressions_1.Target), (0, combi_1.seq)(\"MATCH LENGTH\", expressions_1.Target), (0, combi_1.seq)(\"LENGTH\", expressions_1.Source), (0, combi_1.seq)(\"RESULTS\", expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", expressions_1.Target, expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", (0, combi_1.plus)(expressions_1.Target)));\r\n const sectionLength = (0, combi_1.seq)(\"SECTION LENGTH\", expressions_1.Source, \"OF\");\r\n const before = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.
|
|
4056
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Find = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Find {\r\n getMatcher() {\r\n // SUBMATCHES handling is a workaround\r\n const options = (0, combi_1.per)(\"IGNORING CASE\", \"RESPECTING CASE\", \"IN BYTE MODE\", \"IN CHARACTER MODE\", (0, combi_1.seq)(\"OF\", expressions_1.Source), (0, combi_1.seq)(\"FROM\", expressions_1.Source), (0, combi_1.seq)(\"TO\", expressions_1.Source), (0, combi_1.seq)(\"MATCH OFFSET\", expressions_1.Target), (0, combi_1.seq)(\"MATCH LINE\", expressions_1.Target), (0, combi_1.seq)(\"MATCH COUNT\", expressions_1.Target), (0, combi_1.seq)(\"MATCH LENGTH\", expressions_1.Target), (0, combi_1.seq)(\"LENGTH\", expressions_1.Source), (0, combi_1.seq)(\"RESULTS\", expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", expressions_1.Target, expressions_1.Target), (0, combi_1.seq)(\"SUBMATCHES\", (0, combi_1.plus)(expressions_1.Target)));\r\n const sectionLength = (0, combi_1.seq)(\"SECTION LENGTH\", expressions_1.Source, \"OF\");\r\n const before = (0, combi_1.seq)((0, combi_1.optPrio)((0, combi_1.altPrio)(\"TABLE\", \"SECTION OFFSET\", sectionLength)), expressions_1.Source);\r\n const ret = (0, combi_1.seq)(\"FIND\", (0, combi_1.opt)((0, combi_1.altPrio)(\"FIRST OCCURRENCE OF\", \"ALL OCCURRENCES OF\")), expressions_1.FindType, expressions_1.Source, \"IN\", before, (0, combi_1.opt)(options));\r\n return ret;\r\n }\r\n}\r\nexports.Find = Find;\r\n//# sourceMappingURL=find.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/find.js?");
|
|
4057
4057
|
|
|
4058
4058
|
/***/ }),
|
|
4059
4059
|
|
|
@@ -4680,7 +4680,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4680
4680
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4681
4681
|
|
|
4682
4682
|
"use strict";
|
|
4683
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyLine = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ModifyLine {\r\n getMatcher() {\r\n const form = (0, combi_1.seq)((0, combi_1.alt)(\"INVERSE\", \"INPUT\"), \"=\", expressions_1.Source);\r\n const from = (0, combi_1.seq)(\"FROM\", expressions_1.Source);\r\n const value = (0, combi_1.seq)(\"FIELD VALUE\", (0, combi_1.plus)((0, combi_1.seq)(expressions_1.Source, (0, combi_1.optPrio)(from))));\r\n const format = (0, combi_1.seq)(\"FIELD FORMAT\", expressions_1.Source, (0, combi_1.opt)(form));\r\n const lineValue = (0, combi_1.seq)(\"LINE VALUE FROM\", expressions_1.Source);\r\n const index = (0, combi_1.seq)(\"INDEX\", expressions_1.Source);\r\n const page = (0, combi_1.seq)(\"OF PAGE\", expressions_1.Source);\r\n const ocp = (0, combi_1.str)(\"OF CURRENT PAGE\");\r\n const lineFormat = (0, combi_1.seq)(\"LINE FORMAT\", (0, combi_1.alt)(\"INPUT OFF\", \"INVERSE\", \"RESET\", \"INTENSIFIED\"));\r\n const onOff = (0, combi_1.alt)(\"ON\", \"OFF\");\r\n const intensified = (0, combi_1.seq)(\"INTENSIFIED\", onOff);\r\n const options = (0, combi_1.per)(index, value, format, page, lineFormat, lineValue, ocp, intensified, expressions_1.Color);\r\n const ret = (0, combi_1.seq)(\"MODIFY\", (0, combi_1.
|
|
4683
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ModifyLine = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ModifyLine {\r\n getMatcher() {\r\n const form = (0, combi_1.seq)((0, combi_1.alt)(\"INVERSE\", \"INPUT\"), \"=\", expressions_1.Source);\r\n const from = (0, combi_1.seq)(\"FROM\", expressions_1.Source);\r\n const value = (0, combi_1.seq)(\"FIELD VALUE\", (0, combi_1.plus)((0, combi_1.seq)(expressions_1.Source, (0, combi_1.optPrio)(from))));\r\n const format = (0, combi_1.seq)(\"FIELD FORMAT\", expressions_1.Source, (0, combi_1.opt)(form));\r\n const lineValue = (0, combi_1.seq)(\"LINE VALUE FROM\", expressions_1.Source);\r\n const index = (0, combi_1.seq)(\"INDEX\", expressions_1.Source);\r\n const page = (0, combi_1.seq)(\"OF PAGE\", expressions_1.Source);\r\n const ocp = (0, combi_1.str)(\"OF CURRENT PAGE\");\r\n const lineFormat = (0, combi_1.seq)(\"LINE FORMAT\", (0, combi_1.alt)(\"INPUT OFF\", \"INVERSE\", \"RESET\", \"INTENSIFIED\"));\r\n const onOff = (0, combi_1.alt)(\"ON\", \"OFF\");\r\n const intensified = (0, combi_1.seq)(\"INTENSIFIED\", onOff);\r\n const options = (0, combi_1.per)(index, value, format, page, lineFormat, lineValue, ocp, intensified, expressions_1.Color);\r\n const ret = (0, combi_1.seq)(\"MODIFY\", (0, combi_1.altPrio)(\"CURRENT LINE\", (0, combi_1.seq)(\"LINE\", expressions_1.Source)), (0, combi_1.opt)(options));\r\n return (0, combi_1.verNot)(version_1.Version.Cloud, ret);\r\n }\r\n}\r\nexports.ModifyLine = ModifyLine;\r\n//# sourceMappingURL=modify_line.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_line.js?");
|
|
4684
4684
|
|
|
4685
4685
|
/***/ }),
|
|
4686
4686
|
|
|
@@ -4944,7 +4944,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4944
4944
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4945
4945
|
|
|
4946
4946
|
"use strict";
|
|
4947
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Raise = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Raise {\r\n getMatcher() {\r\n const mess = (0, combi_1.seq)(\"MESSAGE\", expressions_1.MessageSource, (0, combi_1.opt)(expressions_1.RaiseWith));\r\n const messid = (0, combi_1.seq)(\"MESSAGE ID\", expressions_1.Source, \"NUMBER\", (0, combi_1.altPrio)(expressions_1.MessageNumber, expressions_1.Source), (0, combi_1.optPrio)(expressions_1.RaiseWith));\r\n const exporting = (0, combi_1.seq)(\"EXPORTING\", expressions_1.ParameterListS);\r\n const from = (0, combi_1.seq)(\"TYPE\", expressions_1.ClassName, (0, combi_1.opt)((0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v750, (0, combi_1.alt)(mess, messid)), (0, combi_1.ver)(version_1.Version.v752, \"USING MESSAGE\"))), (0, combi_1.optPrio)(exporting));\r\n const pre = (0, combi_1.
|
|
4947
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Raise = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Raise {\r\n getMatcher() {\r\n const mess = (0, combi_1.seq)(\"MESSAGE\", expressions_1.MessageSource, (0, combi_1.opt)(expressions_1.RaiseWith));\r\n const messid = (0, combi_1.seq)(\"MESSAGE ID\", expressions_1.Source, \"NUMBER\", (0, combi_1.altPrio)(expressions_1.MessageNumber, expressions_1.Source), (0, combi_1.optPrio)(expressions_1.RaiseWith));\r\n const exporting = (0, combi_1.seq)(\"EXPORTING\", expressions_1.ParameterListS);\r\n const from = (0, combi_1.seq)(\"TYPE\", expressions_1.ClassName, (0, combi_1.opt)((0, combi_1.alt)((0, combi_1.ver)(version_1.Version.v750, (0, combi_1.alt)(mess, messid)), (0, combi_1.ver)(version_1.Version.v752, \"USING MESSAGE\"))), (0, combi_1.optPrio)(exporting));\r\n const pre = (0, combi_1.altPrio)((0, combi_1.seq)((0, combi_1.optPrio)(\"RESUMABLE\"), \"EXCEPTION\"), \"SHORTDUMP\");\r\n const clas = (0, combi_1.seq)(pre, (0, combi_1.altPrio)(from, (0, combi_1.ver)(version_1.Version.v752, expressions_1.Source), expressions_1.SimpleSource2));\r\n const ret = (0, combi_1.seq)(\"RAISE\", (0, combi_1.altPrio)(clas, expressions_1.ExceptionName));\r\n return ret;\r\n }\r\n}\r\nexports.Raise = Raise;\r\n//# sourceMappingURL=raise.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise.js?");
|
|
4948
4948
|
|
|
4949
4949
|
/***/ }),
|
|
4950
4950
|
|
|
@@ -5087,7 +5087,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
5087
5087
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5088
5088
|
|
|
5089
5089
|
"use strict";
|
|
5090
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Replace = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Replace {\r\n getMatcher() {\r\n const length = (0, combi_1.seq)(\"LENGTH\", expressions_1.Source);\r\n const offset = (0, combi_1.seq)(\"OFFSET\", expressions_1.Source);\r\n const section = (0, combi_1.seq)((0, combi_1.opt)(\"IN\"), \"SECTION\", (0, combi_1.per)(offset, length), \"OF\", expressions_1.Target);\r\n const source = (0, combi_1.seq)((0, combi_1.opt)(\"OF\"), expressions_1.FindType, expressions_1.Source);\r\n const cas = (0, combi_1.
|
|
5090
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Replace = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Replace {\r\n getMatcher() {\r\n const length = (0, combi_1.seq)(\"LENGTH\", expressions_1.Source);\r\n const offset = (0, combi_1.seq)(\"OFFSET\", expressions_1.Source);\r\n const section = (0, combi_1.seq)((0, combi_1.opt)(\"IN\"), \"SECTION\", (0, combi_1.per)(offset, length), \"OF\", expressions_1.Target);\r\n const source = (0, combi_1.seq)((0, combi_1.opt)(\"OF\"), expressions_1.FindType, expressions_1.Source);\r\n const cas = (0, combi_1.altPrio)(\"IGNORING CASE\", \"RESPECTING CASE\");\r\n const repl = (0, combi_1.seq)(\"REPLACEMENT COUNT\", expressions_1.Target);\r\n const replo = (0, combi_1.seq)(\"REPLACEMENT OFFSET\", expressions_1.Target);\r\n const repll = (0, combi_1.seq)(\"REPLACEMENT LENGTH\", expressions_1.Target);\r\n const repli = (0, combi_1.seq)(\"REPLACEMENT LINE\", expressions_1.Target);\r\n const occ = (0, combi_1.altPrio)(\"ALL OCCURRENCES\", \"ALL OCCURENCES\", \"FIRST OCCURENCE\", \"FIRST OCCURRENCE\");\r\n const mode = (0, combi_1.alt)(\"IN CHARACTER MODE\", \"IN BYTE MODE\");\r\n const wit = (0, combi_1.seq)(\"WITH\", expressions_1.Source);\r\n const into = (0, combi_1.seq)(\"INTO\", expressions_1.Target);\r\n return (0, combi_1.seq)(\"REPLACE\", (0, combi_1.per)(section, (0, combi_1.seq)((0, combi_1.opt)(occ), source)), (0, combi_1.opt)((0, combi_1.seq)(\"IN\", (0, combi_1.opt)(\"TABLE\"), expressions_1.Target)), (0, combi_1.opt)((0, combi_1.per)(wit, into, cas, mode, repl, replo, repll, repli, length)));\r\n }\r\n}\r\nexports.Replace = Replace;\r\n//# sourceMappingURL=replace.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/replace.js?");
|
|
5091
5091
|
|
|
5092
5092
|
/***/ }),
|
|
5093
5093
|
|
|
@@ -5197,7 +5197,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
5197
5197
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5198
5198
|
|
|
5199
5199
|
"use strict";
|
|
5200
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Search = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Search {\r\n getMatcher() {\r\n const starting = (0, combi_1.seq)(\"STARTING AT\", expressions_1.Source);\r\n const ending = (0, combi_1.seq)(\"ENDING AT\", expressions_1.Source);\r\n const mark = (0, combi_1.str)(\"AND MARK\");\r\n const mode = (0, combi_1.
|
|
5200
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Search = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Search {\r\n getMatcher() {\r\n const starting = (0, combi_1.seq)(\"STARTING AT\", expressions_1.Source);\r\n const ending = (0, combi_1.seq)(\"ENDING AT\", expressions_1.Source);\r\n const mark = (0, combi_1.str)(\"AND MARK\");\r\n const mode = (0, combi_1.altPrio)(\"IN BYTE MODE\", \"IN CHARACTER MODE\");\r\n const ret = (0, combi_1.seq)(\"SEARCH\", expressions_1.Source, \"FOR\", expressions_1.Source, (0, combi_1.opt)((0, combi_1.per)(mode, starting, ending, mark)));\r\n return (0, combi_1.verNot)(version_1.Version.Cloud, ret);\r\n }\r\n}\r\nexports.Search = Search;\r\n//# sourceMappingURL=search.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/search.js?");
|
|
5201
5201
|
|
|
5202
5202
|
/***/ }),
|
|
5203
5203
|
|
|
@@ -5494,7 +5494,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
5494
5494
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5495
5495
|
|
|
5496
5496
|
"use strict";
|
|
5497
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Sort = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Sort {\r\n getMatcher() {\r\n const order = (0, combi_1.altPrio)(\"ASCENDING\", \"DESCENDING\");\r\n const sel = (0, combi_1.alt)(expressions_1.ComponentChain, expressions_1.Dynamic, expressions_1.SourceFieldSymbol);\r\n const text = \"AS TEXT\";\r\n const fields = (0, combi_1.plus)((0, combi_1.seq)(sel, (0, combi_1.optPrio)(text), (0, combi_1.optPrio)(order), (0, combi_1.optPrio)(text)));\r\n const by = (0, combi_1.seq)(\"BY\", fields);\r\n const normal = (0, combi_1.seq)(expressions_1.Target, (0, combi_1.opt)((0, combi_1.per)(order, by, \"STABLE\", text)));\r\n const target = (0, combi_1.
|
|
5497
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Sort = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Sort {\r\n getMatcher() {\r\n const order = (0, combi_1.altPrio)(\"ASCENDING\", \"DESCENDING\");\r\n const sel = (0, combi_1.alt)(expressions_1.ComponentChain, expressions_1.Dynamic, expressions_1.SourceFieldSymbol);\r\n const text = \"AS TEXT\";\r\n const fields = (0, combi_1.plus)((0, combi_1.seq)(sel, (0, combi_1.optPrio)(text), (0, combi_1.optPrio)(order), (0, combi_1.optPrio)(text)));\r\n const by = (0, combi_1.seq)(\"BY\", fields);\r\n const normal = (0, combi_1.seq)(expressions_1.Target, (0, combi_1.opt)((0, combi_1.per)(order, by, \"STABLE\", text)));\r\n const target = (0, combi_1.altPrio)(text, normal);\r\n return (0, combi_1.seq)(\"SORT\", target);\r\n }\r\n}\r\nexports.Sort = Sort;\r\n//# sourceMappingURL=sort.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort.js?");
|
|
5498
5498
|
|
|
5499
5499
|
/***/ }),
|
|
5500
5500
|
|
|
@@ -5736,7 +5736,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
5736
5736
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5737
5737
|
|
|
5738
5738
|
"use strict";
|
|
5739
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Translate = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Translate {\r\n getMatcher() {\r\n const cas = (0, combi_1.seq)(\"TO\", (0, combi_1.
|
|
5739
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Translate = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass Translate {\r\n getMatcher() {\r\n const cas = (0, combi_1.seq)(\"TO\", (0, combi_1.altPrio)(\"UPPER\", \"LOWER\"), \"CASE\");\r\n const using = (0, combi_1.seq)(\"USING\", expressions_1.Source);\r\n return (0, combi_1.seq)(\"TRANSLATE\", expressions_1.Target, (0, combi_1.altPrio)(cas, using));\r\n }\r\n}\r\nexports.Translate = Translate;\r\n//# sourceMappingURL=translate.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/translate.js?");
|
|
5740
5740
|
|
|
5741
5741
|
/***/ }),
|
|
5742
5742
|
|
|
@@ -11709,7 +11709,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11709
11709
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11710
11710
|
|
|
11711
11711
|
"use strict";
|
|
11712
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.94.8\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11712
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\nconst rules_runner_1 = __webpack_require__(/*! ./rules_runner */ \"./node_modules/@abaplint/core/build/src/rules_runner.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n this.dependencies = {};\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.94.9\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n // todo: performance? cache regexp?\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n _addFiles(files, dependency) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n let found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n if (dependency === false && found && this.isDependency(found)) {\n this.removeDependency(found);\n found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n }\n found.addFile(f);\n }\n return this;\n }\n addFiles(files) {\n this._addFiles(files, false);\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.addDependency(f);\n }\n return this;\n }\n addDependency(file) {\n var _a;\n const type = (_a = file.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return this;\n }\n const name = file.getObjectName().toUpperCase();\n if (this.dependencies[type] === undefined) {\n this.dependencies[type] = {};\n }\n this.dependencies[type][name] = true;\n this._addFiles([file], true);\n return this;\n }\n removeDependency(obj) {\n var _a;\n (_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? true : delete _a[obj.getName()];\n this.removeObject(obj);\n }\n isDependency(obj) {\n var _a;\n return ((_a = this.dependencies[obj.getType()]) === null || _a === void 0 ? void 0 : _a[obj.getName()]) === true;\n }\n isFileDependency(filename) {\n var _a, _b;\n const f = this.getFileByName(filename);\n if (f === undefined) {\n return false;\n }\n const type = (_a = f.getObjectType()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\n if (type === undefined) {\n return false;\n }\n const name = f.getObjectName().toUpperCase();\n return ((_b = this.dependencies[type]) === null || _b === void 0 ? void 0 : _b[name]) === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules(this.getObjects(), input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return new rules_runner_1.RulesRunner(this).runRules([iobj]);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11713
11713
|
|
|
11714
11714
|
/***/ }),
|
|
11715
11715
|
|
|
@@ -13348,7 +13348,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
13348
13348
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
13349
13349
|
|
|
13350
13350
|
"use strict";
|
|
13351
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `Skips event parameters.\n\nNote that this currently does not work if the source code uses macros.\n\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
13351
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `Skips event parameters.\n\nNote that this currently does not work if the source code uses macros.\n\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all variables are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all variables are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (this.conf.skipNames\r\n && this.conf.skipNames.length > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"selection_screen_tab\" /* IdentifierMeta.SelectionScreenTab */)\r\n || meta.includes(\"event_parameter\" /* IdentifierMeta.EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* IdentifierMeta.InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
13352
13352
|
|
|
13353
13353
|
/***/ }),
|
|
13354
13354
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/cli",
|
|
3
|
-
"version": "2.94.
|
|
3
|
+
"version": "2.94.9",
|
|
4
4
|
"description": "abaplint - Command Line Interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"abaplint": "./abaplint"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://abaplint.org",
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@abaplint/core": "^2.94.
|
|
40
|
+
"@abaplint/core": "^2.94.9",
|
|
41
41
|
"@types/chai": "^4.3.4",
|
|
42
42
|
"@types/glob": "^7.2.0",
|
|
43
43
|
"@types/minimist": "^1.2.2",
|