@abaplint/core
Version:
abaplint - Core API
17 lines • 875 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CDSString = void 0;
const combi_1 = require("../../abap/2_statements/combi");
class CDSString extends combi_1.Expression {
getRunnable() {
// Allow any character except unescaped single quote; '' or \' are escaped single quotes.
// Standalone backslashes (e.g. 'C:\\temp') are also valid as long as they don't form \'.
const reg = (0, combi_1.regex)(/^'(?:[^'\\]|''|\\'|\\(?!'))*'$/);
// Typed literal: abap.char 'X' — previously lexed as abap . char'X' (single token)
// now correctly lexed as three tokens: abap, ., char, 'value'
const abap = (0, combi_1.seq)("abap", ".", (0, combi_1.regex)(/^char$/), reg);
return (0, combi_1.altPrio)(abap, reg);
}
}
exports.CDSString = CDSString;
//# sourceMappingURL=cds_string.js.map