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 = stripQuotemarkLayer(sub)
|
||||||
|
sub = sub.replaceAll(quote, `\\${quote}`)
|
||||||
return `${quote}${sub}${quote}`
|
return `${quote}${sub}${quote}`
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|||||||
@@ -87,8 +87,9 @@ export class Lexer extends BehaviorSubject<LexToken> {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are either starting or ending an unescaped matching quote
|
// We are either starting or ending an unescaped matching quote.
|
||||||
if ( c === `'` || c === `"` ) {
|
// For now, only parse single quotes. Makes it nicer to type " in commands.
|
||||||
|
if ( c === `'` ) {
|
||||||
if ( c === this.inQuote ) {
|
if ( c === this.inQuote ) {
|
||||||
this.inQuote = undefined
|
this.inQuote = undefined
|
||||||
await this.emitToken('quote', true)
|
await this.emitToken('quote', true)
|
||||||
|
|||||||
Reference in New Issue
Block a user