Class: Ibex::Frontend::DiagnosticRecovery
- Inherits:
-
Object
- Object
- Ibex::Frontend::DiagnosticRecovery
- Defined in:
- lib/ibex/frontend/diagnostic_recovery.rb
Overview
Re-runs the generated parser after suppressing only conservative source regions.
Constant Summary collapse
- DECLARATION_STARTS =
%w[ pragma include import token prechigh preclow options expect expect_rr start recover on_error_reduce test lexer convert display type param printer ].freeze
Instance Method Summary collapse
-
#initialize(tokens, mode:, max_diagnostics:) ⇒ DiagnosticRecovery
constructor
A new instance of DiagnosticRecovery.
- #parse ⇒ Object
Constructor Details
#initialize(tokens, mode:, max_diagnostics:) ⇒ DiagnosticRecovery
Returns a new instance of DiagnosticRecovery.
18 19 20 21 22 23 24 |
# File 'lib/ibex/frontend/diagnostic_recovery.rb', line 18 def initialize(tokens, mode:, max_diagnostics:) @tokens = tokens @mode = mode @max_diagnostics = max_diagnostics @diagnostics = [] #: Array[Diagnostic] @suppressed = {} #: Hash[Integer, bool] end |
Instance Method Details
#parse ⇒ Object
27 28 29 30 |
# File 'lib/ibex/frontend/diagnostic_recovery.rb', line 27 def parse ast = parse_until_stable [ast, sorted_diagnostics] end |