Method: TestML::Compiler::Lite#tokenize

Defined in:
lib/testml/compiler/lite.rb

#tokenizeObject



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/testml/compiler/lite.rb', line 49

def tokenize
  @tokens = []
  while not @line.empty? do
    next if @line.sub!(/^#{WS}/, '')
    next if @line.sub!(/^#{HASH}#{ANY}*/, '')
    if @line.sub!(/^(#{TOKENS})/, '')
      @tokens.push $1
    else
      fail_("Failed to get token here: '#{@line}'")
    end
  end
end