Skip to content

Commit 1b88949

Browse files
aurcclaude
andcommitted
Fix unkeyed struct literals in lexer
- Add Name and Pattern field names to lexer.SimpleRule initialization - Improves code clarity and resolves go vet warnings - All tests passing Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 02612d1 commit 1b88949

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

internal/filter/lexer.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ const (
4141

4242
var (
4343
sqlLexer = lexer.MustSimple([]lexer.SimpleRule{
44-
{`Keyword`, `(?i)\b(MATCH|CONTAINSIC|CONTAINS|BETWEEN|AND|OR)\b`},
45-
{`Ident`, `[a-zA-Z_][a-zA-Z0-9_./]*`},
46-
{`Number`, `[-+]?\d*\.?\d+([eE][-+]?\d+)?`},
47-
{`String`, `'[^']*'|"[^"]*"`},
48-
{`Operators`, `<>|!=|<=|>=|==|[()=<>]`},
49-
{"whitespace", `\s+`},
44+
{Name: `Keyword`, Pattern: `(?i)\b(MATCH|CONTAINSIC|CONTAINS|BETWEEN|AND|OR)\b`},
45+
{Name: `Ident`, Pattern: `[a-zA-Z_][a-zA-Z0-9_./]*`},
46+
{Name: `Number`, Pattern: `[-+]?\d*\.?\d+([eE][-+]?\d+)?`},
47+
{Name: `String`, Pattern: `'[^']*'|"[^"]*"`},
48+
{Name: `Operators`, Pattern: `<>|!=|<=|>=|==|[()=<>]`},
49+
{Name: "whitespace", Pattern: `\s+`},
5050
})
5151

5252
cachedDef = make(map[string]Filter)

0 commit comments

Comments
 (0)