Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions helix-db/src/grammar.pest
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ field_defs = { (field_def ~ ",")* ~ (field_def ~ ","?)? }
field_def = { index? ~ identifier ~ ":" ~ param_type ~ (default)? }
index= { "INDEX" }
default = { "DEFAULT" ~ (now | float | integer | boolean | string_literal | none) }
// optional = { "OPTIONAL" }
properties = { "Properties" ~ ":" ~ "{" ~ field_defs? ~ "}" }
properties = { "Properties" ~ optional_param? ~ ":" ~ "{" ~ field_defs? ~ "}" }
schema_version = { "schema::" ~ integer }

// ---------------------------------------------------------------------
Expand Down Expand Up @@ -231,11 +230,18 @@ mapping_field = { (identifier ~ (":" ~ (anonymous_traversal | evaluates_to_anyth
// ---------------------------------------------------------------------
built_in_macro = { mcp_macro | model_macro }
mcp_macro = { "#[mcp]" }

model_macro = { "#[" ~ "model" ~ "(" ~ model_name ~ ")" ~ "]" }
model_name = { identifier | string_literal }


// ---------------------------------------------------------------------
// Match steps
// ---------------------------------------------------------------------
match_step = { "MATCH" ~ match_variable? ~ "{" ~ match_statements ~ "}" }
match_variable = { "|" ~ (identifier | traversal | "_") ~ "|" }
match_statements = { (match_statement ~ ",")* ~ match_statement ~ ","? }
match_statement = { match_type ~ "=>" ~ match_value }
match_type = { identifier_upper ~ "::" ~ identifier_upper ~ ("(" ~ identifier ~ ")")?}
match_value = { "{" ~ query_body ~ "}" | traversal | id_traversal | anonymous_traversal | none | identifier }

// ---------------------------------------------------------------------
// Types
Expand Down Expand Up @@ -267,4 +273,3 @@ now = { "NOW" }
// ---------------------------------------------------------------------
WHITESPACE = _{ " " | "\t" | "\n" | "\r" }
COMMENT = _{ "//" ~ (!"\n" ~ ANY)* }

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use heed3::PutFlags;

use crate::{
helix_engine::{
traversal_core::{traversal_iter::RwTraversalIterator, traversal_value::TraversalValue},
Expand Down
2 changes: 1 addition & 1 deletion hql-tests/tests/adding_chunk_to_memory/schema.hx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// User node - represents users of the memory system with email indexing
N::User {
email: String,
email?: String,
name: String,
created_at: String,
updated_at: String,
Expand Down
Loading