BigW Consortium Gitlab

Commit 4e9f017e by Grzegorz Bizon

Rename tokens to lexemes in pipeline expressions

parent 2125d6fa
...@@ -2,7 +2,7 @@ module Gitlab ...@@ -2,7 +2,7 @@ module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Expression module Expression
class Equals < Expression::Token class Equals < Expression::Lexeme
PATTERN = /==/.freeze PATTERN = /==/.freeze
def initialize(left, right) def initialize(left, right)
......
...@@ -2,15 +2,11 @@ module Gitlab ...@@ -2,15 +2,11 @@ module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Expression module Expression
class Token class Lexeme
def evaluate(**variables) def evaluate(**variables)
raise NotImplementedError raise NotImplementedError
end end
def self.build(string)
raise NotImplementedError
end
def self.scan(scanner) def self.scan(scanner)
scanner.scan(PATTERN) scanner.scan(PATTERN)
end end
......
...@@ -2,7 +2,7 @@ module Gitlab ...@@ -2,7 +2,7 @@ module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Expression module Expression
class Null < Expression::Token class Null < Expression::Lexeme
PATTERN = /null/.freeze PATTERN = /null/.freeze
def initialize(value) def initialize(value)
......
...@@ -2,7 +2,7 @@ module Gitlab ...@@ -2,7 +2,7 @@ module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Expression module Expression
class String < Expression::Token class String < Expression::Lexeme
PATTERN = /("|')(?<value>.+)('|")/.freeze PATTERN = /("|')(?<value>.+)('|")/.freeze
def initialize(value) def initialize(value)
......
...@@ -2,7 +2,7 @@ module Gitlab ...@@ -2,7 +2,7 @@ module Gitlab
module Ci module Ci
module Pipeline module Pipeline
module Expression module Expression
class Equality < Expression::Token class Equality < Expression::Lexeme
PATTERN = /$(?<name>\w+)/.freeze PATTERN = /$(?<name>\w+)/.freeze
def initialize(value) def initialize(value)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment