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

Support single-quoted strings as alias for double-quoted strings in Rhai language parser #912

Open
shah opened this issue Sep 16, 2024 · 2 comments

Comments

@shah
Copy link

shah commented Sep 16, 2024

Per our discussion in #911 there is a desire to treat single-quotes like ' the same as double-quotes like " (the same way JavaScript handles strings flexibly). This feature would allow non-technical users of scripting language to have three quotation modes - non-interpolated via " and ' and interpolated via back-tick.

@schungx
Copy link
Collaborator

schungx commented Sep 21, 2024

Yes, let me ponder whether this would be simple to add... probably so as the literal string parsing function is quite flexible.

@schungx
Copy link
Collaborator

schungx commented Sep 24, 2024

There will still be differences regarding how SQL treat strings and how C-style languages treat strings, e.g. wrt escaping etc.

And one problem is the inability to differentiate a character from a string. All characters will be one-character strings like JavaScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants