marijnh/CodeMirror2 — pull request #558 by krockot (2012-06-01 22:48:01+00:00)
Title: fix scheme number parsing

The latest fix introduced a new bug that was causing number regexes to match too far ahead of the current position.

For example, when parsing `((foo 3) 4)`, the `stream.match` following `/\d/.test("3")` would match ahead to the following `4`, causing the stream to skip a single character over `)` and yielding a number token `3)`.

Likewise, parsing `((foo -) 4)` would behave similarly and yield `-)` as a number token.

This change includes two slightly stricter patterns that solve the problem.