ported rewrite2 to c3
This commit is contained in:
parent
2dcc1b582c
commit
39e78ea078
40 changed files with 1478 additions and 2911 deletions
0
test/.gitkeep
Normal file
0
test/.gitkeep
Normal file
14
test/test_bitsruct.c3
Normal file
14
test/test_bitsruct.c3
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
bitstruct Bits : uint {
|
||||
bool a : 0;
|
||||
bool b : 1;
|
||||
bool c : 2;
|
||||
}
|
||||
|
||||
fn int main()
|
||||
{
|
||||
Bits a = {false, true, false};
|
||||
Bits b = {true, true, false};
|
||||
Bits c = a | b;
|
||||
|
||||
return 0;
|
||||
}
|
||||
26
test/test_union.c3
Normal file
26
test/test_union.c3
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
struct CmdA {
|
||||
int a, b;
|
||||
}
|
||||
|
||||
struct CmdB {
|
||||
float a, b;
|
||||
}
|
||||
|
||||
union AnyCmd {
|
||||
CmdA a;
|
||||
CmdB b;
|
||||
}
|
||||
|
||||
struct Cmd {
|
||||
int type;
|
||||
AnyCmd cmd;
|
||||
}
|
||||
|
||||
fn int main()
|
||||
{
|
||||
Cmd c;
|
||||
c.type = 1;
|
||||
c.cmd.a = {.a = 1, .b = 2};
|
||||
return 0;
|
||||
}
|
||||
7
test/test_vtree.c3
Normal file
7
test/test_vtree.c3
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import std::io;
|
||||
import vtree;
|
||||
|
||||
fn int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue