-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dobule pipes in language not rendered #73
Comments
Opening this Issue revealed a fundamental misunderstanding of Racket's syntax when it comes to pipes ( See the corrected snippet, with escapes on every #lang racket
(require redex)
(define-language pipe
[operator ::= \| \|\| \|\|\|])
(module+ test
(test-equal (redex-match? pipe operator (term \|)) #t)
(test-equal (redex-match? pipe operator (term \|\|)) #t)
(test-equal (redex-match? pipe operator (term \|\|\|)) #t))
(render-language pipe) Now the typeset version is what I wanted: If someone wants to explain what |
Glad you got this sorted out! |
In Racket, Because identifiers are scoped symbols, and any string can be turned to a symbol -- even
I guess For the official explanation, search for "|" in the docs: link |
@bennn: Thank you for the explanation. I understand what is going on, now. I didn't know I could search for punctuation on Racket documentation. In all other search engines that I used, it doesn't work, so I just never thought of trying. Racket keeps impressing me! 👍 |
EDIT: I figured my mistake. See post below.
Minimal working example
Expected behavior
The typeset version of the grammar should include the double pipes in
||
and|||
.Current behavior
The typeset version of the grammar omits double pipes.
Caveat
Granted, having pipes on the grammar confuses things, since pipes are already used as
or
in BNF notation. But I'm fine with the font alone distinguishing between BNF operator and language terminal—this lets me stay closer to the language I'm modeling, in which||
is an operator.Can you please confirm that my proposal is indeed expected behavior? If so, can you please help me fix it?
Thanks a lot!
The text was updated successfully, but these errors were encountered: