Exception: Ibex::Runtime::ParseError
- Inherits:
-
StandardError
- Object
- StandardError
- Ibex::Runtime::ParseError
- Defined in:
- lib/json5/generated_parser.rb
Overview
Raised by the default parser error handler.
Direct Known Subclasses
Instance Attribute Summary collapse
- #error_id ⇒ Object readonly
- #expected_tokens ⇒ Object readonly
- #location ⇒ Object readonly
- #state ⇒ Object readonly
- #suggestions ⇒ Object readonly
- #token_id ⇒ Object readonly
- #token_name ⇒ Object readonly
- #token_value ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(message = nil, token_id: nil, token_name: nil, token_value: nil, expected_tokens: [], location: nil, state: nil, suggestions: [], error_id: nil, detail: nil) ⇒ ParseError
constructor
rubocop:disable Layout/LineLength rubocop:enable Layout/LineLength.
- #location_label ⇒ Object
Constructor Details
#initialize(message = nil, token_id: nil, token_name: nil, token_value: nil, expected_tokens: [], location: nil, state: nil, suggestions: [], error_id: nil, detail: nil) ⇒ ParseError
rubocop:disable Layout/LineLength rubocop:enable Layout/LineLength
5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 |
# File 'lib/json5/generated_parser.rb', line 5702 def initialize( = nil, token_id: nil, token_name: nil, token_value: nil, expected_tokens: [], location: nil, state: nil, suggestions: [], error_id: nil, detail: nil ) @token_id = token_id @token_name = token_name @token_value = token_value @expected_tokens = expected_tokens.dup.freeze @location = location @state = state @suggestions = suggestions.dup.freeze @error_id = error_id&.dup&.freeze @detail = detail super( || ) end |
Instance Attribute Details
#error_id ⇒ Object (readonly)
5697 5698 5699 |
# File 'lib/json5/generated_parser.rb', line 5697 def error_id @error_id end |
#expected_tokens ⇒ Object (readonly)
5693 5694 5695 |
# File 'lib/json5/generated_parser.rb', line 5693 def expected_tokens @expected_tokens end |
#location ⇒ Object (readonly)
5694 5695 5696 |
# File 'lib/json5/generated_parser.rb', line 5694 def location @location end |
#state ⇒ Object (readonly)
5695 5696 5697 |
# File 'lib/json5/generated_parser.rb', line 5695 def state @state end |
#suggestions ⇒ Object (readonly)
5696 5697 5698 |
# File 'lib/json5/generated_parser.rb', line 5696 def suggestions @suggestions end |
#token_id ⇒ Object (readonly)
5690 5691 5692 |
# File 'lib/json5/generated_parser.rb', line 5690 def token_id @token_id end |
#token_name ⇒ Object (readonly)
5691 5692 5693 |
# File 'lib/json5/generated_parser.rb', line 5691 def token_name @token_name end |
#token_value ⇒ Object (readonly)
5692 5693 5694 |
# File 'lib/json5/generated_parser.rb', line 5692 def token_value @token_value end |
Instance Method Details
#location_label ⇒ Object
5727 5728 5729 5730 5731 5732 |
# File 'lib/json5/generated_parser.rb', line 5727 def location_label file = location_value(:file) || "(input)" line = location_value(:line) || 1 column = location_value(:column) || 1 "#{file}:#{line}:#{column}" end |