correct the dedup code
This commit is contained in:
parent
6781bd966d
commit
23c5558f37
|
@ -33,7 +33,7 @@ module ActionDispatch
|
|||
end
|
||||
|
||||
private
|
||||
|
||||
|
||||
# takes advantage of String @- deduping capabilities in Ruby 2.5 upwards
|
||||
# see: https://bugs.ruby-lang.org/issues/13077
|
||||
def dedup_scan(regex)
|
||||
|
@ -58,9 +58,9 @@ module ActionDispatch
|
|||
[:SYMBOL, text]
|
||||
when text = dedup_scan(/\*\w+/)
|
||||
[:STAR, text]
|
||||
when text = dedup_scan(/(?:[\w%\-~!$&'*+,;=@]|\\[:()])+/)
|
||||
when text = @ss.scan(/(?:[\w%\-~!$&'*+,;=@]|\\[:()])+/)
|
||||
text.tr! "\\", ""
|
||||
[:LITERAL, text]
|
||||
[:LITERAL, -text]
|
||||
# any char
|
||||
when text = dedup_scan(/./)
|
||||
[:LITERAL, text]
|
||||
|
|
Loading…
Reference in New Issue