Fix shell heredoc token #14

Merged
Slokilla merged 1 commit from fixHereDocToken into main 2023-07-07 14:22:25 +02:00
Slokilla commented 2023-07-07 11:02:33 +02:00 (Migrated from github.com)

A heredoc token cannot contains whitespaces. If we don't add this rule, we will have a wrong coloration when the heredoc is, for example, piped into a second command.

cat << EOF |
foo
EOF
bar

on the main branch, bar will be colorized like the heredoc. With the correction, it will have the correct color.

The correction is not perfect as the pipe shouldn't be colorized like the heredoc, but it's a first step.

A heredoc token cannot contains whitespaces. If we don't add this rule, we will have a wrong coloration when the heredoc is, for example, piped into a second command. ``` cat << EOF | foo EOF bar ``` on the main branch, `bar` will be colorized like the heredoc. With the correction, it will have the correct color. The correction is not perfect as the pipe shouldn't be colorized like the heredoc, but it's a first step.
marijnh commented 2023-07-07 11:21:22 +02:00 (Migrated from github.com)

That regexp seems be written to also allow quoted tokens. I'd assume those can contain whitespace?

That regexp seems be written to also allow quoted tokens. I'd assume those *can* contain whitespace?
Slokilla commented 2023-07-07 11:43:01 +02:00 (Migrated from github.com)

Ok, fixing it ASAP

Ok, fixing it ASAP
Slokilla commented 2023-07-07 14:15:45 +02:00 (Migrated from github.com)

Is it better @marijnh ?

Is it better @marijnh ?
marijnh commented 2023-07-07 14:22:03 +02:00 (Migrated from github.com)

Yes, looks good now.

Yes, looks good now.
Sign in to join this conversation.
No reviewers
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
codemirror/legacy-modes!14
No description provided.