Exception: Bade::Parser::SyntaxError
- Inherits:
-
StandardError
- Object
- StandardError
- Bade::Parser::SyntaxError
- Defined in:
- lib/bade/parser.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
Instance Method Summary collapse
-
#initialize(error, file, line, lineno, column) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #to_s ⇒ Object
Constructor Details
#initialize(error, file, line, lineno, column) ⇒ SyntaxError
Returns a new instance of SyntaxError.
15 16 17 18 19 20 21 |
# File 'lib/bade/parser.rb', line 15 def initialize(error, file, line, lineno, column) @error = error @file = file || '(__TEMPLATE__)' @line = line.to_s @lineno = lineno @column = column end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
13 14 15 |
# File 'lib/bade/parser.rb', line 13 def column @column end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
13 14 15 |
# File 'lib/bade/parser.rb', line 13 def error @error end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
13 14 15 |
# File 'lib/bade/parser.rb', line 13 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
13 14 15 |
# File 'lib/bade/parser.rb', line 13 def line @line end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
13 14 15 |
# File 'lib/bade/parser.rb', line 13 def lineno @lineno end |
Instance Method Details
#to_s ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/bade/parser.rb', line 23 def to_s line = @line.lstrip column = @column + line.size - @line.size %{#{error} #{file}, Line #{lineno}, Column #{@column} #{line} #{' ' * column}^ } end |