mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-13 02:08:45 +00:00
part of migration to gc
This commit is contained in:
parent
fb1ec1c7ae
commit
d782934f0c
5 changed files with 457 additions and 337 deletions
35
byterun/include/builtin.h
Normal file
35
byterun/include/builtin.h
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "operations.h"
|
||||
|
||||
inline void f_read(struct State *s) {
|
||||
int x = 0;
|
||||
printf("> "); // TODO: ??
|
||||
scanf("%i", &x);
|
||||
s_put_i(s, x);
|
||||
}
|
||||
|
||||
inline void f_write(struct State *s) {
|
||||
int x = s_take_i(s);
|
||||
printf("%i", x);
|
||||
// put 0 ??
|
||||
}
|
||||
|
||||
inline void f_length(struct State *s) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
inline void f_string(struct State *s) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
inline void f_array(struct State *s, int sz) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
inline void f_cons(struct State *s) {
|
||||
|
||||
// TODO
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue