mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
cbe01d574c
- Remove obsolete NODE_ARGS_TAIL enum value and all references - Simplify mrb_ast_case_node from variable-sized array back to simple cons-list structure - Update new_case() function to use original cons-list approach instead of flattening - Fix infinite loop in gen_case_var() when case statements have no matching clauses - Improve code readability by renaming pos3 to case_end_jumps in gen_case_var() - Restore memory-efficient case statement parsing without complex array management The variable-sized array approach for case nodes provided no memory benefit since cons lists aren't recycled. This change restores the simpler original implementation while fixing a critical bug that caused mrbtest to hang on "register window of calls" test. Co-authored-by: Claude <noreply@anthropic.com>
mruby-compiler
This mrbgem provides the mruby compiler, which is responsible for parsing Ruby code and generating mruby bytecode.
Functionality
The mruby-compiler gem includes the following components:
- Parser: Translates Ruby source code into an abstract syntax tree (AST).
- Code Generator: Traverses the AST to produce executable mruby bytecode.
mrbcexecutable: A command-line tool for compiling.rbfiles into.mrbbytecode files.
Usage
The mrbc (mruby-bin-mrbc) executable will generate compiled binary from Ruby
programs via this gem.
Example of using mrbc:
# Compile a Ruby script to bytecode
bin/mrbc my_script.rb
# Run the compiled script
bin/mruby my_script.mrb