C compiler with embedded metalanguage.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

19 lines
392 B

@{
mapast(f, seq)
{
out = {};
for (i in seq) {
e = seq[i];
out[length(out)] = e.__proto__ != Token ? f(e) : e ;
}
out;
}
idToString(x) { { __proto__: C_string, value: "\"" + string(x.name.identifier) + "\"" } }
nil;
}
enum foo { Closed = 0, ReadOnly = 1, WriteOnly = 2 };
static char *stateNames[] = { @(mapast(idToString, program.last.enumList)) };