class Chronic::Separator
def self.scan(tokens, options)
-
(Array)
- list of tokens
Parameters:
-
options
(Hash
) -- Options specified in {Chronic.parse} -
tokens
(Array
) -- Array of tokens to scan
def self.scan(tokens, options) tokens.each do |token| if t = scan_for_commas(token) then token.tag(t); next end if t = scan_for_slash_or_dash(token) then token.tag(t); next end if t = scan_for_at(token) then token.tag(t); next end if t = scan_for_in(token) then token.tag(t); next end if t = scan_for_on(token) then token.tag(t); next end end end
def self.scan_for_at(token)
-
(SeparatorAt, nil)
-
Parameters:
-
token
(Token
) --
def self.scan_for_at(token) scan_for token, SeparatorAt, { /^(at|@)$/ => :at } end
def self.scan_for_commas(token)
-
(SeparatorComma, nil)
-
Parameters:
-
token
(Token
) --
def self.scan_for_commas(token) scan_for token, SeparatorComma, { /^,$/ => :comma } end
def self.scan_for_in(token)
-
(SeparatorIn, nil)
-
Parameters:
-
token
(Token
) --
def self.scan_for_in(token) scan_for token, SeparatorIn, { /^in$/ => :in } end
def self.scan_for_on(token)
-
(SeparatorOn, nil)
-
Parameters:
-
token
(Token
) --
def self.scan_for_on(token) scan_for token, SeparatorOn, { /^on$/ => :on } end
def self.scan_for_slash_or_dash(token)
-
(SeparatorSlashOrDash, nil)
-
Parameters:
-
token
(Token
) --
def self.scan_for_slash_or_dash(token) scan_for token, SeparatorSlashOrDash, { /^-$/ => :dash, /^\/$/ => :slash } end
def to_s
def to_s 'separator' end