Class: Opal::Parser
- Inherits:
-
Parser::Ruby23
- Object
- Parser::Ruby23
- Opal::Parser
- Defined in:
- opal/lib/opal/parser.rb
Class Attribute Summary collapse
-
.diagnostics_consumer ⇒ Object
Returns the value of attribute diagnostics_consumer.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Parser
constructor
A new instance of Parser.
- #parse(source_buffer) ⇒ Object
- #rewrite(node) ⇒ Object
Constructor Details
Class Attribute Details
.diagnostics_consumer ⇒ Object
Returns the value of attribute diagnostics_consumer
16 17 18 |
# File 'opal/lib/opal/parser.rb', line 16 def diagnostics_consumer @diagnostics_consumer end |
Class Method Details
.default_parser ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'opal/lib/opal/parser.rb', line 18 def default_parser parser = super parser.diagnostics.all_errors_are_fatal = true parser.diagnostics.ignore_warnings = false if RUBY_ENGINE == 'opal' parser.diagnostics.consumer = ->(diag){} else parser.diagnostics.consumer = diagnostics_consumer end parser end |
Instance Method Details
#parse(source_buffer) ⇒ Object
40 41 42 43 44 |
# File 'opal/lib/opal/parser.rb', line 40 def parse(source_buffer) parsed = super rewriten = rewrite(parsed) rewriten end |