conlang: add lang items, remove Empty, and shuffle typeck

This commit is contained in:
2025-09-15 10:45:14 -04:00
parent ead1f351a7
commit f41e5fc49a
26 changed files with 172 additions and 154 deletions

View File

@@ -25,5 +25,7 @@ pub mod result;
pub mod range;
pub mod never;
// #[cfg("test")]
// mod test;

4
stdlib/std/never.cl Normal file
View File

@@ -0,0 +1,4 @@
//! Never: the return type of an infinite loop
#[lang = "never"]
type Never = !;

View File

@@ -1,6 +1,7 @@
//! The optional type, representing the presence or absence of a thing.
use super::preamble::*;
#[lang = "option"]
pub enum Option<T> {
Some(T),
None,

View File

@@ -1,6 +1,7 @@
//! The Result type, indicating a fallible operation.
use super::preamble::*;
#[lang = "result"]
pub enum Result<T, E> {
Ok(T),
Err(E),