diff --git a/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 b/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 index b412a474a..98d09784d 100644 --- a/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 +++ b/src/query/frontend/opencypher/grammar/MemgraphCypher.g4 @@ -56,6 +56,7 @@ memgraphCypherKeyword : cypherKeyword | IDENTIFIED | ISOLATION | KAFKA + | LABELS | LEVEL | LOAD | LOCK @@ -254,10 +255,15 @@ privilege : CREATE | MODULE_READ | MODULE_WRITE | WEBSOCKET + | LABELS labels=labelList ; privilegeList : privilege ( ',' privilege )* ; +labelList : label ( ',' label )* ; + +label: ( '*' | StringLiteral ) ; + showPrivileges : SHOW PRIVILEGES FOR userOrRole=userOrRoleName ; showRoleForUser : SHOW ROLE FOR user=userOrRoleName ; diff --git a/src/query/frontend/opencypher/grammar/MemgraphCypherLexer.g4 b/src/query/frontend/opencypher/grammar/MemgraphCypherLexer.g4 index 55e5d53a2..a98aa8630 100644 --- a/src/query/frontend/opencypher/grammar/MemgraphCypherLexer.g4 +++ b/src/query/frontend/opencypher/grammar/MemgraphCypherLexer.g4 @@ -66,6 +66,7 @@ IDENTIFIED : I D E N T I F I E D ; IGNORE : I G N O R E ; ISOLATION : I S O L A T I O N ; KAFKA : K A F K A ; +LabelsTest : L A B E L S ; LEVEL : L E V E L ; LOAD : L O A D ; LOCK : L O C K ; diff --git a/src/query/frontend/stripped_lexer_constants.hpp b/src/query/frontend/stripped_lexer_constants.hpp index 42b7b4aeb..9e216e2c4 100644 --- a/src/query/frontend/stripped_lexer_constants.hpp +++ b/src/query/frontend/stripped_lexer_constants.hpp @@ -204,8 +204,9 @@ const trie::Trie kKeywords = {"union", "pulsar", "service_url", "version", - "websocket" - "foreach"}; + "websocket", + "foreach", + "labels"}; // Unicode codepoints that are allowed at the start of the unescaped name. const std::bitset kUnescapedNameAllowedStarts(