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

Escaping $1 #380

Open
brokenpylons opened this issue Oct 25, 2018 · 1 comment
Open

Escaping $1 #380

brokenpylons opened this issue Oct 25, 2018 · 1 comment

Comments

@brokenpylons
Copy link

I have an action with $1.replace(/['"](.+)['"]/, '$1' ). How do I escape the $1? The only solution I found is to use \u0024 instead of $, but that's a bit hacky.

@blackshadev
Copy link

I did this by defining a constant in a codeblock like shown below.

Sill pretty hacky, but I tried al sorts of escape sequences, none of them worked.

%{
var dollar = "$";
%}

... lex 

%%
rule : a + b { return dollar + "1"; }
;

GerHobbelt added a commit to GerHobbelt/jison that referenced this issue Mar 6, 2021
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

2 participants