From 9d39d47c3b7c52f452d032c4d9519100f09dd141 Mon Sep 17 00:00:00 2001 From: MrBounty Date: Sat, 26 Oct 2024 13:47:52 +0200 Subject: [PATCH] Removed some test and fixed some synthax --- src/fileEngine.zig | 27 +++++---------------------- src/main.zig | 2 ++ src/stuffs/additionalData.zig | 2 +- src/ziqlParser.zig | 1 - 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/src/fileEngine.zig b/src/fileEngine.zig index 5baade1..a859bde 100644 --- a/src/fileEngine.zig +++ b/src/fileEngine.zig @@ -1,10 +1,13 @@ const std = @import("std"); const utils = @import("stuffs/utils.zig"); +const s2t = @import("types/stringToType.zig"); +const zid = @import("ZipponData"); const Allocator = std.mem.Allocator; + +// TODO: Clean that const UUID = @import("types/uuid.zig").UUID; const DateTime = @import("types/date.zig").DateTime; const DataType = @import("types/dataType.zig").DataType; -const s2t = @import("types/stringToType.zig"); const FileTokenizer = @import("tokenizers/file.zig").Tokenizer; const FileToken = @import("tokenizers/file.zig").Token; const SchemaStruct = @import("schemaParser.zig").Parser.SchemaStruct; @@ -98,6 +101,7 @@ pub const FileEngine = struct { }; // --------------------Logs-------------------- + // Make a lib out of it I think, like ZipponData, a ZipponLog const Level = enum { Debug, @@ -1188,24 +1192,3 @@ pub const FileEngine = struct { return ((count == all_struct_member.len) and (count == map.count())); } }; - -test "Get list of UUID using condition" { - const TEST_DATA_DIR = @import("config.zig").TEST_DATA_DIR; - const allocator = std.testing.allocator; - - const path = try allocator.dupe(u8, TEST_DATA_DIR); - var file_engine = FileEngine.init(allocator, path); - defer file_engine.deinit(); - - var uuid_array = std.ArrayList(UUID).init(allocator); - defer uuid_array.deinit(); - - const condition = FileEngine.Condition{ .struct_name = "User", .member_name = "email", .value = "adrien@mail.com", .operation = .equal, .data_type = .str }; - try file_engine.getUUIDListUsingCondition(condition, &uuid_array); -} - -// FIXME: -// You were adding proper error to the file engine and implement the date. -// Next step is trying build until all error are gone -// -// Next step also is to implement date to the schema parser and also add that only parser Error are allow diff --git a/src/main.zig b/src/main.zig index 48bbf61..92dd767 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,5 +1,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; + +// TODO: Clean that const FileEngine = @import("fileEngine.zig").FileEngine; const cliTokenizer = @import("tokenizers/cli.zig").Tokenizer; const cliToken = @import("tokenizers/cli.zig").Token; diff --git a/src/stuffs/additionalData.zig b/src/stuffs/additionalData.zig index 28ced75..1403d7a 100644 --- a/src/stuffs/additionalData.zig +++ b/src/stuffs/additionalData.zig @@ -2,7 +2,7 @@ const std = @import("std"); const Allocator = std.mem.Allocator; /// This is the [] part -/// IDK if saving it into the Parser struct is a good idea +/// TODO: Include the part ".friends.comments" in "GRAB User.firends.comments {age > 10}" pub const AdditionalData = struct { entity_count_to_find: usize = 0, member_to_find: std.ArrayList(AdditionalDataMember), diff --git a/src/ziqlParser.zig b/src/ziqlParser.zig index ca2886a..dfdaf62 100644 --- a/src/ziqlParser.zig +++ b/src/ziqlParser.zig @@ -613,7 +613,6 @@ pub const Parser = struct { }; // Check if the condition is valid - // TODO: Mqke q function outside the Parser switch (condition.operation) { .equal => switch (condition.data_type) { .int, .float, .str, .bool, .link, .date, .time, .datetime => {},