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

parse $ followed by a ' inside ind_string #773

Closed
wants to merge 1 commit into from
Closed

Conversation

fkz
Copy link
Contributor

@fkz fkz commented Jan 13, 2016

Previously, e. g. ''$'' or '' $' '' would fail with 'unexpected $undefined, expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE'
This fixes #772

<IND_STRING>(\'|\$) {
char str[2] = "'";
str[0] = yytext[0];
yylval->e = new ExprIndStr(str);
return IND_STR;
}
<IND_STRING>. return yytext[0]; /* just in case: shouldn't be reached */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

funilly, there's now a warning that this rule is never matched.
This is not yet true for the STRING case, I suppose because there this rule (that shouldn't be matched) is matched when a string ends with \ or $ at the end of a file. (this is still a little 'bad' because whenever it is matched we get an error unexpected $undefined from bison)

Previously, e. g. ''$'' or '' $' '' would fail with 'unexpected , expecting IND_STR or DOLLAR_CURLY or IND_STRING_CLOSE'
This fixes NixOS#772
@fkz
Copy link
Contributor Author

fkz commented Jan 21, 2016

okay, after the desaster of the last patch: nix-env -qa goes through (as well as the tests); I also added a test case.
cc @edolstra @shlevy

@shlevy
Copy link
Member

shlevy commented Jan 22, 2016

Waiting for @edolstra as the last two got reverted.

@stale
Copy link

stale bot commented Feb 13, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 13, 2021
@stale
Copy link

stale bot commented Apr 16, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this Apr 16, 2022
zolodev pushed a commit to zolodev/nix that referenced this pull request Jan 1, 2024
* team membership list follow up

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nix lexer errors in ind_strings: $' is not parsed
4 participants