From 5c043702eefe7a00a6784c04ec489c8c0664a9f0 Mon Sep 17 00:00:00 2001 From: mertcandav Date: Fri, 28 Jun 2024 19:47:22 +0300 Subject: [PATCH] sema: rename comptimeType as comptimeTypeInfo --- std/jule/sema/comptime.jule | 18 +++++++++--------- std/jule/sema/eval.jule | 6 +++--- std/jule/sema/sema.jule | 10 +++++----- std/jule/sema/type.jule | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/std/jule/sema/comptime.jule b/std/jule/sema/comptime.jule index d4ec52d78..4f143fddc 100644 --- a/std/jule/sema/comptime.jule +++ b/std/jule/sema/comptime.jule @@ -238,7 +238,7 @@ impl comptimeRangeKind for comptimeEnumFields { // Compile-time type info range. struct comptimeTypeInfos { - types: []&comptimeType + types: []&comptimeTypeInfo } impl Kind for comptimeTypeInfos { @@ -267,7 +267,7 @@ impl comptimeRangeKind for comptimeTypeInfos { } keyB.Kind = &TypeSymbol{ Kind: &TypeKind{ - Kind: new(comptimeType), + Kind: new(comptimeTypeInfo), }, } } @@ -291,16 +291,16 @@ impl comptimeRangeKind for comptimeTypeInfos { } // Compile-time type information data. -struct comptimeType { +struct comptimeTypeInfo { base: &TypeKind } -impl Kind for comptimeType { - fn Str(self): str { ret "comptimeTypeInfo" } +impl Kind for comptimeTypeInfo { + fn Str(self): str { ret "comptimeTypeInfo[" + self.base.Str() + "]" } fn Equal(&self, other: &TypeKind): bool { ret false } } -impl comptimeType { +impl comptimeTypeInfo { fn _Str(&self): &Data { let mut constant = Const.NewStr(self.base.Str()) ret &Data{ @@ -571,10 +571,10 @@ impl comptimeType { ret nil } let mut infos = &comptimeTypeInfos{ - types: make([]&comptimeType, 0, len(tup.Types)), + types: make([]&comptimeTypeInfo, 0, len(tup.Types)), } for (_, mut t) in tup.Types { - infos.types = append(infos.types, e.s.meta.pushComptimeType(t)) + infos.types = append(infos.types, e.s.meta.pushComptimeTypeInfo(t)) } ret &Data{ Kind: &TypeKind{ @@ -749,7 +749,7 @@ fn findComptimePackage(mut &s: &Sema): &ImportInfo { fn buildComptimeTypeInfoData(mut &s: &Sema, mut &t: &TypeKind): &Data { ret &Data{ Kind: &TypeKind{ - Kind: s.meta.pushComptimeType(t), + Kind: s.meta.pushComptimeTypeInfo(t), }, } } \ No newline at end of file diff --git a/std/jule/sema/eval.jule b/std/jule/sema/eval.jule index a2aa178c6..74b9b8c17 100644 --- a/std/jule/sema/eval.jule +++ b/std/jule/sema/eval.jule @@ -2695,9 +2695,9 @@ impl Eval { } match { - | d.Kind.comptimeType() != nil: - let mut comptimeType = d.Kind.comptimeType() - let mut cd = comptimeType.subIdent(si.Ident.Kind) + | d.Kind.comptimeTypeInfo() != nil: + let mut cti = d.Kind.comptimeTypeInfo() + let mut cd = cti.subIdent(si.Ident.Kind) if cd == nil { self.pushErr(si.Ident, LogMsg.ObjHaveNotIdent, d.Kind.Str(), si.Ident.Kind) } diff --git a/std/jule/sema/sema.jule b/std/jule/sema/sema.jule index f6771654a..98c0cf481 100644 --- a/std/jule/sema/sema.jule +++ b/std/jule/sema/sema.jule @@ -206,18 +206,18 @@ unsafe fn pushSuggestion(mut log: *Log, fmt: LogMsg, args: ...any) { } struct commonSemaMeta { - comptimeTypes: []&comptimeType + comptimeTypeInfos: []&comptimeTypeInfo } impl commonSemaMeta { - fn pushComptimeType(mut self, mut &t: &TypeKind): &comptimeType { - for (_, mut t2) in self.comptimeTypes { + fn pushComptimeTypeInfo(mut self, mut &t: &TypeKind): &comptimeTypeInfo { + for (_, mut t2) in self.comptimeTypeInfos { if t2.base.Equal(t) { ret t2 } } - let mut t1 = &comptimeType{base: t} - self.comptimeTypes = append(self.comptimeTypes, t1) + let mut t1 = &comptimeTypeInfo{base: t} + self.comptimeTypeInfos = append(self.comptimeTypeInfos, t1) ret t1 } } diff --git a/std/jule/sema/type.jule b/std/jule/sema/type.jule index 34c54eab5..f3e6172c0 100644 --- a/std/jule/sema/type.jule +++ b/std/jule/sema/type.jule @@ -369,7 +369,7 @@ impl TypeKind { // Reports whether kind is comptime type. fn comptime(mut self): bool { ret self.comptimeTypeInfos() != nil || - self.comptimeType() != nil || + self.comptimeTypeInfo() != nil || self.comptimeStructFields() != nil || self.comptimeStructField() != nil || self.comptimeEnumFields() != nil || @@ -431,10 +431,10 @@ impl TypeKind { } } - fn comptimeType(mut self): &comptimeType { + fn comptimeTypeInfo(mut self): &comptimeTypeInfo { match type self.Kind { - | &comptimeType: - ret (&comptimeType)(self.Kind) + | &comptimeTypeInfo: + ret (&comptimeTypeInfo)(self.Kind) |: ret nil } @@ -1728,7 +1728,7 @@ fn isValidForRef(mut &t: &TypeKind): bool { ret t.Fn() == nil } // Reports whether type has built-in string conversion support. fn isBuiltinStrConvertable(mut &t: &TypeKind): bool { - ret !t.Void() && t.Fn() == nil && t.Tup() == nil && t.comptimeType() == nil + ret !t.Void() && t.Fn() == nil && t.Tup() == nil && !t.comptime() } fn buildLinkPathByTokens(&tokens: []&Token): str {