Switch to parse only single quotes by default + make quote command smart enough to escape captured quotemarks
This commit is contained in:
@@ -46,6 +46,7 @@ export class Quote extends Command<{ with?: StrTerm }> {
|
||||
}
|
||||
|
||||
sub = stripQuotemarkLayer(sub)
|
||||
sub = sub.replaceAll(quote, `\\${quote}`)
|
||||
return `${quote}${sub}${quote}`
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -87,8 +87,9 @@ export class Lexer extends BehaviorSubject<LexToken> {
|
||||
continue
|
||||
}
|
||||
|
||||
// We are either starting or ending an unescaped matching quote
|
||||
if ( c === `'` || c === `"` ) {
|
||||
// We are either starting or ending an unescaped matching quote.
|
||||
// For now, only parse single quotes. Makes it nicer to type " in commands.
|
||||
if ( c === `'` ) {
|
||||
if ( c === this.inQuote ) {
|
||||
this.inQuote = undefined
|
||||
await this.emitToken('quote', true)
|
||||
|
||||
Reference in New Issue
Block a user