Skip to content
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

Unable to make rule for literal backtick #8

Open
srgraham opened this issue Jun 3, 2016 · 2 comments
Open

Unable to make rule for literal backtick #8

srgraham opened this issue Jun 3, 2016 · 2 comments

Comments

@srgraham
Copy link

srgraham commented Jun 3, 2016

I get errors whenever I try to make any rule with a literal backtick. All of these throw:

backtick = "`"
backtick = '`'
backtick = "\x60"
backtick = '\x60'
backtick = "\u0060"
backtick = '\u0060'

All give this error and stack trace:

/Library/WebServer/htdocs/github/meta-coffee/lib/metacoffee/prettyfier.js:25
            throw "Translation error";
            ^
Translation error

When wrapped with single quotes, I get this special error:

Special error: SyntaxError: unexpected STRING

When wrapped with double quotes, I get this special error:

Special error: SyntaxError: missing ", starting
@duanemaxwell
Copy link

I ran into this same problem when build a metacoffee parser for LISP (actually Maru) S-expressions, where backtick is a common syntactic shortcut for creating calls to "quasiquote".

The solution appears to be to add an entry for backtick in the definition of "specials" (used to enumerate characters that require escapes in strings) in ometa-lib, in particular adding the entry

"":"\\"

to escape the character.

@xixixao
Copy link
Owner

xixixao commented May 21, 2021

@duanemaxwell PRs are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants