2018-02-21 06:37:55 -05:00
|
|
|
module Gitlab
|
|
|
|
module Ci
|
|
|
|
module Pipeline
|
|
|
|
module Expression
|
|
|
|
class Token
|
2018-02-22 10:04:18 -05:00
|
|
|
attr_reader :value, :lexeme
|
2018-02-21 06:51:56 -05:00
|
|
|
|
2018-02-22 10:04:18 -05:00
|
|
|
def initialize(value, lexeme)
|
2018-02-21 06:37:55 -05:00
|
|
|
@value = value
|
2018-02-22 10:04:18 -05:00
|
|
|
@lexeme = lexeme
|
2018-02-21 06:37:55 -05:00
|
|
|
end
|
|
|
|
|
2018-02-22 10:04:18 -05:00
|
|
|
def build(*args)
|
|
|
|
@lexeme.build(@value, *args)
|
|
|
|
end
|
|
|
|
|
|
|
|
def type
|
|
|
|
@lexeme.type
|
2018-02-21 07:38:37 -05:00
|
|
|
end
|
|
|
|
|
2018-02-21 06:37:55 -05:00
|
|
|
def to_lexeme
|
2018-02-22 10:04:18 -05:00
|
|
|
@lexeme.name.demodulize.downcase
|
2018-02-21 06:37:55 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|