🐐 EVERRO
This commit is contained in:
@@ -899,6 +899,9 @@ class BuiltIn(Node):
|
||||
if not isinstance(params[0], ValList):
|
||||
raise CentvrionError("LONGITVDO requires an array")
|
||||
return vtable, ValInt(len(params[0].value()))
|
||||
case "EVERRO":
|
||||
print("\033[2J\033[H", end="", flush=True)
|
||||
return vtable, ValNul()
|
||||
case _:
|
||||
raise NotImplementedError(self.builtin)
|
||||
|
||||
|
||||
@@ -187,6 +187,10 @@ def _emit_builtin(node, ctx):
|
||||
lines.append("break;")
|
||||
lines.append(f"CentValue {tmp} = cent_null();")
|
||||
|
||||
case "EVERRO":
|
||||
lines.append("cent_everro();")
|
||||
lines.append(f"CentValue {tmp} = cent_null();")
|
||||
|
||||
case _:
|
||||
raise NotImplementedError(node.builtin)
|
||||
|
||||
|
||||
@@ -458,6 +458,11 @@ void cent_dice(CentValue v) {
|
||||
fputc('\n', stdout);
|
||||
}
|
||||
|
||||
void cent_everro(void) {
|
||||
fputs("\033[2J\033[H", stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
CentValue cent_avdi(void) {
|
||||
char *buf = cent_arena_alloc(cent_arena, 1024);
|
||||
if (!fgets(buf, 1024, stdin)) {
|
||||
|
||||
@@ -174,6 +174,7 @@ CentValue cent_avdi_numerus(void); /* AVDI_NVMERVS */
|
||||
CentValue cent_longitudo(CentValue v); /* LONGITVDO */
|
||||
CentValue cent_fortis_numerus(CentValue lo, CentValue hi); /* FORTIS_NVMERVS */
|
||||
CentValue cent_fortis_electionis(CentValue lst); /* FORTIS_ELECTIONIS */
|
||||
void cent_everro(void); /* EVERRO */
|
||||
|
||||
/* ------------------------------------------------------------------ */
|
||||
/* Array helpers */
|
||||
|
||||
@@ -35,6 +35,7 @@ builtin_tokens = [("BUILTIN", i) for i in [
|
||||
"AVDI_NVMERVS",
|
||||
"AVDI",
|
||||
"DICE",
|
||||
"EVERRO",
|
||||
"FORTIS_NVMERVS",
|
||||
"FORTIS_ELECTIONIS",
|
||||
"LONGITVDO"
|
||||
|
||||
Reference in New Issue
Block a user