mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
87de799cd5
This completes the conversion of NODE_HEREDOC from traditional cons-list nodes to variable-sized nodes by: 1. Modified new_heredoc to always use variable-sized nodes with embedded parser_heredoc_info struct and updated function signature to return info pointer via output parameter 2. Fixed parsing_heredoc_info to handle NODE_VARIABLE wrapper detection and return address of embedded struct 3. Updated gen_heredoc_var to use embedded info structure for codegen 4. Removed obsolete NODE_HEREDOC case and codegen_heredoc function from traditional codegen path 5. Replaced codegen_heredoc_str wrapper with direct codegen_cons_list_string calls for cleaner semantic naming 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