class Cucumber::CucumberExpressions::CucumberExpressionParser

def parse_tokens_until(expression, parsers, tokens, start_at, end_tokens)

def parse_tokens_until(expression, parsers, tokens, start_at, end_tokens)
  current = start_at
  size = tokens.length
  ast = []
  while current < size do
    if looking_at_any(tokens, current, end_tokens)
      break
    end
    consumed, sub_ast = parse_token(expression, parsers, tokens, current)
    if consumed == 0
      # If configured correctly this will never happen
      # Keep to avoid infinite loops
      raise 'No eligible parsers for ' + tokens
    end
    current += consumed
    ast += sub_ast
  end
  [current - start_at, ast]
end