Skip to content

Commit

Permalink
fix eval rule
Browse files Browse the repository at this point in the history
  • Loading branch information
on-keyday committed Jan 26, 2025
1 parent 9bd381f commit 6f6d09b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/ast/tool/eval.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,11 +401,14 @@ namespace brgen::ast::tool {
if (auto io_op = ast::as<ast::IOOperation>(expr)) {
if (io_op->method == ast::IOMethod::config_endian_big ||
io_op->method == ast::IOMethod::config_bit_order_msb) {
return make_result<EResultType::boolean>(false);
return make_result<EResultType::integer>(0);
}
if (io_op->method == ast::IOMethod::config_endian_little ||
io_op->method == ast::IOMethod::config_bit_order_lsb) {
return make_result<EResultType::boolean>(true);
return make_result<EResultType::integer>(1);
}
if (io_op->method == ast::IOMethod::config_endian_native) {
return make_result<EResultType::integer>(2);
}
}
return unexpect(LocError{expr->loc, "not supported"});
Expand Down

0 comments on commit 6f6d09b

Please sign in to comment.