cl 0.0.2: MAJOR ERGONOMIC BOOST

Broke frontend into its own library, "cl-frontend"
- Frontend is pretty :D
- Included sample fibonacci implementation

Deprecated conlang::ast::Visitor in favor of bespoke traits
- Rust traits are super cool.
- The Interpreter is currently undergoing a major rewrite

Added preliminary type-path support to the parser
- Currently incomplete: type paths must end in Never..?

Pretty printer is now even prettier
- conlang::ast now exports all relevant AST nodes, since there are no namespace collisions any more
This commit is contained in:
2024-01-04 02:18:09 -06:00
parent 9b7cf9c017
commit 79fda16788
14 changed files with 1284 additions and 563 deletions

View File

@@ -87,6 +87,9 @@ pub enum Keyword {
Let,
Mut,
Return,
SelfKw,
SelfTy,
Super,
True,
While,
}
@@ -174,6 +177,9 @@ impl Display for Keyword {
Self::Let => "let".fmt(f),
Self::Mut => "mut".fmt(f),
Self::Return => "return".fmt(f),
Self::SelfKw => "self".fmt(f),
Self::SelfTy => "Self".fmt(f),
Self::Super => "super".fmt(f),
Self::True => "true".fmt(f),
Self::While => "while".fmt(f),
}
@@ -195,6 +201,9 @@ impl FromStr for Keyword {
"let" => Self::Let,
"mut" => Self::Mut,
"return" => Self::Return,
"self" => Self::SelfKw,
"Self" => Self::SelfTy,
"super" => Self::Super,
"true" => Self::True,
"while" => Self::While,
_ => Err(())?,