class Chronic::Separator
def self.scan(tokens, options)
options - The Hash of options specified in Chronic::parse.
tokens - An Array of tokens to scan.
tags to each token.
Scan an Array of Token objects and apply any necessary Separator
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 if t = scan_for_and(token) then token.tag(t); next end end end
def self.scan_for_and(token)
token - The Token object we want to scan.
def self.scan_for_and(token) scan_for token, SeparatorAnd, { /^and$/ => :and } end
def self.scan_for_at(token)
token - The Token object we want to scan.
def self.scan_for_at(token) scan_for token, SeparatorAt, { /^(at|@)$/ => :at } end
def self.scan_for_commas(token)
token - The Token object we want to scan.
def self.scan_for_commas(token) scan_for token, SeparatorComma, { /^,$/ => :comma } end
def self.scan_for_in(token)
token - The Token object we want to scan.
def self.scan_for_in(token) scan_for token, SeparatorIn, { /^in$/ => :in } end
def self.scan_for_on(token)
token - The Token object we want to scan.
def self.scan_for_on(token) scan_for token, SeparatorOn, { /^on$/ => :on } end
def self.scan_for_slash_or_dash(token)
token - The Token object we want to scan.
def self.scan_for_slash_or_dash(token) scan_for token, SeparatorSlashOrDash, { /^-$/ => :dash, /^\/$/ => :slash } end
def to_s
def to_s 'separator' end