Exception: Citrus::SyntaxError
- Inherits:
-
ScriptError
- Object
- ScriptError
- Citrus::SyntaxError
- Defined in:
- lib/citrus/exceptions.rb
Instance Method Summary collapse
-
#initialize ⇒ SyntaxError
constructor
A new instance of SyntaxError.
Constructor Details
#initialize ⇒ SyntaxError
Returns a new instance of SyntaxError.
3 4 5 6 7 8 9 10 |
# File 'lib/citrus/exceptions.rb', line 3 def initialize line = $parser.failure_line col = $parser.failure_column str = $parser.input.lines.to_a[line-1] str = str.slice(col-1, str.length).delete($/) str = "file end" if str.empty? super("Unexpected #{str} at #{line}:#{col}.") end |