One step among code. False when the file is given up.
(top: Frame, c: number)
| 245 | |
| 246 | /** One step among code. False when the file is given up. */ |
| 247 | private code(top: Frame, c: number): boolean { |
| 248 | const src = this.src; |
| 249 | const i = this.i; |
| 250 | if (isSpace(c)) { |
| 251 | this.i = i + 1; |
| 252 | return true; |
| 253 | } |
| 254 | if (c === 47) { |
| 255 | const d = src.charCodeAt(i + 1); |
| 256 | if (d === 47) { |
| 257 | const end = lineEnd(src, i); |
| 258 | this.blank(i, end); |
| 259 | this.i = end; |
| 260 | return true; |
| 261 | } |
| 262 | if (d === 42) { |
| 263 | const end = src.indexOf('*/', i + 2); |
| 264 | if (end === -1) return this.reread(); |
| 265 | this.blank(i, end + 2); |
| 266 | this.i = end + 2; |
| 267 | return true; |
| 268 | } |
| 269 | if (this.exprEnd) { |
| 270 | // `/>` among code: an element read as code. |
| 271 | if (d === 62) return this.reread(); |
| 272 | this.i = i + 1; |
| 273 | this.exprEnd = false; |
| 274 | this.afterDot = false; |
| 275 | return true; |
| 276 | } |
| 277 | const end = regexEnd(src, i); |
| 278 | if (end === -1) { |
| 279 | this.i = i + 1; |
| 280 | return true; |
| 281 | } |
| 282 | this.blank(i + 1, end); |
| 283 | let k = end + 1; |
| 284 | while (k < this.n && isIdPart(src.charCodeAt(k))) k++; |
| 285 | this.i = k; |
| 286 | this.exprEnd = true; |
| 287 | this.afterDot = false; |
| 288 | return true; |
| 289 | } |
| 290 | if (c === 34 || c === 39) { |
| 291 | const end = stringEnd(src, i); |
| 292 | if (end === -1) return this.reread(); |
| 293 | this.blank(i + 1, end); |
| 294 | this.i = end + 1; |
| 295 | this.exprEnd = true; |
| 296 | this.afterDot = false; |
| 297 | return true; |
| 298 | } |
| 299 | if (c === 96) { |
| 300 | this.stack.push({ mode: 'template', braces: 0, name: '' }); |
| 301 | this.i = i + 1; |
| 302 | return true; |
| 303 | } |
| 304 | if (c === 60) { |
no test coverage detected