(regexp)
| 517 | }; |
| 518 | |
| 519 | function read_regexp(regexp) { |
| 520 | return with_eof_error("Unterminated regular expression", function(){ |
| 521 | var prev_backslash = false, ch, in_class = false; |
| 522 | while ((ch = next(true))) if (prev_backslash) { |
| 523 | regexp += "\\" + ch; |
| 524 | prev_backslash = false; |
| 525 | } else if (ch == "[") { |
| 526 | in_class = true; |
| 527 | regexp += ch; |
| 528 | } else if (ch == "]" && in_class) { |
| 529 | in_class = false; |
| 530 | regexp += ch; |
| 531 | } else if (ch == "/" && !in_class) { |
| 532 | break; |
| 533 | } else if (ch == "\\") { |
| 534 | prev_backslash = true; |
| 535 | } else { |
| 536 | regexp += ch; |
| 537 | } |
| 538 | var mods = read_name(); |
| 539 | return token("regexp", [ regexp, mods ]); |
| 540 | }); |
| 541 | }; |
| 542 | |
| 543 | function read_operator(prefix) { |
| 544 | function grow(op) { |
no test coverage detected