diff options
| author | Tolmachev Igor <me@igorek.dev> | 2026-05-11 08:34:22 +0300 |
|---|---|---|
| committer | Tolmachev Igor <me@igorek.dev> | 2026-05-11 08:34:22 +0300 |
| commit | abda8d00117072f7c03f57eaeca9cf44427078dc (patch) | |
| tree | a7caf8c91932ce195398dbd63758a057720366a1 /compiler/src/span.rs | |
| parent | 7163aaebc993591db1cb4d7ae2be31669a0cb9a7 (diff) | |
| download | crisp-abda8d00117072f7c03f57eaeca9cf44427078dc.tar.gz crisp-abda8d00117072f7c03f57eaeca9cf44427078dc.zip | |
Replace generic list AST with typed expression tree
Each form (fn, let, for, set, do, call) now has its own variant with named fields instead of being a
plain list.
Diffstat (limited to 'compiler/src/span.rs')
| -rw-r--r-- | compiler/src/span.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/src/span.rs b/compiler/src/span.rs index 8686f4f..8b46b31 100644 --- a/compiler/src/span.rs +++ b/compiler/src/span.rs | |||
| @@ -38,6 +38,10 @@ impl<T> Spanned<T> { | |||
| 38 | Self { inner, span } | 38 | Self { inner, span } |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | pub fn into_parts(self) -> (T, Span) { | ||
| 42 | (self.inner, self.span) | ||
| 43 | } | ||
| 44 | |||
| 41 | pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Spanned<U> { | 45 | pub fn map<U>(self, f: impl FnOnce(T) -> U) -> Spanned<U> { |
| 42 | let Self { inner, span } = self; | 46 | let Self { inner, span } = self; |
| 43 | Spanned { | 47 | Spanned { |
