@neo-one/smart-contract-compiler
Version:
NEO•ONE TypeScript smart contract compiler.
34 lines (32 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FalseBooleanLiteralCompiler = exports.TrueBooleanLiteralCompiler = exports.BooleanLiteralCompiler = void 0;
const tslib_1 = require("tslib");
const typescript_1 = tslib_1.__importDefault(require("typescript"));
const NodeCompiler_1 = require("../NodeCompiler");
class BooleanLiteralCompiler extends NodeCompiler_1.NodeCompiler {
visitNode(sb, expr, options) {
if (options.pushValue) {
sb.emitPushBoolean(expr, this.value);
sb.emitHelper(expr, options, sb.helpers.wrapBoolean);
}
}
}
exports.BooleanLiteralCompiler = BooleanLiteralCompiler;
class TrueBooleanLiteralCompiler extends BooleanLiteralCompiler {
constructor() {
super(...arguments);
this.kind = typescript_1.default.SyntaxKind.TrueKeyword;
this.value = true;
}
}
exports.TrueBooleanLiteralCompiler = TrueBooleanLiteralCompiler;
class FalseBooleanLiteralCompiler extends BooleanLiteralCompiler {
constructor() {
super(...arguments);
this.kind = typescript_1.default.SyntaxKind.FalseKeyword;
this.value = false;
}
}
exports.FalseBooleanLiteralCompiler = FalseBooleanLiteralCompiler;
//# sourceMappingURL=BooleanLiteralCompiler.js.map