1
1
Fork 0
mirror of https://github.com/azur1s/bobbylisp.git synced 2024-10-16 02:37:40 -05:00
This commit is contained in:
Natapat Samutpong 2022-03-23 08:34:20 +07:00
parent 070b8b259c
commit fefffdd79e
2 changed files with 5 additions and 0 deletions

View file

@ -62,6 +62,8 @@ pub struct IR {
pub span: Range<usize> pub span: Range<usize>
} }
// S-Expression displaying for IR
// Used for debugging (run `compile` with `-a`)
impl std::fmt::Display for IRKind { impl std::fmt::Display for IRKind {
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self { match self {

View file

@ -3,8 +3,11 @@ fun iter_ (vec: vec_int) (current: int): void = do
do end; do end;
else else
do do
-- iter logic
-- TODO: function as argument
@get(vec, current) |> @write(_); @get(vec, current) |> @write(_);
@write("\n"); @write("\n");
iter_(vec, current + 1); iter_(vec, current + 1);
end; end;
end; end;