Update switch
All checks were successful
CI / ci (ReleaseFast, ubuntu-latest) (push) Successful in 2m3s
CI / ci (ReleaseSmall, ubuntu-latest) (push) Successful in 2m2s
CI / ci (ReleaseSafe, ubuntu-latest) (push) Successful in 2m11s
CI / ci (Debug, ubuntu-latest) (push) Successful in 3m11s

This commit is contained in:
David Gonzalez Martin 2025-04-17 12:13:08 -06:00
parent 408d53a6f9
commit d2e488edb1

View File

@ -242,30 +242,46 @@ CompilerCommand = enum
>command_string = c_string_to_slice(argv[1]); >command_string = c_string_to_slice(argv[1]);
> a = #string_to_enum(CompilerCommand, command_string); > command_string_to_enum = #string_to_enum(CompilerCommand, command_string);
if (!command_string_to_enum.is_valid)
>relative_file_path_pointer = argv[2];
if (!relative_file_path_pointer)
{ {
return 1; return 1;
} }
>relative_file_path = c_string_to_slice(relative_file_path_pointer); >command = command_string_to_enum.enum_value;
switch (command)
if (relative_file_path.length < 5)
{ {
return 1; .compile =>
} {
>relative_file_path_pointer = argv[2];
if (!relative_file_path_pointer)
{
return 1;
}
>extension_start = string_last_character(relative_file_path, '.'); >relative_file_path = c_string_to_slice(relative_file_path_pointer);
if (extension_start == string_no_match)
{
return 1;
}
if (!string_equal(relative_file_path[extension_start..], ".bbb")) if (relative_file_path.length < 5)
{ {
return 1; return 1;
}
>extension_start = string_last_character(relative_file_path, '.');
if (extension_start == string_no_match)
{
return 1;
}
if (!string_equal(relative_file_path[extension_start..], ".bbb"))
{
return 1;
}
},
.test =>
{
// TODO
#trap();
},
} }
return 0; return 0;