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

raw-string-char grammar rule does not allow control characters #16

Closed
springcomp opened this issue Nov 8, 2022 · 1 comment
Closed

Comments

@springcomp
Copy link
Contributor

springcomp commented Nov 8, 2022

Migrated from #14.

The following compliance tests illustrated using control characters, such as line feed in raw-string literals.

{
"expression": "'newline\n'",
"result": "newline\n"
},
{
"expression": "'\n'",
"result": "\n"
},

Text Expression ABNF Expressed as JSON Result
newline␊ `` 'newline\n' ```` "'newline" %x0A "'" `` '\n' "\n"
'\n' "'" %x0A "'" '\n' "newline\n"

However, those expressions are not valid as per the raw-string-char grammar rule:

raw-string        = "'" *raw-string-char "'" 
raw-string-char   = (%x20-26 / %x28-5B / %x5D-10FFFF) / preserved-escape / raw-string-escape 
preserved-escape  = escape (%x20-26 / %x28-5B / %x5D-10FFFF) 
raw-string-escape = escape ("'" / escape)

Please consider refactoring the compliance tests to forbid the use of C0 control characters in JMESPath expressions, as it Seems that was never the intended spirit when introduced in JEP-12.

Note: this will break non-conforming implementations.

@springcomp
Copy link
Contributor Author

We decided to allow C0 control characters in raw-string literals after all.

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

No branches or pull requests

1 participant