class AdLint::Token
DESCRIPTION¶ ↑
Attributes
Public Class Methods
Public Instance Methods
<=>(rhs)
click to toggle source
DESCRIPTION¶ ↑
Compares tokens.
PARAMETER¶ ↑
- rhs
-
Token
– Right-hand-side token.
RETURN VALUE¶ ↑
Integer
– Comparision result.
# File lib/adlint/token.rb, line 87 def <=>(rhs) case rhs when Symbol, String @type <=> rhs when Token if (type_diff = @type <=> rhs.type) == 0 if (val_diff = @value <=> rhs.value) == 0 @location <=> rhs.location else val_diff end else type_diff end else raise TypeError end end
eql?(rhs_tok)
click to toggle source
# File lib/adlint/token.rb, line 106 def eql?(rhs_tok) @type == rhs_tok.type && @value == rhs_tok.value && @location == rhs_tok.location end
hash()
click to toggle source
# File lib/adlint/token.rb, line 111 def hash [@type, @value, @location].hash end
need_no_further_replacement?()
click to toggle source
# File lib/adlint/token.rb, line 75 def need_no_further_replacement? false end
replaced?()
click to toggle source
# File lib/adlint/token.rb, line 71 def replaced? false end