mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
5f43603c52
Remove NODE_STR and NODE_XSTR enum values and all associated code as these traditional node types are no longer used with the new cons list string representation. The compiler now exclusively uses the cons list format ((len . str) (-1 . node)...) for all string types. - remove NODE_STR and NODE_XSTR from node_type enum in node.h - remove NODE_STR and NODE_XSTR cases from codegen.c switch statements - remove NODE_STR and NODE_XSTR cases from parse.y codedump functions - remove unused codegen_str(), codegen_xstr(), and gen_xstr_var() functions - update codegen_dregx() to use cons list string handling instead of checking for obsolete NODE_STR - preserve str_dump() function wrapped in #if 0 for future codedump updates - update comment in node.h to reflect current node types NODE_DSTR remains available for dynamic string interpolation. All string functionality continues to work via the cons list representation and variable-sized node implementations. 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