mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
checker: add support for apk comptime if (#13079)
This commit is contained in:
parent
6e6d51a1c9
commit
7276705684
@ -24,7 +24,7 @@ const (
|
|||||||
valid_comptime_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
|
valid_comptime_if_compilers = ['gcc', 'tinyc', 'clang', 'mingw', 'msvc', 'cplusplus']
|
||||||
valid_comptime_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32']
|
valid_comptime_if_platforms = ['amd64', 'i386', 'aarch64', 'arm64', 'arm32', 'rv64', 'rv32']
|
||||||
valid_comptime_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
valid_comptime_if_cpu_features = ['x64', 'x32', 'little_endian', 'big_endian']
|
||||||
valid_comptime_if_other = ['js', 'debug', 'prod', 'test', 'glibc', 'prealloc',
|
valid_comptime_if_other = ['apk', 'js', 'debug', 'prod', 'test', 'glibc', 'prealloc',
|
||||||
'no_bounds_checking', 'freestanding', 'threads', 'js_node', 'js_browser', 'js_freestanding',
|
'no_bounds_checking', 'freestanding', 'threads', 'js_node', 'js_browser', 'js_freestanding',
|
||||||
'interpreter', 'es5']
|
'interpreter', 'es5']
|
||||||
valid_comptime_not_user_defined = all_valid_comptime_idents()
|
valid_comptime_not_user_defined = all_valid_comptime_idents()
|
||||||
|
@ -528,6 +528,7 @@ fn (mut c Checker) comptime_if_branch(cond ast.Expr, pos token.Position) bool {
|
|||||||
return false
|
return false
|
||||||
} else if cname in valid_comptime_if_other {
|
} else if cname in valid_comptime_if_other {
|
||||||
match cname {
|
match cname {
|
||||||
|
'apk' { return !c.pref.is_apk }
|
||||||
'js' { return !c.pref.backend.is_js() }
|
'js' { return !c.pref.backend.is_js() }
|
||||||
'debug' { return !c.pref.is_debug }
|
'debug' { return !c.pref.is_debug }
|
||||||
'prod' { return !c.pref.is_prod }
|
'prod' { return !c.pref.is_prod }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user