method
scan
scan()
public
Hide source
# File lib/erb.rb, line 504 def scan stag_reg = (stags == DEFAULT_STAGS) ? /(.*?)(<%[%=#]?|\z)/ : /(.*?)(#{stags.join('|')}|\z)/ etag_reg = (etags == DEFAULT_ETAGS) ? /(.*?)(%%?>|\z)/ : /(.*?)(#{etags.join('|')}|\z)/ scanner = StringScanner.new(@src) while ! scanner.eos? scanner.scan(@stag ? etag_reg : stag_reg) yield(scanner[1]) yield(scanner[2]) end end