Class: Gloss::Runtime
- Inherits:
-
Object
- Object
- Gloss::Runtime
- Defined in:
- lib/gloss/runtime.rb
Constant Summary collapse
- NON_EXISTENT_FILEPATH =
"__string__"
Class Method Summary collapse
Class Method Details
.process_string(str, options = Config.default_config) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gloss/runtime.rb', line 9 def self.process_string(str, = Config.default_config) out_io = StringIO.new error_msg = catch(:"error") { || tree = Parser.new(str) .run tc = ProgLoader.new(NON_EXISTENT_FILEPATH, str) .run rb_output = Visitor.new(tree, tc) .run tc.run(NON_EXISTENT_FILEPATH, rb_output) Writer.new(rb_output, NON_EXISTENT_FILEPATH, out_io) .run nil } return [out_io.string, error_msg].freeze end |