Skip to content

Commit

Permalink
Add word boundary at beginning and end of all query language keywords…
Browse files Browse the repository at this point in the history
… in query lexer (#331)
  • Loading branch information
kkajla12 authored Jun 10, 2024
1 parent 9f7fc53 commit 6a1556a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/authz/query/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ type ast struct {
}

var participleLexer = lexer.MustSimple([]lexer.SimpleRule{
{Name: "Select", Pattern: `(?i)select`},
{Name: "Explicit", Pattern: `(?i)explicit`},
{Name: "Where", Pattern: `(?i)where`},
{Name: "Is", Pattern: `(?i)is`},
{Name: "For", Pattern: `(?i)for`},
{Name: "OfType", Pattern: `(?i)of type`},
{Name: "Select", Pattern: `(?i)\bselect\b`},
{Name: "Explicit", Pattern: `(?i)\bexplicit\b`},
{Name: "Where", Pattern: `(?i)\bwhere\b`},
{Name: "Is", Pattern: `(?i)\bis\b`},
{Name: "For", Pattern: `(?i)\bfor\b`},
{Name: "OfType", Pattern: `(?i)\bof type\b`},
{Name: "Resource", Pattern: `[a-zA-Z0-9_\-]+:[a-zA-Z0-9_\-\.@\|:]+`},
{Name: "TypeOrRelation", Pattern: `[a-zA-Z0-9_\-]+`},
{Name: "Wildcard", Pattern: `\*`},
Expand Down

0 comments on commit 6a1556a

Please sign in to comment.