mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: add type check for +=, -=, *=, /=
This commit is contained in:
@ -189,6 +189,7 @@ const (
|
||||
integer_types = ['int', 'i8', 'char', 'byte', 'i16', 'u16', 'u32', 'i64', 'u64']
|
||||
float_types = ['f32', 'f64']
|
||||
reserved_type_param_names = ['R', 'S', 'T', 'U', 'W']
|
||||
pointer_types = ['byte*', 'byteptr', 'char*', 'charptr', 'void*', 'voidptr', 'voidptr*', 'intptr']
|
||||
)
|
||||
|
||||
fn is_number_type(typ string) bool {
|
||||
@ -207,6 +208,10 @@ fn is_primitive_type(typ string) bool {
|
||||
return is_number_type(typ) || typ == 'string'
|
||||
}
|
||||
|
||||
fn is_pointer_type(typ string) bool {
|
||||
return typ in pointer_types
|
||||
}
|
||||
|
||||
/*
|
||||
fn (t mut Table) register_enum_val(typ, val string) {
|
||||
if t.enum_vals.len == 0 {
|
||||
|
Reference in New Issue
Block a user