Exception: Flexr::Runtime::ResourceLimitError

Inherits:
LexError
  • Object
show all
Defined in:
lib/flexr/runtime/errors.rb

Instance Attribute Summary collapse

Attributes inherited from LexError

#byte_pos, #filename, #line, #text

Attributes inherited from Error

#diagnostic

Instance Method Summary collapse

Constructor Details

#initialize(code, message, help:, filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil) ⇒ ResourceLimitError

Returns a new instance of ResourceLimitError.



27
28
29
30
31
32
# File 'lib/flexr/runtime/errors.rb', line 27

def initialize(code, message, help:, filename: nil, byte_pos: nil, line: nil, text: nil, rule: nil)
  @code = code
  @rule = rule
  diagnostic = Diagnostics.error(code, message, help: help, note: rule.nil? ? nil : "rule #{rule}")
  super(message, filename: filename, byte_pos: byte_pos, line: line, text: text, diagnostic: diagnostic)
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



25
26
27
# File 'lib/flexr/runtime/errors.rb', line 25

def code
  @code
end

#ruleObject (readonly)

Returns the value of attribute rule.



25
26
27
# File 'lib/flexr/runtime/errors.rb', line 25

def rule
  @rule
end