new enum step 2
parent
4d876d1980
commit
8dd335295e
|
@ -59,7 +59,7 @@ fn (p mut Parser) enum_decl(no_name bool) {
|
|||
name: enum_name
|
||||
mod: p.mod
|
||||
parent: 'int'
|
||||
cat: TypeCategory.enum_
|
||||
cat: .enum_
|
||||
enum_vals: fields.clone()
|
||||
is_public: is_pub
|
||||
})
|
||||
|
|
|
@ -1219,7 +1219,7 @@ fn (p mut Parser) replace_type_params(f &Fn, ti TypeInst) []string {
|
|||
fn (p mut Parser) register_vargs_stuct(typ string, len int) string {
|
||||
vargs_struct := 'varg_$typ'
|
||||
varg_type := Type{
|
||||
cat: TypeCategory.struct_,
|
||||
cat: .struct_,
|
||||
name: vargs_struct,
|
||||
mod: p.mod
|
||||
}
|
||||
|
@ -1299,7 +1299,7 @@ fn (p mut Parser) register_multi_return_stuct(types []string) string {
|
|||
typ := '_V_MulRet_' + types.join('_V_').replace('*', '_PTR_')
|
||||
if p.table.known_type(typ) { return typ }
|
||||
p.table.register_type2(Type{
|
||||
cat: TypeCategory.struct_,
|
||||
cat: .struct_,
|
||||
name: typ,
|
||||
mod: p.mod
|
||||
})
|
||||
|
|
|
@ -227,7 +227,7 @@ fn (p & Parser) peek() TokenKind {
|
|||
}
|
||||
[inline] fn (p &Parser) peek_token() Token {
|
||||
if p.token_idx >= p.tokens.len - 2 {
|
||||
return Token{ tok:TokenKind.eof }
|
||||
return Token{ tok:.eof }
|
||||
}
|
||||
return p.tokens[p.token_idx]
|
||||
}
|
||||
|
@ -639,7 +639,7 @@ fn (p mut Parser) type_decl() {
|
|||
name: name
|
||||
parent: parent.name
|
||||
mod: p.mod
|
||||
cat: TypeCategory.alias
|
||||
cat: .alias
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ fn (p mut Parser) get_type2() Type {
|
|||
name: f.typ_str()// 'fn (int, int) string'
|
||||
mod: p.mod
|
||||
func: f
|
||||
cat: TypeCategory.func
|
||||
cat: .func
|
||||
}
|
||||
p.table.register_type2(fn_typ)
|
||||
return fn_typ
|
||||
|
|
Loading…
Reference in New Issue