Class: Attentive::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/attentive/token.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pos = nil) ⇒ Token

Returns a new instance of Token.



5
6
7
# File 'lib/attentive/token.rb', line 5

def initialize(pos=nil)
  @pos = pos
end

Instance Attribute Details

#posObject (readonly)

Returns the value of attribute pos.



3
4
5
# File 'lib/attentive/token.rb', line 3

def pos
  @pos
end

Instance Method Details

#==(other) ⇒ Object



9
10
11
# File 'lib/attentive/token.rb', line 9

def ==(other)
  self.class == other.class
end

#ambiguous?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/attentive/token.rb', line 13

def ambiguous?
  false
end

#entity?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/attentive/token.rb', line 17

def entity?
  false
end

#matches?(cursor) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/attentive/token.rb', line 29

def matches?(cursor)
  self == cursor.peek
end

#skippable?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/attentive/token.rb', line 25

def skippable?
  false
end

#whitespace?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/attentive/token.rb', line 21

def whitespace?
  false
end