Some typo

This commit is contained in:
Adrien Bouvais 2024-12-29 10:19:04 +01:00
parent b2dd6fe627
commit 2e2dae3df1
4 changed files with 2 additions and 8 deletions

View File

@ -123,7 +123,7 @@ pub const EntityWriter = struct {
} else {
writer.writeAll(input[pattern_start - 3 .. pattern_end + 3]) catch return ZipponError.WriteError;
}
start = pattern_end;
start = pattern_end + 5;
}
// Write any remaining text

View File

@ -460,8 +460,6 @@ pub const FileEngine = struct {
// Here I take the JSON string and I parse it to find all {|<>|} and add them to the relation map with an empty JsonString
for (relation_maps) |*relation_map| try relation_map.populate(buff.items);
if (relation_maps.len > 0) std.debug.print("{d} {d}\n", .{ relation_maps.len, relation_maps[0].map.count() });
// I then call parseEntitiesRelationMap on each
// This will update the buff items to be the same Json but with {|<[16]u8>|} replaced with the right Json
for (relation_maps) |*relation_map| try self.parseEntitiesRelationMap(struct_name, relation_map, &buff);

View File

@ -47,8 +47,6 @@ pub const RelationMap = struct {
while (input[member_start] != ' ') : (member_start -= 1) {}
member_start += 1;
std.debug.print("MEMBER: {c} - {s}\n", .{ input[pattern_start - 4], input[member_start..member_end] });
if (!std.mem.eql(u8, input[member_start..member_end], self.member_name)) continue;
if (input[pattern_start - 4] == '[') {

View File

@ -1073,7 +1073,7 @@ test "ADD" {
try testParsing("ADD User (name = 'Bob', email='bob@email.com', age=-55, scores=[ 33 ], best_friend=none, friends=none, bday=2000/01/04, a_time=12:04:54.8741, last_order=2000/01/01-12:45)");
try testParsing("ADD User (name = 'Boba', email='boba@email.com', age=20, scores=[ ], best_friend=none, friends=none, bday=2000/06/06, a_time=04:04:54.8741, last_order=2000/01/01-12:45)");
try testParsing("ADD User (name = 'Bob', email='bob@email.com', age=-55, scores=[ 1 ], best_friend=none, friends=none, bday=2000/01/01, a_time=12:04:54.8741, last_order=2000/01/01-12:45)");
try testParsing("ADD User (name = 'Bob', email='bob@email.com', age=-55, scores=[ 1 ], best_friend={name='Bob'}, friends=none, bday=2000/01/01, a_time=12:04:54.8741, last_order=2000/01/01-12:45)");
try testParsing("ADD User (name = 'Bou', email='bob@email.com', age=66, scores=[ 1 ], best_friend={name = 'Boba'}, friends={name = 'Bob'}, bday=2000/01/01, a_time=02:04:54.8741, last_order=2000/01/01-12:45)");
try testParsing("ADD User (name = 'Bobibou', email='bob@email.com', age=66, scores=[ 1 ], best_friend={name = 'Boba'}, friends=[1]{name = 'Bob'}, bday=2000/01/01, a_time=02:04:54.8741, last_order=2000/01/01-12:45)");
@ -1122,13 +1122,11 @@ test "UPDATE relationship" {
try testParsing("GRAB User {}");
}
// WORKING!!!!
test "GRAB Relationship Filter" {
try testParsing("GRAB User {best_friend IN {name = 'Bob'}}");
try testParsing("GRAB User {best_friend IN {name = 'Boba'}}");
}
// Make work
test "GRAB Relationship AdditionalData" {
try testParsing("GRAB User [name, friends] {}");
try testParsing("GRAB User [name, best_friend] {}");