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

[bash] issue while escaping quote #2255

Closed
braoult opened this issue Mar 21, 2020 · 0 comments · Fixed by #2256
Closed

[bash] issue while escaping quote #2255

braoult opened this issue Mar 21, 2020 · 0 comments · Fixed by #2256

Comments

@braoult
Copy link

braoult commented Mar 21, 2020

  • Prism version: 1.19
  • Environment: Firefox 74.0, XUbuntu 19.10.

Prism looks "lost" with Bash code having this syntax :

printf -v aval "%d" \'a                   # 'a' ascii value
printf -v zval "%d" \'z                   # 'z' ascii value

It looks like it considers the first quote in comment to be the end of a string, the string start being the escaped quote. What is most disturbing is that all lines following these lines are wrongly colorized, as we can see on:
https://exercism.io/my/solutions/7a25d82ea512403280f7fd168040eefb?iteration_idx=1, where colors are all wrong after line 56.

Workaround 1: The following works with prism (no single quote in comment) :

printf -v aval "%d" \'a                  # "a" ascii value
printf -v zval "%d" \'z                  # "z" ascii value

Workaround 2: using double quotes instead of escaping with backslash :

printf -v aval "%d" "'a"                # 'a' ascii value
printf -v zval "%d" "'z"                # 'z' ascii value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants