Add drop, sort commands, start tail command; implement support for destructuredOrLines match type; misc fixes

This commit is contained in:
2026-03-02 22:20:18 -06:00
parent e5acc2e8b1
commit d5d69e58a4
10 changed files with 224 additions and 8 deletions

View File

@@ -10,6 +10,13 @@ export type LexToken = LexTerminator | LexInput
const logger = log.getStreamLogger('lexer')
const LITERAL_MAP: Record<string, string> = {
'n': '\n',
'r': '\r',
't': '\t',
's': ' ',
}
export class Lexer extends BehaviorSubject<LexToken> {
private isEscape: boolean = false
private inQuote?: '"'|"'"
@@ -49,7 +56,7 @@ export class Lexer extends BehaviorSubject<LexToken> {
// We got the 2nd character after an escape
if ( this.isEscape ) {
this.tokenAccumulator += c
this.tokenAccumulator += LITERAL_MAP[c] || c
this.isEscape = false
continue
}