# File lib/html/htmlparser.rb, line 69
 69:     def goahead(_end)
 70:         rawdata = @rawdata
 71:         i = 0
 72:         n = rawdata.length
 73:         while i < n
 74:         if @nomoretags
 75:             handle_data(rawdata[i..(n-1)])
 76:             i = n
 77:             break
 78:         end
 79:         j = rawdata.index(Interesting, i)
 80:         j = n unless j
 81:         if i < j
 82:             handle_data(rawdata[i..(j-1)])
 83:         end
 84:         i = j
 85:         break if (i == n)
 86:         if rawdata[i] == ?< #

 87:             if rawdata.index(Starttagopen, i) == i
 88:             if @literal
 89:                 handle_data(rawdata[i, 1])
 90:                 i += 1
 91:                 next
 92:             end
 93:             k = parse_starttag(i)
 94:             break unless k
 95:             i = k
 96:             next
 97:             end
 98:             if rawdata.index(Endtagopen, i) == i
 99:             k = parse_endtag(i)
100:             break unless k
101:             i = k
102:             @literal = false
103:             next
104:             end
105:             if rawdata.index(Commentopen, i) == i
106:             if @literal
107:                 handle_data(rawdata[i,1])
108:                 i += 1
109:                 next
110:             end
111:             k = parse_comment(i)
112:             break unless k
113:             i += k
114:             next
115:             end
116:             if rawdata.index(Special, i) == i
117:             if @literal
118:                 handle_data(rawdata[i, 1])
119:                 i += 1
120:                 next
121:             end
122:             k = parse_special(i)
123:             break unless k
124:             i += k
125:             next
126:             end
127:         elsif rawdata[i] == ?& #

128:             if rawdata.index(Charref, i) == i
129:             i += $&.length
130:             handle_charref($1)
131:             i -= 1 unless rawdata[i-1] == ?;
132:             next
133:             end
134:             if rawdata.index(Entityref, i) == i
135:             i += $&.length
136:             handle_entityref($1)
137:             i -= 1 unless rawdata[i-1] == ?;
138:             next
139:             end
140:         else
141:             raise RuntimeError, 'neither < nor & ??'
142:         end
143:         # We get here only if incomplete matches but

144:         # nothing else

145:         match = rawdata.index(Incomplete, i)
146:         unless match == i
147:             handle_data(rawdata[i, 1])
148:             i += 1
149:             next
150:         end
151:         j = match + $&.length
152:         break if j == n # Really incomplete

153:         handle_data(rawdata[i..(j-1)])
154:         i = j
155:         end
156:         # end while

157:         if _end and i < n
158:         handle_data(@rawdata[i..(n-1)])
159:         i = n
160:         end
161:         @rawdata = rawdata[i..-1]
162:     end