Exception: Flexr::Runtime::TokenTooLargeError
- Defined in:
- lib/flexr/runtime/errors.rb
Constant Summary collapse
- CODE =
"FLEXR-E012"
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
Attributes inherited from LexError
#byte_pos, #filename, #line, #text
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message = "token exceeds max_token_size", filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) ⇒ TokenTooLargeError
constructor
A new instance of TokenTooLargeError.
Constructor Details
#initialize(message = "token exceeds max_token_size", filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) ⇒ TokenTooLargeError
Returns a new instance of TokenTooLargeError.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/flexr/runtime/errors.rb', line 10 def initialize( = "token exceeds max_token_size", filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) @code = CODE @rule = rule diagnostic = Diagnostics.error( CODE, , help: "increase max_token_size or split the input token", note: rule.nil? ? nil : "rule #{rule} at byte #{byte_pos}" ) super(, filename: filename, byte_pos: byte_pos, line: line, text: text, diagnostic: diagnostic) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
8 9 10 |
# File 'lib/flexr/runtime/errors.rb', line 8 def code @code end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
8 9 10 |
# File 'lib/flexr/runtime/errors.rb', line 8 def rule @rule end |