Skip to content

Commit

Permalink
Add use-statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Ce11an committed Aug 25, 2024
1 parent e566dee commit 44dd4ce
Show file tree
Hide file tree
Showing 6 changed files with 60,841 additions and 60,420 deletions.
5 changes: 5 additions & 0 deletions examples/use.surql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
USE NS test; -- Switch to the 'test' Namespace

USE DB test; -- Switch to the 'test' Database

USE NS test DB test; -- Switch to the 'test' Namespace and 'test' Database
6 changes: 6 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,14 @@ module.exports = grammar({
$.insert_statement,
$.relate_statement,
$.delete_statement,
$.use_statement,
),

use_statement: $ => seq($.keyword_use, choice($.ns_clause, $.db_clause, seq($.ns_clause, $.db_clause))),

ns_clause: $ => seq($.keyword_ns, $.identifier),
db_clause: $ => seq($.keyword_db, $.identifier),

begin_statement: $ => seq($.keyword_begin, optional($.keyword_transaction)),

cancel_statement: $ =>
Expand Down
65 changes: 65 additions & 0 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

77 changes: 77 additions & 0 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 44dd4ce

Please sign in to comment.