1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

http: fix response headers and status code; clean up ft and gg

This commit is contained in:
Alexander Medvednikov
2019-08-05 10:42:58 +02:00
parent ff730b4eb0
commit 7a7b5040e2
11 changed files with 131 additions and 96 deletions

View File

@ -1059,7 +1059,7 @@ fn (p mut Parser) close_scope() {
// println('breaking. "$v.name" v.scope_level=$v.scope_level')
break
}
if !p.building_v && !v.is_mut && v.is_alloc {
if false && !p.building_v && !v.is_mut && v.is_alloc {
if v.typ.starts_with('array_') {
p.genln('v_array_free($v.name); // close_scope free')
}
@ -1729,17 +1729,17 @@ fn (p mut Parser) dot(str_typ string, method_ph int) string {
opt_type := typ.name.right(7)
p.error('unhandled option type: $opt_type?')
}
println('error in dot():')
println('fields:')
for field in typ.fields {
println(field.name)
}
println('methods:')
for field in typ.methods {
println(field.name)
}
println('str_typ=="$str_typ"')
p.error('type `$typ.name` has no field or method `$field_name`')
//println('error in dot():')
//println('fields:')
//for field in typ.fields {
//println(field.name)
//}
//println('methods:')
//for field in typ.methods {
//println(field.name)
//}
//println('str_typ=="$str_typ"')
p.error('type `$typ.name` has no field or method `$field_name`')
}
mut dot := '.'
if str_typ.contains('*') {

View File

@ -1,6 +1,19 @@
fn test_mut() {
a := 1
mut b := &a
*b = 10
println(a)
fn foo(a mut []int) {
a[0] = 7
a << 4
}
fn test_mut() {
mut a := [1,2,3]
foo(mut a)
assert a.len == 4
assert a[0] == 7
assert a[3] == 4
n := 1
mut b := &n
*b = 10
//mut b := mut a
//b = 10
}