jmespath-community / jmespath.spec

JMESPath Specification
6 stars 3 forks source link

Raw-string literals support C0 control characters. #134

Closed springcomp closed 1 year ago

springcomp commented 1 year ago

Addresses https://github.com/jmespath-community/jmespath.test/issues/14.

I suggest we should document existing support for C0 control characters in raw-string literals as per JEP-12 example.

However, I suggest we should not support C0 control charactes in the preserved-escape rule as I think that you be confusing.

springcomp commented 1 year ago

I do not find '\␊' to be invalid in the Python implementation…

import jmespath
jmespath.compile(" '\\\n' ")

… and I think `"\\\n"` (three slash characters) is an invalid json-value literal string expression.

import jmespath
jmespath.compile(' `"\\\n"` ')

Should they really all be made noncompliant?

I think we should not care too much about varying support of control characters by various implementations. Any deviation can probably be attributed to various levels of care from the implementation author(s), given that C0 control characters were probably not tested thoroughly.

springcomp commented 1 year ago

Thanks for the feedback. I'm still new to Python.

Are we aligned on this PR?

gibson042 commented 1 year ago

Yep, LGTM!