Skip to content

Add Shell, Python and JavaScript highlighting#795

Merged
lhecker merged 3 commits intomainfrom
dev/lhecker/js-py-sh
Apr 7, 2026
Merged

Add Shell, Python and JavaScript highlighting#795
lhecker merged 3 commits intomainfrom
dev/lhecker/js-py-sh

Conversation

@lhecker
Copy link
Copy Markdown
Member

@lhecker lhecker commented Apr 7, 2026

} else if /'/ {
until /$/ {
yield string;
if /\\./ {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No escapes in single quoted strings, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Single and double quoted strings in JS are actually equivalent.

} else if /(?:true|false|null|undefined|NaN|Infinity)\>/ {
yield constant.language;
} else if /(?i:-?(?:0x[\da-fA-F_]+|0b[01_]+|0o[0-7_]+|[\d_]+\.?[\d_]*|\.[\d_]+)(?:e[+-]?[\d_]+)?)n?/ {
if /\w+/ {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argues for lsh to support an unless keyword

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. 🥲

} else if /'/ {
until /$/ {
yield string;
if /\\./ {}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should audit all of these for whether they should support escapes in single quotes

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To my knowledge (and testing) they are all correct.

@lhecker lhecker merged commit 6468920 into main Apr 7, 2026
6 checks passed
@lhecker lhecker deleted the dev/lhecker/js-py-sh branch April 7, 2026 21:26
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

Successfully merging this pull request may close these issues.

3 participants