cannot parse words "start", "error", "atok"
#3
Closed
opened 7 years ago by rain-1
·
11 comments
Loading…
Reference in New Issue
There is no content yet.
Delete Branch '%!s(<nil>)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
.racket/6.12/pkgs/brag/brag/cfg-parser/cfg-parser.rkt:708:55: parser-non-terminals: start used as both token and non-terminal in: start
I see what you mean. This is a bug in the underlying
ragg
code (which I didn’t write) so it will take me some time to figure it out. In the meantime, you can probably work around by specifying the rule like so?Actually, that won’t work.
Here’s a better idea (this time I’m trying it before writing it). Instead of passing the raw string
"start"
(or"error"
or"atok"
) as a token, edit your lexer to package each into a named token structure, e.g.,(token 'START "start")
. Then you can change the grammar to refer to this named token:This will parse the same way, and the underlying string will end up the parse tree:
Note to self: check if this is an insurmountable restriction of the underlying
cfg-parser
function. If so, the only “fix” is to amend the docs with a list of reserved words.I was able to rehabilitate
"start"
and"atok"
as literal tokens. But according to thebr-parser-tools
docs, “A token cannot be namederror
, sinceerror
it has special use in the parser.” I’ve also updated thebrag
docs to note this.Thanks for looking into this.
I git cloned the latest and tried cd brag ; raco pkg install but I got a lot of errors. If I cd brag and do raco test . i get some files running then
brag/brag/brag.scrbl:6:21: cannot open module file module path: brag/support
failure.How should I test this latest commit?
I’m not sure a direct
git clone
will work, because this repo holds a multi-collection package. Better to useraco pkg update brag
.(BTW I can’t reproduce these errors locally, nor do they show up on Travis, which heightens my suspicion that the
git clone
technique is the problem)I tried
raco pkg update brag
but it got me the latest release from racket pkgs which seems to be before this latest git commit with the "start" fix.You can also do
raco pkg install https://github.com/mbutterick/brag.git?path=brag
if the package server isn’t going fast enoughthanks a lot that worked, I see that I can use "start" now but not "%start".
OK, fixed that