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

Escaped quotes in string literal are not unescaped #2672

Closed
thexa4 opened this issue Feb 19, 2020 · 1 comment · Fixed by #2673
Closed

Escaped quotes in string literal are not unescaped #2672

thexa4 opened this issue Feb 19, 2020 · 1 comment · Fixed by #2673

Comments

@thexa4
Copy link
Contributor

thexa4 commented Feb 19, 2020

The syntax allows using quotes in a string by prepending it by another quote: https://github.com/KSP-KOS/KOS/blob/develop/src/kOS.Safe/Compilation/KS/kRISC.tpg#L91

This works during parsing but when you try to print the following string: "foo""bar" it will show foo""bar instead of foo"bar.

Is this expected behavior?

@Dunbaratu
Copy link
Member

I had no idea the regex for strings was allowing that formation. It looks like it was lifted directly from some other language's string definition, especially with the option for a preceding "@" like C# uses. (That part of the system pre-dates me and I don't think I ever had a call to edit the regex for strings since then, so I never scrutinized that regex that closely.)

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

Successfully merging a pull request may close this issue.

2 participants