@@ -8,7 +8,6 @@ import v.pref
8
8
import v.token
9
9
import v.util
10
10
import v.pkgconfig
11
- import v.checker.constants
12
11
13
12
[inline ]
14
13
fn (mut c Checker) get_comptime_var_type (node ast.Expr) ast.Type {
@@ -101,8 +100,8 @@ fn (mut c Checker) comptime_call(mut node ast.ComptimeCall) ast.Type {
101
100
node.embed_file.apath = escaped_path
102
101
}
103
102
// c.file.embedded_files << node.embed_file
104
- if node.embed_file.compression_type ! in constants .valid_comptime_compression_types {
105
- supported := constants .valid_comptime_compression_types.map ('.${it} ' ).join (', ' )
103
+ if node.embed_file.compression_type ! in ast .valid_comptime_compression_types {
104
+ supported := ast .valid_comptime_compression_types.map ('.${it} ' ).join (', ' )
106
105
c.error ('not supported compression type: .${node.embed_file.compression_type} . supported: ${supported} ' ,
107
106
node.pos)
108
107
}
@@ -526,7 +525,7 @@ fn (mut c Checker) evaluate_once_comptime_if_attribute(mut node ast.Attr) bool {
526
525
}
527
526
if node.ct_expr is ast.Ident {
528
527
if node.ct_opt {
529
- if node.ct_expr.name in constants .valid_comptime_not_user_defined {
528
+ if node.ct_expr.name in ast .valid_comptime_not_user_defined {
530
529
c.error ('option `[if expression ?]` tags, can be used only for user defined identifiers' ,
531
530
node.pos)
532
531
node.ct_skip = true
@@ -536,7 +535,7 @@ fn (mut c Checker) evaluate_once_comptime_if_attribute(mut node ast.Attr) bool {
536
535
node.ct_evaled = true
537
536
return node.ct_skip
538
537
} else {
539
- if node.ct_expr.name ! in constants .valid_comptime_not_user_defined {
538
+ if node.ct_expr.name ! in ast .valid_comptime_not_user_defined {
540
539
c.note ('`[if ${node.ct_expr.name} ]` is deprecated. Use `[if ${node.ct_expr.name} ?]` instead' ,
541
540
node.pos)
542
541
node.ct_skip = node.ct_expr.name ! in c.pref.compile_defines
@@ -729,20 +728,20 @@ fn (mut c Checker) comptime_if_branch(cond ast.Expr, pos token.Pos) ComptimeBran
729
728
}
730
729
ast.Ident {
731
730
cname := cond.name
732
- if cname in constants .valid_comptime_if_os {
731
+ if cname in ast .valid_comptime_if_os {
733
732
mut is_os_target_equal := true
734
733
if ! c.pref.output_cross_c {
735
734
target_os := c.pref.os.str ().to_lower ()
736
735
is_os_target_equal = cname == target_os
737
736
}
738
737
return if is_os_target_equal { .eval } else { .skip }
739
- } else if cname in constants .valid_comptime_if_compilers {
738
+ } else if cname in ast .valid_comptime_if_compilers {
740
739
return if pref.cc_from_string (cname) == c.pref.ccompiler_type {
741
740
.eval
742
741
} else {
743
742
.skip
744
743
}
745
- } else if cname in constants .valid_comptime_if_platforms {
744
+ } else if cname in ast .valid_comptime_if_platforms {
746
745
if cname == 'aarch64' {
747
746
c.note ('use `arm64` instead of `aarch64`' , pos)
748
747
}
@@ -756,9 +755,9 @@ fn (mut c Checker) comptime_if_branch(cond ast.Expr, pos token.Pos) ComptimeBran
756
755
'rv32' { return if c.pref.arch == .rv32 { .eval } else { .skip } }
757
756
else { return .unknown }
758
757
}
759
- } else if cname in constants .valid_comptime_if_cpu_features {
758
+ } else if cname in ast .valid_comptime_if_cpu_features {
760
759
return .unknown
761
- } else if cname in constants .valid_comptime_if_other {
760
+ } else if cname in ast .valid_comptime_if_other {
762
761
match cname {
763
762
'apk' {
764
763
return if c.pref.is_apk { .eval } else { .skip }
0 commit comments