Phase 8.2.4: Lifetime syntax ('a) support
- Lexer tokenizes 'a as tkLifetime - Parser accepts lifetimes in type params <'a> and reference types &'a T / &'a mut T - AST TypeExpr has refLifetime field for tekRef/tekMutRef - TypeParam gains isLifetime flag for generic monomorphization - Sema infers lifetime params as no-op dummy values; unwraps pointee types for params inside refs - HIR lower skips lifetime params when generating mangled names and substitution tables - &mut expr syntax supported in parser (consumed as part of unary &)
This commit is contained in:
@@ -58,6 +58,7 @@ type
|
||||
tkStaticAssert # static_assert
|
||||
tkComptime # comptime
|
||||
tkDyn # dyn
|
||||
tkLifetime # 'a (lifetime parameter)
|
||||
|
||||
##Punctuation
|
||||
tkLParen # (
|
||||
@@ -265,6 +266,7 @@ proc tokenKindName*(kind: TokenKind): string =
|
||||
of tkStaticAssert: "'static_assert'"
|
||||
of tkComptime: "'comptime'"
|
||||
of tkDyn: "'dyn'"
|
||||
of tkLifetime: "lifetime"
|
||||
of tkLParen: "'('"
|
||||
of tkRParen: "')'"
|
||||
of tkLBrace: "'{'"
|
||||
|
||||
Reference in New Issue
Block a user