Skip to content

Commit

Permalink
Implement remaining functionality (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
macjuul authored Sep 16, 2024
1 parent 7288b02 commit 782bbc2
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions packages/lezer-surrealql/src/surrealql.grammar
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ defineUserOptions {
OnRootNsDbClause
( ( password | passhash ) String )
( roles commaSep<Ident> )
DurationClause?
}

// Alter statement
Expand Down Expand Up @@ -350,8 +351,7 @@ InsertStatement {
insert
ignore?
relation?
into
Ident
(into Ident)?
(
Object |
( "[" commaSep<Object> "]" ) |
Expand All @@ -361,10 +361,12 @@ InsertStatement {
commaSep<(
"(" commaSep<value> ")"
)>
on duplicate key update
commaSep<FieldAssignment>
)
)
(
on duplicate key update
commaSep<FieldAssignment>
)?
}

IfElseStatement {
Expand Down Expand Up @@ -610,7 +612,7 @@ ObjectProperty {
}

ObjectContent {
commaSep<ObjectProperty>
commaSepTrailing<ObjectProperty>
}

Object {
Expand Down Expand Up @@ -1011,8 +1013,12 @@ CommentClause {
String
}

DurationValue {
(for token Duration) | (for session Duration)
}

DurationClause {
duration ( for token Duration ) ","? ( for session Duration )
duration commaSep<DurationValue>
}

TokenTypeClause {
Expand Down Expand Up @@ -1226,6 +1232,10 @@ commaSep<content> {
content ("," content)*
}

commaSepTrailing<content> {
content ("," content)* ","?
}

piped<content> {
content ("|" content)*
}
Expand Down

0 comments on commit 782bbc2

Please sign in to comment.