Skip to content

Commit

Permalink
Add let_statement (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ce11an authored Aug 25, 2024
1 parent f9fd676 commit 9b34175
Show file tree
Hide file tree
Showing 7 changed files with 62,086 additions and 61,509 deletions.
13 changes: 13 additions & 0 deletions examples/let.surql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
-- Basic Parameter Assignment

-- Define the parameter
LET $name = "tobie";
-- Use the parameter
CREATE person SET name = $name;

-- Storing Query Results
-- Define the parameter
LET $adults = (SELECT * FROM person WHERE age > 18);
-- Use the parameter
UPDATE $adults SET adult = true;

3 changes: 3 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,11 @@ module.exports = grammar({
$.delete_statement,
$.use_statement,
$.info_statement,
$.let_statement,
),

let_statement: $ => seq($.keyword_let, $.variable_name, "=", $.value),

info_statement: $ => seq($.keyword_info, $.keyword_for, $.info_target),

info_target: $ =>
Expand Down
1 change: 0 additions & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -222,4 +222,3 @@
(graph_path) @operator

; Errors
(ERROR) @error
25 changes: 25 additions & 0 deletions src/grammar.json

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

31 changes: 31 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 9b34175

Please sign in to comment.