Exception: Rouge::RegexLexer::ClosedState
- Inherits:
-
StandardError
- Object
- StandardError
- Rouge::RegexLexer::ClosedState
- Defined in:
- lib/rouge/regex_lexer.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(state) ⇒ ClosedState
constructor
A new instance of ClosedState.
- #rule ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(state) ⇒ ClosedState
Returns a new instance of ClosedState.
21 22 23 |
# File 'lib/rouge/regex_lexer.rb', line 21 def initialize(state) @state = state end |
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
20 21 22 |
# File 'lib/rouge/regex_lexer.rb', line 20 def state @state end |
Instance Method Details
#rule ⇒ Object
25 26 27 |
# File 'lib/rouge/regex_lexer.rb', line 25 def rule @state.rules.last end |
#to_s ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/rouge/regex_lexer.rb', line 29 def to_s rule = @state.rules.last msg = "State :#{state.name} cannot continue after #{rule.inspect}, which will always match." if rule.re.source.include?('*') msg += " Consider replacing * with +." end msg end |