From e2774a2ca2d58d4dd507b210d4a62a23a538e833 Mon Sep 17 00:00:00 2001 From: Charlie Stanton Date: Thu, 20 Apr 2023 12:05:39 +0100 Subject: Adds a substitute path command: S --- main/lex.go | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'main/lex.go') diff --git a/main/lex.go b/main/lex.go index e93e42a..2826b1e 100644 --- a/main/lex.go +++ b/main/lex.go @@ -113,39 +113,10 @@ type TokenType int const ( TokenErr TokenType = iota // Lexing error TokenEOF // end of file - TokenLParen // ( - TokenRParen // ) TokenLBrace // { TokenRBrace // } - TokenLBrack // [ - TokenRBrack // ] TokenCommand // A command character - TokenHash // # - TokenAt // @ - TokenDot // . - TokenAst // * - TokenBar // | - TokenOr // || - TokenAnd // && - TokenHat // ^ - TokenDollar // $ - TokenQuestion // ? - TokenHatDollar // ^$ - TokenExclamation // ! - TokenTilde // ~ - TokenDoubleQuote // " - TokenStringLiteral // A string literal, not including the " either side - TokenNullLiteral // null - TokenTrueLiteral // true - TokenFalseLiteral // false - TokenColon // : - TokenComma // , TokenSubstituteDelimiter // usually / but could be something else - TokenSubstitutePlaceholder // \1, \2 etc. - TokenTerminalLiteral // One of {, }, [, ] - TokenNumberLiteral // A number literal - TokenPatternStringIndex // A string index in a pattern - TokenPatternIntegerIndex // An integer index in a pattern TokenSubex // A subex ) @@ -208,7 +179,7 @@ func lexCommand(l *lexer) stateFunc { case '}': l.emit(TokenRBrace) return lexCommand - case 's': + case 's', 'S': l.emit(TokenCommand) return lexSubstitution } -- cgit v1.2.3