Microsoft/TypeScript — pull request #1189 by CyrusNajmabadi (2014-11-18 02:04:52+00:00)
Title: Simplify how regexs are incrementally parsed.

A regex can only be parsed out in a location where it is legal, and where / and /= are not legal. Because of this, if we see a / or /= in a regex location, we scan as much as possible until we see a terminating slash, newline, or EOF. If we see the slash, then the regex is clearly terminated. If we don't, then we just report an error about a missing terminator.

By doing this, we don't end up with the sitaution like the following:

```
foo(/now is the time for all good men);
^
|
```
Add ```/``` here.

Previously, we would need to consider the / invalid so we would reparse from it. Now, the regex will consume up until the end of the line (similar to how a string literal or /* comment would keep consuming) and the edit will necessarily invalidate it and cause reparsing.