# ERB::Compiler::SimpleScanner2 (Class)

In: | erb.rb
Parent: | Scanner

## Methods

scan

## Public Instance methods

scan() {|text| ...}

[Source]

    # File erb.rb, line 174
            def scan
              stag_reg = /(.*?)(<%%|<%=|<%#|<%|\n|\z)/
              etag_reg = /(.*?)(%%>|%>|\n|\z)/
              scanner = StringScanner.new(@src)
              while ! scanner.eos?
                scanner.scan(@stag ? etag_reg : stag_reg)
                text = scanner[1]
                elem = scanner[2]
                yield(text) unless text.empty?
                yield(elem) unless elem.empty?
              end
            end

[Validate]