@abaplint/core
Version:
abaplint - Core API
18 lines • 935 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CDSInteger = void 0;
const combi_1 = require("../../abap/2_statements/combi");
class CDSInteger extends combi_1.Expression {
getRunnable() {
const digits = (0, combi_1.regex)(/^\d+$/);
// Decimal numbers like 100.00 are lexed as 3 tokens: "100" "." "00"
const decimal = (0, combi_1.seq)(digits, ".", digits);
// Scientific notation like 0.0000000000000000E+00 is lexed as:
// "0" "." "0000000000000000E" "+" "00" (mantissa ends with E, sign, exponent)
const mantissa = (0, combi_1.regex)(/^\d+E$/i);
const sciNotation = (0, combi_1.seq)(digits, ".", mantissa, (0, combi_1.altPrio)("+", "-"), digits);
return (0, combi_1.seq)((0, combi_1.opt)("-"), (0, combi_1.altPrio)(sciNotation, decimal, digits));
}
}
exports.CDSInteger = CDSInteger;
//# sourceMappingURL=cds_integer.js.map