From fefffdd79e7e617173465d82d14fd6ae28517852 Mon Sep 17 00:00:00 2001 From: Natapat Samutpong Date: Wed, 23 Mar 2022 08:34:20 +0700 Subject: [PATCH] misc --- crates/hir/src/lib.rs | 2 ++ example/iter.hz | 3 +++ 2 files changed, 5 insertions(+) diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index c233df2..657fe77 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -62,6 +62,8 @@ pub struct IR { pub span: Range } +// S-Expression displaying for IR +// Used for debugging (run `compile` with `-a`) impl std::fmt::Display for IRKind { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { diff --git a/example/iter.hz b/example/iter.hz index 8ddba9b..32cc159 100644 --- a/example/iter.hz +++ b/example/iter.hz @@ -3,8 +3,11 @@ fun iter_ (vec: vec_int) (current: int): void = do do end; else do + -- iter logic + -- TODO: function as argument @get(vec, current) |> @write(_); @write("\n"); + iter_(vec, current + 1); end; end;