Skip to content

Commit

Permalink
Allow - in event query (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
codchen authored Aug 15, 2024
1 parent 784a8e0 commit 96d05f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/pubsub/query/syntax/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func (s *Scanner) invalid(ch rune) error {
func isDigit(r rune) bool { return '0' <= r && r <= '9' }

func isTagRune(r rune) bool {
return r == '.' || r == '_' || unicode.IsLetter(r) || unicode.IsDigit(r)
return r == '.' || r == '_' || r == '-' || unicode.IsLetter(r) || unicode.IsDigit(r)
}

func isTimeRune(r rune) bool {
Expand Down
3 changes: 2 additions & 1 deletion internal/pubsub/query/syntax/syntax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ func TestScannerErrors(t *testing.T) {
input string
}{
{`'incomplete string`},
{`-23`},
{`&`},
{`DATE xyz-pdq`},
{`DATE xyzp-dq-zv`},
Expand Down Expand Up @@ -169,6 +168,8 @@ func TestParseValid(t *testing.T) {

{"hash='136E18F7E4C348B780CF873A0BF43922E5BAFA63'", true},
{"hash=136E18F7E4C348B780CF873A0BF43922E5BAFA63", false},

{"wasm-buy_now.collection_address='sei1y4ktds0hrkrwx86pmdpvy0nxxlycqzdhg5mh9vpsk4ra8f5sjxvsfkpzmu27'", true},
}

for _, test := range tests {
Expand Down

0 comments on commit 96d05f0

Please sign in to comment.