Exception: Mustache::Parser::SyntaxError
- Inherits:
-
StandardError
- Object
- StandardError
- Mustache::Parser::SyntaxError
- Defined in:
- lib/mustache/parser.rb
Overview
A SyntaxError is raised when the Parser comes across unclosed tags, sections, illegal content in tags, or anything of that sort.
Instance Method Summary collapse
-
#initialize(message, position) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, position) ⇒ SyntaxError
Returns a new instance of SyntaxError.
30 31 32 33 34 35 |
# File 'lib/mustache/parser.rb', line 30 def initialize(, position) @message = @lineno, @column, @line, _ = position @stripped_line = @line.strip @stripped_column = @column - (@line.size - @line.lstrip.size) end |
Instance Method Details
#to_s ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/mustache/parser.rb', line 37 def to_s <<-EOF #{@message} Line #{@lineno} #{@stripped_line} #{' ' * @stripped_column}^ EOF end |