Skip to content

Commit

Permalink
std/jule/ast: rename the MapTypeDecl as MapType
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Dec 25, 2024
1 parent c5e6da8 commit b2327c6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions std/jule/ast/node.jule
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum TypeKind: type {
&PtrType,
&SliceType,
&ArrayType,
&MapTypeDecl,
&MapType,
&TupleType,
&FnDecl,
&NamespaceType,
Expand Down Expand Up @@ -126,7 +126,7 @@ impl ArrayType {
}

// Map type.
struct MapTypeDecl {
struct MapType {
Key: &Type
Val: &Type
}
Expand Down
2 changes: 1 addition & 1 deletion std/jule/parser/type.jule
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ impl typeBuilder {
ret nil
}

mut mapt := new(ast::MapTypeDecl)
mut mapt := new(ast::MapType)
mut j := 0
mut keyt, mut ok := self.p.buildType(keyTokens, &j, self.err)
if !ok {
Expand Down
6 changes: 3 additions & 3 deletions std/jule/sema/type.jule
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ impl typeChecker {
}
}

fn buildMap(mut self, mut decl: &ast::MapTypeDecl): &Map {
fn buildMap(mut self, mut decl: &ast::MapType): &Map {
// Evaluate key type with cycle risk, but do not log errors about it.
// We have to do this for checking correct map type dependencies,
// cycle types are prevents valid map key types. So, caught them but
Expand Down Expand Up @@ -1786,9 +1786,9 @@ impl typeChecker {
if t != nil {
kind = t
}
| &ast::MapTypeDecl:
| &ast::MapType:
self.inscatch = true
mut t := self.buildMap((&ast::MapTypeDecl)(declKind))
mut t := self.buildMap((&ast::MapType)(declKind))
if t != nil {
kind = t
}
Expand Down
4 changes: 2 additions & 2 deletions std/jule/sema/type2.jule
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,9 @@ impl dynamicTypeAnnotation {

fn annotateConstraintMap(mut self, mut &k: &Type): (ok: bool) {
match type self.c.Kind {
| &ast::MapTypeDecl:
| &ast::MapType:
mut m := k.Map()
mut m2 := (&ast::MapTypeDecl)(self.c.Kind)
mut m2 := (&ast::MapType)(self.c.Kind)
self.c = m2.Key
if !self.annotateConstraint(m.Key) {
ret false
Expand Down

0 comments on commit b2327c6

Please sign in to comment.