Commit Graph

13 Commits (afe8dbe8ae00d852ba648c9a8bfc57a7c519ed54)

Author SHA1 Message Date
Matthew Butterick afe8dbe8ae restore treatment of single-quoted strings 3 years ago
Matthew Butterick 977983e0cb step toward using readtable 3 years ago
Matthew Butterick b7bb0aa50a use Racket lexer for double-quoted strings 3 years ago
Matthew Butterick ba5c6c7ab5
support for codepoint escape sequences in strings (closes #29) (#31)
This improves the lexing of escape sequences within strings that appear in a grammar. It relies on Racket’s `read` to interpret these escape sequences rather than a hard-coded hash table. This gives strings in a grammar pretty much the same semantics as standard Racket strings, including support for octal and hex escape sequences for Unicode codepoints.

Though this passes all current tests, there are still some oddball corner cases that can be discovered by sticking together certain combinations of escape sequences (backslashes, double quotes, and codepoints). The better solution would be to peek into the input port for a double quote, and if it’s there, use the standard Racket lexer to pull out the string (this lexer already handles the weirdo cases). We can’t do this, however, because brag also supports single-quoted strings, which need to have the same semantics, and the Racket lexer won’t work with those. So I think we’re stuck with the homegrown solution (for consistency with both kinds of quotes) even at the expense of a few unresolved corner cases. Let’s leave that question for another day, as these cases haven’t surfaced in practical use thus far.
3 years ago
Markus Pfeiffer 6983208426
Fix make-rule-parser (#28)
When using `make-rule-parser` for any rule that is not the start
rule, and applying the resulting parser while giving it a source-path
it would just use the entire grammar from the start rule.
3 years ago
Matthew Butterick c792b12d71 Revert "subparsers"
This reverts commit 11539991ec.
5 years ago
Matthew Butterick 6e7e8e4147 omit some setup 5 years ago
Matthew Butterick 11539991ec subparsers 5 years ago
Matthew Butterick c8e6e189b8 remove self ref 6 years ago
Matthew Butterick ab5f7b65d7
Update info.rkt 6 years ago
Matthew Butterick 149176e37b fix info 6 years ago
Matthew Butterick 095b4c2409 move 6 years ago
Matthew Butterick 69e38c9b4f separate 6 years ago