Skip to content

Commit ac639f4

Browse files
authored
impr (hql): parser refactor, nested for loop type checking, tidying repo (#428)
## Description <!-- Provide a brief description of the changes in this PR --> ## Related Issues <!-- Link to any related issues using #issue_number --> Closes # ## Checklist when merging to main <!-- Mark items with "x" when completed --> - [ ] No compiler warnings (if applicable) - [ ] Code is formatted with `rustfmt` - [ ] No useless or dead code (if applicable) - [ ] Code is easy to understand - [ ] Doc comments are used for all functions, enums, structs, and fields (where appropriate) - [ ] All tests pass - [ ] Performance has not regressed (assuming change was not to fix a bug) - [ ] Version number has been updated in `helix-cli/Cargo.toml` and `helixdb/Cargo.toml` ## Additional Notes <!-- Add any additional information that would be helpful for reviewers -->
2 parents 3d87c58 + a2cb3a1 commit ac639f4

File tree

89 files changed

+4961
-4931
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+4961
-4931
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div align="center">
22

33
<picture>
4-
<img src="/docs/full_logo.png" alt="HelixDB Logo">
4+
<img src="/assets/full_logo.png" alt="HelixDB Logo">
55
</picture>
66

77
<b>HelixDB</b>: a database built from scratch to be the storage backend for any AI application.
File renamed without changes.
File renamed without changes.

helix-cli/src/utils.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@ use futures_util::StreamExt;
77
use helix_db::{
88
helix_engine::traversal_core::config::Config,
99
helixc::{
10-
analyzer::analyzer::analyze,
10+
analyzer::analyze,
1111
generator::{Source as GeneratedSource, tsdisplay::ToTypeScript},
12-
parser::helix_parser::{Content, HelixParser, HxFile, Source},
12+
parser::{
13+
HelixParser,
14+
types::{Content, HxFile, Source},
15+
},
1316
},
1417
utils::styled_string::StyledString,
1518
};
@@ -956,12 +959,7 @@ pub fn copy_repo_dir_for_build(src: &std::path::Path, dst: &std::path::Path) ->
956959
if let Some(file_name) = entry.file_name().to_str()
957960
&& matches!(
958961
file_name,
959-
".git"
960-
| ".gitignore"
961-
| ".github"
962-
| ".DS_Store"
963-
| "target"
964-
| "docs"
962+
".git" | ".gitignore" | ".github" | ".DS_Store" | "target" | "docs"
965963
)
966964
{
967965
continue;

helix-db/mod.rs

Lines changed: 0 additions & 2 deletions
This file was deleted.

helix-db/src/grammar.pest

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ traversal = { (start_node | start_edge | search_vector | start_vector)
6363
id_traversal = { identifier ~ ((step+ ~ last_step?) | last_step) }
6464
anonymous_traversal = { "_" ~ ((step+ ~ last_step?) | last_step)? }
6565
step = { "::" ~ (graph_step | order_by | where_step | closure_step | object_step | exclude_field | count | ID | range_step | AddE) }
66-
last_step = { "::" ~ (bool_operations | update) }
66+
last_step = { "::" ~ (bool_operations | update | first) }
6767
// change this for loop to be able to take traversals etc in the future.
6868
for_loop = { "FOR" ~ for_argument ~ "IN" ~ identifier ~ "{" ~ query_body ~ "}" }
6969
for_argument = { object_access | object_destructuring | identifier }
@@ -194,6 +194,7 @@ ID = { "ID" }
194194
update_field = { identifier ~ ":" ~ (evaluates_to_anything | anonymous_traversal) }
195195
update = { "UPDATE" ~ "(" ~ "{" ~ update_field ~ ("," ~ update_field)* ~ "}" ~ ")" }
196196
drop = { "DROP" ~ evaluates_to_anything }
197+
first = { "FIRST" }
197198

198199
// ---------------------------------------------------------------------
199200
// Vector steps

helix-db/src/helix_engine/README.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

helix-db/src/helix_engine/bm25/README.md

Lines changed: 0 additions & 150 deletions
This file was deleted.

helix-db/src/helix_engine/bm25/bm25.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ impl BM25Flatten for HashMap<String, Value> {
431431
.fold(String::with_capacity(self.len() * 4), |mut s, (k, v)| {
432432
s.push_str(k);
433433
s.push(' ');
434-
s.push_str(&v.to_string());
434+
s.push_str(&v.inner_stringify());
435435
s.push(' ');
436436
s
437437
})

helix-db/src/helix_engine/macros.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,6 @@ pub mod macros {
178178
#[macro_export]
179179
macro_rules! traversal_remapping {
180180
($remapping_vals:expr, $var_name:expr, $should_spread:expr, $new_name:expr => $traversal:expr) => {{
181-
// TODO: ref?
182-
// Apply remappings to the nested traversal result
183-
184181
let nested_return_value = ReturnValue::from_traversal_value_array_with_mixin(
185182
$traversal,
186183
$remapping_vals.borrow_mut(),

0 commit comments

Comments
 (0)