Class: Fbtxt::LexerResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tokens, errors = []) ⇒ LexerResult

Returns a new instance of LexerResult.



99
100
101
# File 'lib/fbtxt/lexer.rb', line 99

def initialize( tokens, errors=[] )
    @tokens, @errors = tokens, errors
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



98
99
100
# File 'lib/fbtxt/lexer.rb', line 98

def errors
  @errors
end

#tokensObject (readonly)

Returns the value of attribute tokens.



98
99
100
# File 'lib/fbtxt/lexer.rb', line 98

def tokens
  @tokens
end

Instance Method Details

#nok?Boolean

Returns:

  • (Boolean)


104
# File 'lib/fbtxt/lexer.rb', line 104

def nok?() !ok?; end

#ok?Boolean

Returns:

  • (Boolean)


103
# File 'lib/fbtxt/lexer.rb', line 103

def ok?()  @errors.size == 0; end