UNPKG

@abaplint/core

Version:
38 lines 1.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Shift = void 0; const Expressions = require("../../2_statements/expressions"); const source_1 = require("../expressions/source"); const target_1 = require("../expressions/target"); const _type_utils_1 = require("../_type_utils"); const _syntax_input_1 = require("../_syntax_input"); class Shift { runSyntax(node, input) { for (const s of node.findDirectExpressions(Expressions.Source)) { source_1.Source.runSyntax(s, input); } const target = node.findDirectExpression(Expressions.Target); if (target === undefined) { const message = "Shift, Target not found"; input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message)); return; } const targetType = target_1.Target.runSyntax(target, input); if (node.concatTokens().toUpperCase().includes(" IN BYTE MODE")) { if (new _type_utils_1.TypeUtils(input.scope).isHexLike(targetType) === false) { const message = "Shift, Target not hex like"; input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message)); return; } } else { if (new _type_utils_1.TypeUtils(input.scope).isCharLike(targetType) === false) { const message = "Shift, Target not char like"; input.issues.push((0, _syntax_input_1.syntaxIssue)(input, node.getFirstToken(), message)); return; } } } } exports.Shift = Shift; //# sourceMappingURL=shift.js.map