Removed last trace of null

This commit is contained in:
Adrien Bouvais 2024-11-04 22:57:19 +01:00
parent 280b3b3c3a
commit 96e77a5ad4
4 changed files with 5 additions and 9 deletions

View File

@ -1,7 +1,7 @@
pub const BUFFER_SIZE = 1024 * 64 * 64; // Line limit when parsing file and other buffers
pub const MAX_FILE_SIZE = 5e+6; // 5Mb
pub const CSV_DELIMITER = ';'; // TODO: Delete
pub const CPU_CORE = 6;
pub const CPU_CORE = 16;
// Testing
pub const TEST_DATA_DIR = "data"; // Maybe put that directly in the build

View File

@ -1,6 +1,7 @@
// TODO: Only use a single and big ZipponError
pub const ZiQlParserError = error{
MemoryError,
SynthaxError,
MemberNotFound,
MemberMissing,

View File

@ -12,7 +12,6 @@ pub const Token = struct {
.{ "DELETE", .keyword_delete },
.{ "ADD", .keyword_add },
.{ "IN", .keyword_in },
.{ "null", .keyword_null },
.{ "true", .bool_literal_true },
.{ "false", .bool_literal_false },
.{ "AND", .keyword_and },
@ -33,7 +32,6 @@ pub const Token = struct {
keyword_delete,
keyword_add,
keyword_in,
keyword_null,
keyword_and,
keyword_or,
keyword_to,

View File

@ -904,7 +904,7 @@ pub const Parser = struct {
}
token = try self.checkTokensInArray(tag);
} else {
if (token.tag != tag and token.tag != .keyword_null) {
if (token.tag != tag) {
return printError(
"Error: Expected {s}",
ZiQlParserError.SynthaxError,
@ -925,13 +925,10 @@ pub const Parser = struct {
.bool => {
switch (token.tag) {
.bool_literal_true => {
member_map.put(member_name, "1") catch @panic("Could not add member name and value to map in getMapOfMember");
member_map.put(member_name, "1") catch return ZiQlParserError.MemoryError;
},
.bool_literal_false => {
member_map.put(member_name, "0") catch @panic("Could not add member name and value to map in getMapOfMember");
},
.keyword_null => {
member_map.put(member_name, self.toker.getTokenSlice(token)) catch return ZipponError.MemoryError;
member_map.put(member_name, "0") catch return ZiQlParserError.MemoryError;
},
else => return printError(
"Error: Expected bool: true, false, or null",