aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors-over-42023-07-09 23:28:06 -0400
committers-over-42023-07-09 23:28:06 -0400
commit657eac56d1ec80d670bbabafe7d67aa6695d8c05 (patch)
tree211b1c72655441e3692cc44d28bcd613af408bb4
parent5b37568baac046ac6b21453bbe037e0eeec16e89 (diff)
tree structunkdjf
-rw-r--r--tree.txt29
1 files changed, 29 insertions, 0 deletions
diff --git a/tree.txt b/tree.txt
new file mode 100644
index 0000000..75433b2
--- /dev/null
+++ b/tree.txt
@@ -0,0 +1,29 @@
+The Expr
+========
+ [ block ] ⇐ a block is a list of exprs
+ │ ┌┘
+ │ │
+ [ expr ] ── [ lit ] ⇐ a literal value; "base case" for the tree
+ │ │ ├── type
+ ┌──┘ └──┐ └─ value
+[ def ] [ call ]
+ │ │
+ ├─ [target] ← id ├─ [target] ← id ⇐ an id is a pointer to another part of the tree
+ └── [value] ← expr └──── [arg] ← expr
+
+Example Expr Tree
+=================
+[ block ]
+ │
+ ├─ [ def ]
+ │ │
+ │ ├─ [target] → hello
+ │ └── [value] → [ lit ]
+ │ ├── type → str
+ │ └─ value → Hello, World
+ ├─ [ call ]
+ │ │
+ │ ├─ [target] → print
+ │ └──── [arg] → hello
+ ...
+