Skip to content

Commit

Permalink
std/jule/ast: rename the SlcTypeDecl as SliceType
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Dec 25, 2024
1 parent 05944d4 commit d79ddf5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions std/jule/ast/node.jule
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ enum TypeKind: type {
&SubIdentType,
&SptrType,
&PtrTypeDecl,
&SlcTypeDecl,
&SliceType,
&ArrTypeDecl,
&MapTypeDecl,
&TupleTypeDecl,
Expand Down Expand Up @@ -90,7 +90,7 @@ struct SptrType {
}

// Slice type.
struct SlcTypeDecl {
struct SliceType {
Elem: &Type
}

Expand Down
6 changes: 3 additions & 3 deletions std/jule/parser/type.jule
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ impl typeBuilder {
}
}

unsafe fn buildSlc(mut self): &ast::Type {
unsafe fn buildSlice(mut self): &ast::Type {
mut token := self.tokens[*self.i]
*self.i++ // skip right bracket
mut elem := self.step()
Expand All @@ -255,7 +255,7 @@ impl typeBuilder {
}
ret &ast::Type{
Token: token,
Kind: &ast::SlcTypeDecl{
Kind: &ast::SliceType{
Elem: elem,
},
}
Expand Down Expand Up @@ -338,7 +338,7 @@ impl typeBuilder {
*self.i++
token = self.tokens[*self.i]
if token.Id == token::Id.RBracket {
ret self.buildSlc()
ret self.buildSlice()
}
*self.i-- // Point to left bracket.
ret self.buildArr()
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 @@ -1528,7 +1528,7 @@ impl typeChecker {
}
}

fn buildSlc(mut self, mut decl: &ast::SlcTypeDecl): &Slc {
fn buildSlice(mut self, mut decl: &ast::SliceType): &Slc {
cycleRisk := self.cycleRisk
self.cycleRisk = false
defer { self.cycleRisk = cycleRisk }
Expand Down Expand Up @@ -1774,9 +1774,9 @@ impl typeChecker {
if t != nil {
kind = t
}
| &ast::SlcTypeDecl:
| &ast::SliceType:
self.inscatch = true
mut t := self.buildSlc((&ast::SlcTypeDecl)(declKind))
mut t := self.buildSlice((&ast::SliceType)(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 @@ -388,7 +388,7 @@ impl dynamicTypeAnnotation {
const match type T {
| ast::ArrTypeDecl:
elem = k.Arr().Elem
| ast::SlcTypeDecl:
| ast::SliceType:
elem = k.Slc().Elem
| ast::PtrTypeDecl:
elem = k.Ptr().Elem
Expand Down Expand Up @@ -494,7 +494,7 @@ impl dynamicTypeAnnotation {
| k.Arr() != nil:
ret self.annotateConstraintElem[ast::ArrTypeDecl](k)
| k.Slc() != nil:
ret self.annotateConstraintElem[ast::SlcTypeDecl](k)
ret self.annotateConstraintElem[ast::SliceType](k)
| k.Ptr() != nil:
ret self.annotateConstraintElem[ast::PtrTypeDecl](k)
| k.Sptr() != nil:
Expand Down

0 comments on commit d79ddf5

Please sign in to comment.