mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
ecbf25378b
Complete migration of method definition nodes to variable-sized format: - Convert NODE_DEF and NODE_SDEF from fixed cons-based to variable-sized nodes - Update parser to create variable-sized def/sdef nodes directly - Remove old codegen_def and codegen_sdef functions - Consolidate method setup logic in defn_setup function - Rename lambda_body_ex to lambda_body after removing wrapper layer - Update all method definition code generation to use new node structure This completes the variable-sized node migration for method definitions, improving memory efficiency and enabling more flexible AST handling. 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