remove is_play
parent
a5b44b3bc5
commit
b48b076dac
|
@ -83,7 +83,6 @@ mut:
|
||||||
is_prod bool // use "-O2"
|
is_prod bool // use "-O2"
|
||||||
is_verbose bool // print extra information with `v.log()`
|
is_verbose bool // print extra information with `v.log()`
|
||||||
obfuscate bool // `v -obf program.v`, renames functions to "f_XXX"
|
obfuscate bool // `v -obf program.v`, renames functions to "f_XXX"
|
||||||
is_play bool // playground mode
|
|
||||||
is_repl bool
|
is_repl bool
|
||||||
is_run bool
|
is_run bool
|
||||||
show_c_cmd bool // `v -show_c_cmd` prints the C command to build program.v.c
|
show_c_cmd bool // `v -show_c_cmd` prints the C command to build program.v.c
|
||||||
|
@ -239,9 +238,6 @@ fn (v mut V) compile() {
|
||||||
}
|
}
|
||||||
// Main pass
|
// Main pass
|
||||||
cgen.pass = Pass.main
|
cgen.pass = Pass.main
|
||||||
if v.pref.is_play {
|
|
||||||
cgen.genln('#define VPLAY (1) ')
|
|
||||||
}
|
|
||||||
if v.pref.is_debug {
|
if v.pref.is_debug {
|
||||||
cgen.genln('#define VDEBUG (1) ')
|
cgen.genln('#define VDEBUG (1) ')
|
||||||
}
|
}
|
||||||
|
@ -785,7 +781,6 @@ fn new_v(args[]string) *V {
|
||||||
is_test: is_test
|
is_test: is_test
|
||||||
is_script: is_script
|
is_script: is_script
|
||||||
is_so: args.contains('-shared')
|
is_so: args.contains('-shared')
|
||||||
is_play: args.contains('play')
|
|
||||||
is_prod: args.contains('-prod')
|
is_prod: args.contains('-prod')
|
||||||
is_verbose: args.contains('-verbose')
|
is_verbose: args.contains('-verbose')
|
||||||
is_debuggable: args.contains('-g') // -debuggable implys debug
|
is_debuggable: args.contains('-g') // -debuggable implys debug
|
||||||
|
@ -806,9 +801,6 @@ fn new_v(args[]string) *V {
|
||||||
if pref.is_verbose || pref.is_debug {
|
if pref.is_verbose || pref.is_debug {
|
||||||
println('C compiler=$pref.ccompiler')
|
println('C compiler=$pref.ccompiler')
|
||||||
}
|
}
|
||||||
if pref.is_play {
|
|
||||||
println('Playground')
|
|
||||||
}
|
|
||||||
if pref.is_so {
|
if pref.is_so {
|
||||||
out_name_c = out_name.all_after('/') + '_shared_lib.c'
|
out_name_c = out_name.all_after('/') + '_shared_lib.c'
|
||||||
}
|
}
|
||||||
|
|
|
@ -1458,11 +1458,6 @@ fn (p mut Parser) name_expr() string {
|
||||||
if ptr || deref {
|
if ptr || deref {
|
||||||
p.next()
|
p.next()
|
||||||
}
|
}
|
||||||
if deref {
|
|
||||||
if p.pref.is_play && !p.builtin_mod {
|
|
||||||
p.error('dereferencing is temporarily disabled on the playground, will be fixed soon')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mut name := p.lit
|
mut name := p.lit
|
||||||
p.fgen(name)
|
p.fgen(name)
|
||||||
// known_type := p.table.known_type(name)
|
// known_type := p.table.known_type(name)
|
||||||
|
@ -1840,7 +1835,6 @@ struct $typ.name {
|
||||||
}
|
}
|
||||||
if !p.builtin_mod && p.mod != typ.mod {
|
if !p.builtin_mod && p.mod != typ.mod {
|
||||||
}
|
}
|
||||||
// if p.pref.is_play && field.access_mod ==.private && !p.builtin_mod && p.mod != typ.mod {
|
|
||||||
// Don't allow `arr.data`
|
// Don't allow `arr.data`
|
||||||
if field.access_mod == .private && !p.builtin_mod && !p.pref.translated && p.mod != typ.mod {
|
if field.access_mod == .private && !p.builtin_mod && !p.pref.translated && p.mod != typ.mod {
|
||||||
// println('$typ.name :: $field.name ')
|
// println('$typ.name :: $field.name ')
|
||||||
|
|
|
@ -531,10 +531,6 @@ fn (p mut Parser) _check_types(got_, expected_ string, throw bool) bool {
|
||||||
}
|
}
|
||||||
// Todo void* allows everything right now
|
// Todo void* allows everything right now
|
||||||
if got=='void*' || expected=='void*' {// || got == 'cvoid' || expected == 'cvoid' {
|
if got=='void*' || expected=='void*' {// || got == 'cvoid' || expected == 'cvoid' {
|
||||||
// if !p.builtin_mod {
|
|
||||||
if p.pref.is_play {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// TODO only allow numeric consts to be assigned to bytes, and
|
// TODO only allow numeric consts to be assigned to bytes, and
|
||||||
|
@ -570,20 +566,18 @@ fn (p mut Parser) _check_types(got_, expected_ string, throw bool) bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
// NsColor* return 0
|
// NsColor* return 0
|
||||||
if !p.pref.is_play {
|
if expected.ends_with('*') && got == 'int' {
|
||||||
if expected.ends_with('*') && got == 'int' {
|
return true
|
||||||
return true
|
}
|
||||||
}
|
// if got == 'T' || got.contains('<T>') {
|
||||||
// if got == 'T' || got.contains('<T>') {
|
// return true
|
||||||
// return true
|
// }
|
||||||
// }
|
// if expected == 'T' || expected.contains('<T>') {
|
||||||
// if expected == 'T' || expected.contains('<T>') {
|
// return true
|
||||||
// return true
|
// }
|
||||||
// }
|
// Allow pointer arithmetic
|
||||||
// Allow pointer arithmetic
|
if expected=='void*' && got=='int' {
|
||||||
if expected=='void*' && got=='int' {
|
return true
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
expected = expected.replace('*', '')
|
expected = expected.replace('*', '')
|
||||||
got = got.replace('*', '')
|
got = got.replace('*', '')
|
||||||
|
|
Loading…
Reference in New Issue