Skip to content

Commit

Permalink
Update parser and semantic analysis to 2025.02 (#356)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon authored Feb 12, 2025
1 parent 4f192bd commit 68f55d4
Show file tree
Hide file tree
Showing 5 changed files with 43,804 additions and 39,476 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-deers-type.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@neo4j-cypher/language-support': patch
---

Updates parser and semantic analysis to version 2025.02
8 changes: 8 additions & 0 deletions packages/language-support/src/antlr-grammar/Cypher25Lexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,10 @@ CURRENT
: C U R R E N T
;
CYPHER
: C Y P H E R
;
DATA
: D A T A
;
Expand Down Expand Up @@ -623,6 +627,10 @@ EXCLAMATION_MARK
: '!'
;
LANGUAGE
: L A N G U A G E
;
LBRACKET
: '['
;
Expand Down
14 changes: 10 additions & 4 deletions packages/language-support/src/antlr-grammar/Cypher25Parser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -1346,7 +1346,7 @@ showPrivilege

setPrivilege
: SET (
(passwordToken | USER (STATUS | HOME DATABASE) | DATABASE ACCESS) ON DBMS
(passwordToken | USER (STATUS | HOME DATABASE) | DATABASE ACCESS | DEFAULT LANGUAGE) ON DBMS
| LABEL labelsResource ON graphScope
| PROPERTY propertiesResource ON graphScope graphQualifier
| AUTH ON DBMS
Expand Down Expand Up @@ -1526,11 +1526,11 @@ graphScope
// Database commands

createCompositeDatabase
: COMPOSITE DATABASE databaseName (IF NOT EXISTS)? commandOptions? waitClause?
: COMPOSITE DATABASE databaseName (IF NOT EXISTS)? defaultLanguageSpecification? commandOptions? waitClause?
;

createDatabase
: DATABASE databaseName (IF NOT EXISTS)? (TOPOLOGY (primaryTopology | secondaryTopology)+)? commandOptions? waitClause?
: DATABASE databaseName (IF NOT EXISTS)? defaultLanguageSpecification? (TOPOLOGY (primaryTopology | secondaryTopology)+)? commandOptions? waitClause?
;

primaryTopology
Expand All @@ -1549,6 +1549,10 @@ secondaryToken
: SECONDARY | SECONDARIES
;

defaultLanguageSpecification
: DEFAULT LANGUAGE CYPHER UNSIGNED_DECIMAL_INTEGER
;

dropDatabase
: COMPOSITE? DATABASE symbolicAliasNameOrParameter (IF EXISTS)? aliasAction? ((DUMP | DESTROY) DATA)? waitClause?
;
Expand All @@ -1560,7 +1564,7 @@ aliasAction

alterDatabase
: DATABASE symbolicAliasNameOrParameter (IF EXISTS)? (
(SET (alterDatabaseAccess | alterDatabaseTopology | alterDatabaseOption))+
(SET (alterDatabaseAccess | alterDatabaseTopology | alterDatabaseOption | defaultLanguageSpecification))+
| (REMOVE OPTION symbolicNameString)+
) waitClause?
;
Expand Down Expand Up @@ -1801,6 +1805,7 @@ unescapedSymbolicNameString_
| CREATE
| CSV
| CURRENT
| CYPHER
| DATA
| DATABASE
| DATABASES
Expand Down Expand Up @@ -1873,6 +1878,7 @@ unescapedSymbolicNameString_
| KEY
| LABEL
| LABELS
| LANGUAGE
| LEADING
| LIMITROWS
| LIST
Expand Down
1 change: 1 addition & 0 deletions packages/language-support/src/lexerSymbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ export const lexerKeywords = [
CypherLexer.KEY,
CypherLexer.LABEL,
CypherLexer.LABELS,
CypherLexer.LANGUAGE,
CypherLexer.LEADING,
CypherLexer.LIMITROWS,
CypherLexer.LIST,
Expand Down
Loading

0 comments on commit 68f55d4

Please sign in to comment.