push move_string in to `move`

This commit is contained in:
Aaron Patterson 2014-04-01 15:58:42 -07:00
parent 0e53d11b1f
commit 6c6dc329f8
1 changed files with 12 additions and 14 deletions

View File

@ -41,7 +41,18 @@ module ActionDispatch
def move(t, a)
return [] if t.empty?
move_string(t, a)
regexps = []
t.map { |s|
if states = @regexp_states[s]
regexps.concat states.map { |re, v| re === a ? v : nil }
end
if states = @string_states[s]
states[a]
end
}.compact.concat regexps
end
def as_json(options = nil)
@ -140,19 +151,6 @@ module ActionDispatch
raise ArgumentError, 'unknown symbol: %s' % sym.class
end
end
def move_string(t, a)
regexps = []
t.map { |s|
if states = @regexp_states[s]
regexps.concat states.map { |re, v| re === a ? v : nil }
end
if states = @string_states[s]
states[a]
end
}.compact.concat regexps
end
end
end
end