class ActionDispatch::Journey::Path::Pattern

def requirements_anchored?

def requirements_anchored?
  # each required param must not be surrounded by a literal, otherwise it isn't simple to chunk-match the url piecemeal
  terminals = ast.terminals
  terminals.each_with_index { |s, index|
    next if index < 1
    next if s.type == :DOT || s.type == :SLASH
    back = terminals[index - 1]
    fwd = terminals[index + 1]
    # we also don't support this yet, constraints must be regexps
    return false if s.symbol? && s.regexp.is_a?(Array)
    return false if back.literal?
    return false if !fwd.nil? && fwd.literal?
  }
  true
end