mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: handle indents
This commit is contained in:
parent
2bd22aa4a4
commit
c36984cc94
@ -529,7 +529,11 @@ fn (f mut Fmt) expr(node ast.Expr) {
|
|||||||
f.write('_')
|
f.write('_')
|
||||||
} else {
|
} else {
|
||||||
name := short_module(it.name)
|
name := short_module(it.name)
|
||||||
|
//f.write('<$it.name => $name>')
|
||||||
f.write(name)
|
f.write(name)
|
||||||
|
if name.contains('.') {
|
||||||
|
f.mark_module_as_used(name)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ast.InfixExpr {
|
ast.InfixExpr {
|
||||||
@ -669,6 +673,7 @@ fn (f mut Fmt) expr(node ast.Expr) {
|
|||||||
}
|
}
|
||||||
ast.StructInit {
|
ast.StructInit {
|
||||||
type_sym := f.table.get_type_symbol(it.typ)
|
type_sym := f.table.get_type_symbol(it.typ)
|
||||||
|
//f.write('<old name: $type_sym.name>')
|
||||||
mut name := short_module(type_sym.name).replace(f.cur_mod + '.', '') // TODO f.type_to_str?
|
mut name := short_module(type_sym.name).replace(f.cur_mod + '.', '') // TODO f.type_to_str?
|
||||||
if name == 'void' {
|
if name == 'void' {
|
||||||
name = ''
|
name = ''
|
||||||
|
@ -3,5 +3,10 @@ import (
|
|||||||
os
|
os
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
mypi = math.pi
|
||||||
|
)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println(os.path_separator)
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
import math
|
import math
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
const (
|
||||||
|
mypi = math.pi
|
||||||
|
)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
println(os.path_separator)
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
import (
|
import (
|
||||||
math as m
|
|
||||||
os
|
os
|
||||||
math.complex as c
|
math
|
||||||
)
|
)
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// println(m.pi)
|
||||||
|
println(os.path_separator)
|
||||||
|
println(math.pi)
|
||||||
|
// math as m
|
||||||
|
// import math.complex as c
|
||||||
|
// num := c.Complex{} TODO
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
import math as m
|
|
||||||
import os
|
import os
|
||||||
import math.complex as c
|
import math
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// println(m.pi)
|
||||||
|
println(os.path_separator)
|
||||||
|
println(math.pi)
|
||||||
|
// math as m
|
||||||
|
// import math.complex as c
|
||||||
|
// num := c.Complex{} TODO
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user