Files
corelang/ideas.cpp
2022-05-01 13:51:34 +02:00

100 lines
1.4 KiB
C++

call:(param:U32)U32{
}
@stringify
Enumeration:enum{
None,
Thing = 1 << 10,
Thing2,
Thing3,
}
@sllqueue()
@sllqueue(prefix=thing_scope, next=next_scope)
Thing:struct{
next: Thing*;
first: Thing*;
last: Thing*;
next_scope: Thing*;
val: U32[16];
str: String;
embed: struct{
thing: S32;
}
}
@register(sllqueue, first, last, next)
sllqueue_push:(base:T1, child:T2) void {
if(base.first == 0){
base.first = base.last = child;
}
else{
base.last = base.last.next = child;
}
}
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
/*
function void
thing_sllqueue_push(){
}
function void
thing_scope_sllqueue_push(){
}
*/
Builtin types:
B8,B16,B32,B64
S8,S16,S32,S64
U8,U16,U32,U64
SizeI, SizeU
F32, F64
Decls:
S32 *var;
S32 (*func)();
S32 *var[expr][expr];
S32 **var;
Global scope:
function S32
do_thing(S32 a, U32 b){
stmt_list
}
function S32
do_thing(S32 a, S32 b);
typedef struct Thing Thing;
struct Thing{};
typedef struct Thing{} Thing;
typedef enum Thingy Thingy;
enum Thingy{};
typedef enum Thingy{} Thingy;
global S32 variable = expr | compound;
// typedef S32 NewName;
// typedef S32 BaseFunctionType(S32 thing);
// typedef S32 (*FunctionPointer)(S32 thing);
Local scope-(stmts):
S32 variable = expr;
variable = expr;
variable++;
return 0;
if(a){}elseif(b){}else{}