mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
e3d52cec12
Add support for variable-sized AST nodes for assignment operations including simple assignment, multiple assignment, and operator assignment. Changes: - Add variable-sized node structures for assignment nodes in node.h - Add casting and value access macros for assignment nodes - Modify existing assignment functions to conditionally use variable-sized versions - Implement variable-sized node creation functions (new_asgn_var, new_masgn_var, new_op_asgn_var) - Add codegen support for variable-sized assignment nodes - All assignment types (simple, multiple, operator) now support variable-sized allocation 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