Skip to content

Commit

Permalink
std/jule/ast: rename the RetTypeDecl as RetType
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Dec 25, 2024
1 parent b2327c6 commit 46ba8b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions std/jule/ast/node.jule
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ struct MapType {

// Return type.
// Kind and Idents is nil for void type.
struct RetTypeDecl {
struct RetType {
Kind: &Type
Idents: []&token::Token
}
Expand Down Expand Up @@ -476,7 +476,7 @@ struct FnDecl {
Directives: []&Directive
Scope: &ScopeTree
Generics: []&GenericDecl
Result: &RetTypeDecl
Result: &RetType
Params: []&ParamDecl
}

Expand Down
8 changes: 4 additions & 4 deletions std/jule/parser/parser.jule
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,8 @@ impl parser {
ret params
}

fn buildMultiRetType(mut &self, mut &tokens: []&token::Token, mut &i: int): (t: &ast::RetTypeDecl, ok: bool) {
t = new(ast::RetTypeDecl)
fn buildMultiRetType(mut &self, mut &tokens: []&token::Token, mut &i: int): (t: &ast::RetType, ok: bool) {
t = new(ast::RetType)
i++
if i >= len(tokens) {
i--
Expand Down Expand Up @@ -702,8 +702,8 @@ impl parser {
}

// Builds function return type from tokens.
fn buildRetType(mut &self, mut &tokens: []&token::Token, mut &i: int): (t: &ast::RetTypeDecl, ok: bool) {
t = new(ast::RetTypeDecl)
fn buildRetType(mut &self, mut &tokens: []&token::Token, mut &i: int): (t: &ast::RetType, ok: bool) {
t = new(ast::RetType)
if i >= len(tokens) {
ret
}
Expand Down
2 changes: 1 addition & 1 deletion std/jule/sema/sym.jule
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn buildParams(mut &decls: []&ast::ParamDecl): []&Param {
ret params
}

fn buildRetType(mut decl: &ast::RetTypeDecl): &RetType {
fn buildRetType(mut decl: &ast::RetType): &RetType {
if decl.Idents == nil && decl.Kind == nil {
ret nil // Void type.
}
Expand Down

0 comments on commit 46ba8b0

Please sign in to comment.