compileAST method
Implementation
Uint8List compileAST(ASTNode node, {bool endOfExec = false}) {
final lowered = _compilation.loweredExpression(node);
if (lowered != null) {
return compileAST(lowered, endOfExec: endOfExec);
}
final bytesBuilder = BytesBuilder();
if (config.computeConstantExpression) {
final constant = _constantFolder.fold(node, _optimization);
if (constant != null) {
bytesBuilder.add(_compileResolvedConstant(constant.value));
} else {
bytesBuilder.add(node.accept(this));
}
} else {
bytesBuilder.add(node.accept(this));
}
if (endOfExec) {
bytesBuilder.addByte(OpCode.endOfExec);
}
return bytesBuilder.toBytes();
}