Parent

Methods

PuppetLint::Lexer::Token

Attributes

column[R]

Internal: Returns the Integer column number of the line of the manifest text where the Token can be found.

line[R]

Internal: Returns the Integer line number of the manifest text where the Token can be found.

next_code_token[RW]

Internal: Gets/sets the next code token (skips whitespace, comments, etc) in the manifest.

next_token[RW]

Internal: Gets/sets the next token in the manifest.

prev_code_token[RW]

Internal: Gets/sets the previous code tokne (skips whitespace, comments, etc) in the manifest.

prev_token[RW]

Internal: Gets/sets the previous token in the manifest.

type[R]

Internal: Returns the Symbol type of the Token.

value[R]

Internal: Returns the String value of the Token.

Public Class Methods

new(type, value, line, column) click to toggle source

Internal: Initialise a new Token object.

type - An upper case Symbol describing the type of Token. value - The String value of the Token. line - The Integer line number where the Token can be found in the

manifest.

column - The Integer number of characters from the start of the line to

the start of the Token.

Returns the instantiated Token.

# File lib/puppet-lint/lexer/token.rb, line 42
def initialize(type, value, line, column)
  @value = value
  @type = type
  @line = line
  @column = column
  @next_token = nil
  @prev_token = nil
  @next_code_token = nil
  @prev_code_token = nil
end

Public Instance Methods

inspect() click to toggle source

Internal: Produce a human friendly description of the Token when inspected.

Returns a String describing the Token.

# File lib/puppet-lint/lexer/token.rb, line 57
def inspect
  "<Token #{@type.inspect} (#{@value}) @#{@line}:#{@column}>"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.