Class: BELParser::Script::Syntax::InvalidRegexPatternError
- Inherits:
-
Language::Syntax::SyntaxError
- Object
- Language::Syntax::SyntaxResult
- Language::Syntax::SyntaxError
- BELParser::Script::Syntax::InvalidRegexPatternError
- Defined in:
- lib/bel_parser/script/syntax/invalid_regex_pattern.rb
Overview
InvalidRegexPattern indicates that a pattern represented an invalid regular expression.
Instance Attribute Summary collapse
-
#pattern ⇒ Object
readonly
Gets the invalid pattern.
Attributes inherited from Language::Syntax::SyntaxResult
#expression_node, #specification
Instance Method Summary collapse
-
#initialize(pattern_node, pattern, error_msg) ⇒ InvalidRegexPatternError
constructor
A new instance of InvalidRegexPatternError.
- #msg ⇒ Object
Methods inherited from Language::Syntax::SyntaxError
Methods inherited from Language::Syntax::SyntaxResult
Constructor Details
#initialize(pattern_node, pattern, error_msg) ⇒ InvalidRegexPatternError
Returns a new instance of InvalidRegexPatternError.
33 34 35 36 37 |
# File 'lib/bel_parser/script/syntax/invalid_regex_pattern.rb', line 33 def initialize(pattern_node, pattern, error_msg) super(pattern_node, nil) @pattern = pattern @error_msg = error_msg end |
Instance Attribute Details
#pattern ⇒ Object (readonly)
Gets the invalid pattern.
31 32 33 |
# File 'lib/bel_parser/script/syntax/invalid_regex_pattern.rb', line 31 def pattern @pattern end |
Instance Method Details
#msg ⇒ Object
39 40 41 42 43 |
# File 'lib/bel_parser/script/syntax/invalid_regex_pattern.rb', line 39 def msg <<-MSG.gsub(/^ +/, '').delete("\n") "#@pattern" is not a valid regular expression (#@error_msg). MSG end |