зеркало из https://github.com/github/ruby.git
* lib/erb.rb: Simplify regexp to optimize erb scanner.
[fix GH-1144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d09d1ced1a
Коммит
1178a6fdba
|
@ -1,3 +1,8 @@
|
|||
Tue Dec 15 12:20:30 2015 Takashi Kokubun <takashikkbn@gmail.com>
|
||||
|
||||
* lib/erb.rb: Simplify regexp to optimize erb scanner.
|
||||
[fix GH-1144]
|
||||
|
||||
Tue Dec 15 11:56:24 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
|
||||
|
||||
* lib/uri/common.rb: make code block for rdoc.
|
||||
|
|
|
@ -506,8 +506,8 @@ class ERB
|
|||
require 'strscan'
|
||||
class SimpleScanner2 < Scanner # :nodoc:
|
||||
def scan
|
||||
stag_reg = /(.*?)(<%%|<%=|<%#|<%|\z)/m
|
||||
etag_reg = /(.*?)(%%>|%>|\z)/m
|
||||
stag_reg = /(.*?)(<%[%=#]?|\z)/m
|
||||
etag_reg = /(.*?)(%%?>|\z)/m
|
||||
scanner = StringScanner.new(@src)
|
||||
while ! scanner.eos?
|
||||
scanner.scan(@stag ? etag_reg : stag_reg)
|
||||
|
|
Загрузка…
Ссылка в новой задаче