conlang: Add unconditional loop expression, for desugaring

This commit is contained in:
2024-04-17 00:29:09 -05:00
parent ec1a1255ad
commit 00d72b823a
8 changed files with 62 additions and 10 deletions

View File

@@ -26,6 +26,7 @@ pub enum TokenKind {
Impl,
In,
Let,
Loop,
Mod,
Mut,
Pub,
@@ -122,6 +123,7 @@ impl Display for TokenKind {
TokenKind::Impl => "impl".fmt(f),
TokenKind::In => "in".fmt(f),
TokenKind::Let => "let".fmt(f),
TokenKind::Loop => "loop".fmt(f),
TokenKind::Mod => "mod".fmt(f),
TokenKind::Mut => "mut".fmt(f),
TokenKind::Pub => "pub".fmt(f),
@@ -158,6 +160,7 @@ impl FromStr for TokenKind {
"impl" => Self::Impl,
"in" => Self::In,
"let" => Self::Let,
"loop" => Self::Loop,
"mod" => Self::Mod,
"mut" => Self::Mut,
"pub" => Self::Pub,