Skip to content

lsh: fix strings in PowerShell#790

Merged
DHowett merged 7 commits intomainfrom
dev/duhowett/lsh-powershell-2
Mar 31, 2026
Merged

lsh: fix strings in PowerShell#790
DHowett merged 7 commits intomainfrom
dev/duhowett/lsh-powershell-2

Conversation

@DHowett
Copy link
Copy Markdown
Member

@DHowett DHowett commented Mar 31, 2026

  • herestring terminators must be at start of line
  • ` is the escape character for strings in this language
  • single quoted strings do not get escapes at all

DHowett added 3 commits March 31, 2026 15:57
- herestring openers must be at EOL, closers must be at BOL
- ` is the escape character for strings in this language
- single quoted strings do not get escapes at all
@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Mar 31, 2026

image

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Mar 31, 2026

Edit currently styles invalid the same as other. We can figure out the visual treatment later.

This is too "loud" inside the editor IMO.

image

but maybe a red underline is called-for?

@DHowett
Copy link
Copy Markdown
Member Author

DHowett commented Mar 31, 2026

I have some "as yet not finished" work to make the legal escape characters parse as a slightly different token, because there are only like 9 of them and other highlighters show them differently too.

} else if /"/ {
loop {
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.

Ah, woops lol

@DHowett DHowett changed the title lsh: make a few more tweaks to PowerShell lsh: fix strings in PowerShell Mar 31, 2026
await input;
}
} else if /@"/ {
} else if /@'\s*$/ {
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.

this avoids marking invalid ones as invalid, but it does still reject them.

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.

(it falls through to the normal string case later, which gobbles until it gets a ')

@DHowett DHowett merged commit 35b863f into main Mar 31, 2026
6 checks passed
@DHowett DHowett deleted the dev/duhowett/lsh-powershell-2 branch March 31, 2026 23:25
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.

2 participants