[#410] pkg/policy: Parse strings in filter key

With UN/LOCODE support, storage node may have
`UN-LOCODE` attribute. Policy parser should support
both `Ident` and `Strings` as filter keys to parse
rules such as `FILTER "UN-LOCODE" EQ "RU LED" AS F`.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2021-02-24 17:02:50 +03:00 committed by Alex Vanin
parent 5900975d58
commit 5f800458a3
3 changed files with 26 additions and 2 deletions

View file

@ -52,7 +52,7 @@ type andChain struct {
}
type simpleExpr struct {
Key string `@Ident`
Key string `@(Ident | String)`
// We don't use literals here to improve error messages.
Op string `@Ident`
Value string `@(Ident | String | Int)`