visitAssertStmt method
Implementation
@override
Uint8List visitAssertStmt(AssertStmt stmt) {
final bytesBuilder = BytesBuilder();
if (!config.removeAssertion) {
bytesBuilder.add(_lineInfo(stmt.line, stmt.column));
final bytes = compileAST(stmt.expr);
bytesBuilder.add(bytes);
bytesBuilder.addByte(HTOpCode.assertion);
final content = stmt.source!.content;
final text = content.substring(stmt.expr.offset, stmt.expr.end);
bytesBuilder.add(_parseIdentifier(text.trim()));
bytesBuilder.addByte(HTOpCode.endOfStmt);
}
return bytesBuilder.toBytes();
}