ERB::Compiler::SimpleScanner2 (Class)

In: libraries/erb.rb
Parent: Scanner

Methods

scan  

Public Instance methods

[Source]

     # File libraries/erb.rb, line 174
174:         def scan
175:           stag_reg = /(.*?)(<%%|<%=|<%#|<%|\n|\z)/
176:           etag_reg = /(.*?)(%%>|%>|\n|\z)/
177:           scanner = StringScanner.new(@src)
178:           while ! scanner.eos?
179:             scanner.scan(@stag ? etag_reg : stag_reg)
180:             text = scanner[1]
181:             elem = scanner[2]
182:             yield(text) unless text.empty?
183:             yield(elem) unless elem.empty?
184:           end
185:         end

[Validate]