wip
This commit is contained in:
parent
d2e488edb1
commit
f26e4c01e8
1389
src/bootstrap.zig
1389
src/bootstrap.zig
File diff suppressed because it is too large
Load Diff
@ -231,6 +231,18 @@ CompilerCommand = enum
|
|||||||
test,
|
test,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BuildMode = enum
|
||||||
|
{
|
||||||
|
debug_none,
|
||||||
|
debug_fast,
|
||||||
|
debug_size,
|
||||||
|
soft_optimize,
|
||||||
|
optimize_for_speed,
|
||||||
|
optimize_for_size,
|
||||||
|
aggressively_optimize_for_speed,
|
||||||
|
aggressively_optimize_for_size,
|
||||||
|
}
|
||||||
|
|
||||||
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8) s32
|
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8) s32
|
||||||
{
|
{
|
||||||
global_state_initialize();
|
global_state_initialize();
|
||||||
@ -242,7 +254,7 @@ CompilerCommand = enum
|
|||||||
|
|
||||||
>command_string = c_string_to_slice(argv[1]);
|
>command_string = c_string_to_slice(argv[1]);
|
||||||
|
|
||||||
> command_string_to_enum = #string_to_enum(CompilerCommand, command_string);
|
>command_string_to_enum = #string_to_enum(CompilerCommand, command_string);
|
||||||
if (!command_string_to_enum.is_valid)
|
if (!command_string_to_enum.is_valid)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@ -253,6 +265,41 @@ CompilerCommand = enum
|
|||||||
{
|
{
|
||||||
.compile =>
|
.compile =>
|
||||||
{
|
{
|
||||||
|
if (argument_count < 3)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
>build_mode: BuildMode = .debug_none;
|
||||||
|
>has_debug_info: u1 = 1;
|
||||||
|
|
||||||
|
if (argument_count >= 4)
|
||||||
|
{
|
||||||
|
>build_mode_string_to_enum = #string_to_enum(BuildMode, c_string_to_slice(argv[3]));
|
||||||
|
if (!build_mode_string_to_enum.is_valid)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
build_mode = build_mode_string_to_enum.enum_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argument_count >= 5)
|
||||||
|
{
|
||||||
|
>has_debug_info_string = c_string_to_slice(argv[4]);
|
||||||
|
if (string_equal(has_debug_info_string, "true"))
|
||||||
|
{
|
||||||
|
has_debug_info = 1;
|
||||||
|
}
|
||||||
|
else if (string_equal(has_debug_info_string, "false"))
|
||||||
|
{
|
||||||
|
has_debug_info = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
>relative_file_path_pointer = argv[2];
|
>relative_file_path_pointer = argv[2];
|
||||||
if (!relative_file_path_pointer)
|
if (!relative_file_path_pointer)
|
||||||
{
|
{
|
||||||
|
16
tests/else_if.bbb
Normal file
16
tests/else_if.bbb
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
[export] main = fn [cc(c)] () s32
|
||||||
|
{
|
||||||
|
>result: s32 = 0;
|
||||||
|
if (result == 1)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else if (result == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user