Commit Graph

161 Commits (fc61543f29635b324e80170c6589406352bdff3e)
 

Author SHA1 Message Date
Jack Firth fc61543f29 Make a grammar struct
The grammar class delegates to it for now. Eventually I'll remove the class.
3 years ago
Jack Firth c588b40a23 Fix indentation 3 years ago
Jack Firth bd8fd280f6 Fix deps 3 years ago
Jack Firth 39505951ea Reorganize imports and exports of `grammar.rkt` 3 years ago
Jack Firth b5d3b102f8 Delete the yacc conversion code
I don't have any intention of using or maintaining this.
3 years ago
Jack Firth 9d48ab7152 Run `resyntax` over everything 3 years ago
Jack Firth e18a3399fe Add new token API
Eventually this will replace the other ones, hopefully.
3 years ago
Jack Firth d33149d20b Use `syntax-parse` in `support.rkt` 3 years ago
Jack Firth a20f1b5a32 Get rid of `#:inspector` declarations
Mutable structs instead use the default (current inspector instead of a new child inspector) and immutable structs instead are transparent.
3 years ago
Jack Firth 9c78ffcc05 Use `struct` instead of `define-struct` 3 years ago
Jack Firth 121c26450e Fix more module imports 3 years ago
Jack Firth d7e5b10fe0 Use `convert-compile-time-error` in error tests 3 years ago
Jack Firth 1a2df4295e
Merge pull request #1 from jackfirth/fork
Fork brag into a new package called `yaragg`.
3 years ago
Jack Firth dbebeb54d8 Remove runtime dependency on rackunit 3 years ago
Jack Firth e7415fc690 Use test submodules for yaragg lang tests 3 years ago
Jack Firth 5a90bb6551 Only bother testing stable version 3 years ago
Jack Firth 909092f41e Use racket modules instead of scheme modules
Also remove some unnecessary imports.
3 years ago
Jack Firth ede85ad60b Fix parse error tests
They were broken because changing the language name from `brag` to `yaragg` changed the source positions of some error messages.
3 years ago
Jack Firth 2786491af1 Remove unnecessary dependencies 3 years ago
Jack Firth 275032d6c1 Remove unnecessary `compile-omit-paths` info 3 years ago
Jack Firth bbbd2fb9b1 Fix scribblings info 3 years ago
Jack Firth 691a084232 Fix some module name changes 3 years ago
Jack Firth 457d29471c Consolidate into one package 3 years ago
Jack Firth 6c0930207f Move `yaragg-parser-tools` collection to `yaragg/parser-tools` 3 years ago
Jack Firth aa5a5ab533 Fix incorrect module name 3 years ago
Jack Firth d08127cef1 Fix CI config 3 years ago
Jack Firth 6c73ec6f13 More renaming 3 years ago
Jack Firth 386052ac68 Rename project to `yaragg`. 3 years ago
Jack Firth 36306b57d4 Fix CI badge link 3 years ago
Jack Firth 8feed88328 Use collection-based module paths in parser-tools 3 years ago
Jack Firth add6832116 Update CI config 3 years ago
Jack Firth db7fa0e156 Copy parser tools packages into this repo 3 years ago
Jack Firth ab8a7437a9 Use collection-based module paths 3 years ago
Jack Firth 574fe215ea Remove reader dependency on enclosing module 3 years ago
Matthew Flatt f52c2a80c9
update pkg dependencies to list syntax-color-lib (#33) 3 years ago
Matthew Butterick 81f4fd25e7
lex double-quoted strings with Racket lexer (#32)
Follow up on an idea in #31: use the Racket lexer to lex double-quoted strings in a grammar, thereby giving them all the semantics of Racket strings, and preventing any corner cases. This solution can’t be extended to single-quoted strings, however, because even with readtable tomfoolery to recognize a single quote as an opening delimiter for a string, the string still needs to be closed with a double quote. (I don’t know why this should be so, but it is the documented behavior.) Therefore single-quoted strings still are subject to the homegrown lexing solution and the flaws therein. Still, I don’t see that single-quoted strings have ever been a documented feature of brag (or its predecessor ragg). Perhaps they could be dropped altogether. For now, this solution is satisfying, because double-quoted strings are the dominant notation, and this PR will make them as good as they can be.
3 years ago
Matthew Butterick 168c027031 enlarge test matrix with Racket 8 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
D. Ben Knoble 92b7dcc067
scribble: fix indentation in file examples (#27)
I copied in the actual file contents. It would perhaps be safest to do
some sort of "read the file and splice the contents in," but I'm not
sure how to do that at the moment.
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 d3405dd0ab
Update README.md 4 years ago
Matthew Butterick 243f32a7bb refine docs for `from/stop-before`
Only works with literal tokens, not arbitrary patterns, due to underlying limitations on `complement` pattern matcher
4 years ago
Matthew Butterick 6c161ae31d switch Travis for GH actions 4 years ago
Matthew Butterick 8814be702b force trusty for testing 5 years ago
Matthew Butterick 36f2aa56e5
Update SUBLICENSE.md 5 years ago
Matthew Butterick a7714affa6
Update README.md 5 years ago
Matthew Butterick 7880af4d6f switch to MIT license 5 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