Exception: Slim::Parser::SyntaxError Private

Inherits:
StandardError
  • Object
show all
Defined in:
lib/slim/parser.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, file, line, lineno, column) ⇒ SyntaxError

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of SyntaxError.

API:

  • private



28
29
30
31
32
33
34
# File 'lib/slim/parser.rb', line 28

def initialize(error, file, line, lineno, column)
  @error = error
  @file = file || '(__TEMPLATE__)'
  @line = line.to_s
  @lineno = lineno
  @column = column
end

Instance Attribute Details

#columnObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



26
27
28
# File 'lib/slim/parser.rb', line 26

def column
  @column
end

#errorObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



26
27
28
# File 'lib/slim/parser.rb', line 26

def error
  @error
end

#fileObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



26
27
28
# File 'lib/slim/parser.rb', line 26

def file
  @file
end

#lineObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



26
27
28
# File 'lib/slim/parser.rb', line 26

def line
  @line
end

#linenoObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



26
27
28
# File 'lib/slim/parser.rb', line 26

def lineno
  @lineno
end

Instance Method Details

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



36
37
38
39
40
41
42
43
44
# File 'lib/slim/parser.rb', line 36

def to_s
  line = @line.lstrip
  column = @column + line.size - @line.size
  %{#{error}
  #{file}, Line #{lineno}, Column #{@column}
    #{line}
    #{' ' * column}^
}
end