-
Notifications
You must be signed in to change notification settings - Fork 743
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
improved escaping sequences for indented strings in nix lexer #926
improved escaping sequences for indented strings in nix lexer #926
Conversation
…ented/indented_string/
First rouge is missing antiquotes escaping: ''${hello} should not terminate the string Then, indented strings can be escaped as using triple single quote: ''' should not terminate the string Indented strings also have different set of escape sequences. \n is not a line feed and should not be highligted as an escape ''\n is a line feed, it should not terminate the string (pygments doesn't seem to know that) ''\q will evaluate to just 'q', it should not terminate the string (both nix-mode and pygments don't seem to know that) There is also a passage in nix manual saying: "$ removes any special meaning from the following $" I'm still not sure what it supposed to mean.
* use fancier example for antiquotation * "${x}" is not escaped actually * modernize configureFlags example * showcase escaping in indented string
This looks very accurate, but the lexer still seems not to know that |
@orivej This is an odd one. Thanks! Not clear what purpose it serves in nixlang. Probably someone can hit it in the case when |
It is a quirk of Nix parser that was never fixed, but now Nixpkgs rely on it in several places. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve pending response on previous question. If we don't need to account for the issue mentioned in comments then we're good to go.
I think this is good to go. Not sure what changes are requested. |
Thanks @veprbl. You were just too fast in replying. I came back and did some categorization of PRs via labels and so the label came after your reply. Nothing else needed here. Thanks a lot for the contribution. |
Fixes: #924