Exception: PuppetLint::LexerError
- Inherits:
-
StandardError
- Object
- StandardError
- PuppetLint::LexerError
- Defined in:
- lib/puppet-lint/lexer.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#line_no ⇒ Object
readonly
Returns the value of attribute line_no.
Instance Method Summary collapse
-
#initialize(code, offset) ⇒ LexerError
constructor
A new instance of LexerError.
Constructor Details
#initialize(code, offset) ⇒ LexerError
Returns a new instance of LexerError.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/puppet-lint/lexer.rb', line 9 def initialize(code, offset) chunk = code[0..offset] @line_no = chunk.count("\n") + 1 if @line_no == 1 @column = chunk.length else @column = chunk.length - chunk.rindex("\n") - 1 end @column = 1 if @column == 0 end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
8 9 10 |
# File 'lib/puppet-lint/lexer.rb', line 8 def column @column end |
#line_no ⇒ Object (readonly)
Returns the value of attribute line_no.
8 9 10 |
# File 'lib/puppet-lint/lexer.rb', line 8 def line_no @line_no end |