Tokenizing VariableName with escaped characters is not working #9

Closed
opened 2023-11-08 16:11:03 +01:00 by ergunsh · 2 comments
ergunsh commented 2023-11-08 16:11:03 +01:00 (Migrated from github.com)

Hey @marijnh,

Currently, tokenizing variable names with escape characters are not working properly.

This should tokenize correctly: var(--\\) as a CallExpression with VariableName that is equal to the --\\, according to the spec.

We're slowly replacing our regex based parser with CodeMirror parser but this has blocked us for moving forward with replacing how we do custom property parsing. Failing test cases are here.

WDYT, can you take a look?

Hey @marijnh, Currently, tokenizing variable names with escape characters are not working properly. This should tokenize correctly: `var(--\\)` as a CallExpression with VariableName that is equal to the `--\\`, according to the [spec](https://www.w3.org/TR/css-syntax-3/#consume-string-token). We're slowly replacing our regex based parser with CodeMirror parser but this has blocked us for moving forward with replacing how we do custom property parsing. Failing test cases are [here](https://source.chromium.org/chromium/chromium/src/+/main:third_party/devtools-frontend/src/test/unittests/front_end/core/sdk/CSSMatchedStyles_test.ts;l=26?q=cssMatchedStyles_test). WDYT, can you take a look?
marijnh commented 2023-11-09 11:12:01 +01:00 (Migrated from github.com)

Attached patch should help (tagged 1.1.4).

Attached patch should help (tagged 1.1.4).
ergunsh commented 2023-11-09 11:43:22 +01:00 (Migrated from github.com)

whoa, thanks a lot for the quick fix! :)

whoa, thanks a lot for the quick fix! :)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/css#9
No description provided.