lib/token_string.rb
# Convert an input string in this format to a token list and validate it

Convert an input string in this format to a token list and validate it
Convert an input string in this format to a token list and validate it
def convert_from str
      t = tokenize( str ).reject {|tok| tok == nil || tok.empty?}
      unless t.all?{|tok| validate(tok)}
        raise ArgumentError.new("Bad token in input: #{str.inspect} (tokens: #{t.inspect})")
      end
      t
    end
def convert_from str t = tokenize ( str ) . reject { | tok | tok == nil || tok . empty? } unless t . all? { | tok | validate ( tok ) } raise ArgumentError . new ( "Bad token in input: #{str.inspect} (tokens: #{t.inspect})" ) end t end
Convert an input string in this format to a token list and validate it
Convert an input string in this format to a token list and validate it
str
<not_specific>