spl 编写编译器基础框架 ai修复出现的stage2和stage3问题并提供新语法

This commit is contained in:
zzy committed 2026-11-07 21:52:02 +08:00
1 parent 126b979f72
commit 50ee126d44
87 files changed
+3168 -394

No files matched your search

+14 -14
View File
@@ -14,94 +14,94 @@ type Ordering = enum {
type Add = shape {
type Rhs;
type Output;
fn add(lhs: @self, rhs: Rhs): Output;
fn add(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(sub)
type Sub = shape {
type Rhs;
type Output;
fn sub(lhs: @self, rhs: Rhs): Output;
fn sub(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(mul)
type Mul = shape {
type Rhs;
type Output;
fn mul(lhs: @self, rhs: Rhs): Output;
fn mul(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(div)
type Div = shape {
type Rhs;
type Output;
fn div(lhs: @self, rhs: Rhs): Output;
fn div(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(mod)
type Mod = shape {
type Rhs;
type Output;
fn rem(lhs: @self, rhs: Rhs): Output;
fn rem(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(neg)
type Neg = shape {
type Output;
fn neg(value: @self): Output;
fn neg(@Self value: @self): Output;
};
#lang(bit_and)
type BitAnd = shape {
type Rhs;
type Output;
fn bit_and(lhs: @self, rhs: Rhs): Output;
fn bit_and(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(bit_or)
type BitOr = shape {
type Rhs;
type Output;
fn bit_or(lhs: @self, rhs: Rhs): Output;
fn bit_or(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(bit_xor)
type BitXor = shape {
type Rhs;
type Output;
fn bit_xor(lhs: @self, rhs: Rhs): Output;
fn bit_xor(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(shl)
type Shl = shape {
type Rhs;
type Output;
fn shl(lhs: @self, rhs: Rhs): Output;
fn shl(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(shr)
type Shr = shape {
type Rhs;
type Output;
fn shr(lhs: @self, rhs: Rhs): Output;
fn shr(@Self lhs: @self, rhs: Rhs): Output;
};
#lang(bit_not)
type BitNot = shape {
type Output;
fn bit_not(value: @self): Output;
fn bit_not(@Self value: @self): Output;
};
#lang(eq)
type Eq = shape {
type Rhs;
fn eq(lhs: @self, rhs: Rhs): bool;
fn eq(@Self lhs: @self, rhs: Rhs): bool;
};
#lang(ord)
type Ord = shape {
type Rhs;
fn cmp(lhs: @self, rhs: Rhs): Ordering;
fn cmp(@Self lhs: @self, rhs: Rhs): Ordering;
};
#lang(index)