feat: trait 接口系统 — trait Show { fn method } + extend Trait Struct { }

This commit is contained in:
2026-06-06 16:41:21 +08:00
parent 9169796b77
commit b3b3d285f9
9 changed files with 126 additions and 12 deletions
+1
View File
@@ -7,6 +7,7 @@
static const char* NAMES[] = {
[TOK_FN] = "fn", [TOK_LET] = "let", [TOK_VAR] = "var", [TOK_IF] = "if", [TOK_GUARD] = "guard",
[TOK_PUB] = "pub", [TOK_MOD] = "mod", [TOK_USE] = "use",
[TOK_TRAIT] = "trait", [TOK_SELF] = "Self",
[TOK_ELSE] = "else", [TOK_WHILE] = "while", [TOK_FOR] = "for", [TOK_IN] = "in", [TOK_RETURN] = "return",
[TOK_STRUCT] = "struct", [TOK_TYPE] = "type", [TOK_ENUM] = "enum", [TOK_EXTEND] = "extend",
[TOK_MATCH] = "match",