Class: AdLint::TokensContent

Inherits:
Content
  • Object
show all
Defined in:
lib/adlint/lexer.rb

Instance Method Summary collapse

Constructor Details

#initialize(tok_ary) ⇒ TokensContent

Returns a new instance of TokensContent.



172
173
174
# File 'lib/adlint/lexer.rb', line 172

def initialize(tok_ary)
  @token_ary = tok_ary
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


184
185
186
# File 'lib/adlint/lexer.rb', line 184

def empty?
  @token_ary.empty?
end

#locationObject



176
177
178
179
180
181
182
# File 'lib/adlint/lexer.rb', line 176

def location
  if self.empty?
    nil
  else
    @token_ary.first.location
  end
end

#next_tokenObject



188
189
190
191
192
193
194
# File 'lib/adlint/lexer.rb', line 188

def next_token
  if empty?
    nil
  else
    @token_ary.shift
  end
end