Phase 8.2 foundation: @[Checked] attr, &T refs, own keyword — gradual ownership syntax

This commit is contained in:
2026-05-31 13:39:20 +03:00
parent f71c034d9e
commit 3949a2f91e
11 changed files with 67 additions and 7 deletions
+4 -1
View File
@@ -49,6 +49,7 @@ type
tkSelf # self
tkSuper # super
tkSizeOf # sizeof
tkOwn # own (gradual ownership transfer)
##Punctuation
tkLParen # (
@@ -140,7 +141,7 @@ proc isKeyword*(kind: TokenKind): bool =
tkBreak, tkContinue, tkReturn, tkMatch,
tkFunc, tkLet, tkVar, tkConst, tkType, tkStruct, tkEnum,
tkUnion, tkInterface, tkExtend, tkModule, tkImport,
tkPub, tkExtern, tkAs, tkIs, tkNull, tkSelf, tkSuper:
tkPub, tkExtern, tkAs, tkIs, tkNull, tkSelf, tkSuper, tkOwn:
true
else:
false
@@ -194,6 +195,7 @@ proc keywordKind*(text: string): TokenKind =
of "self": tkSelf
of "super": tkSuper
of "sizeof": tkSizeOf
of "own": tkOwn
of "true", "false": tkBoolLiteral
else: tkIdent
@@ -237,6 +239,7 @@ proc tokenKindName*(kind: TokenKind): string =
of tkNull: "'null'"
of tkSelf: "'self'"
of tkSuper: "'super'"
of tkOwn: "'own'"
of tkLParen: "'('"
of tkRParen: "')'"
of tkLBrace: "'{'"