fmt: handle indents
parent
2bd22aa4a4
commit
c36984cc94
|
@ -529,7 +529,11 @@ fn (f mut Fmt) expr(node ast.Expr) {
|
|||
f.write('_')
|
||||
} else {
|
||||
name := short_module(it.name)
|
||||
//f.write('<$it.name => $name>')
|
||||
f.write(name)
|
||||
if name.contains('.') {
|
||||
f.mark_module_as_used(name)
|
||||
}
|
||||
}
|
||||
}
|
||||
ast.InfixExpr {
|
||||
|
@ -669,6 +673,7 @@ fn (f mut Fmt) expr(node ast.Expr) {
|
|||
}
|
||||
ast.StructInit {
|
||||
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?
|
||||
if name == 'void' {
|
||||
name = ''
|
||||
|
|
|
@ -3,5 +3,10 @@ import (
|
|||
os
|
||||
)
|
||||
|
||||
const (
|
||||
mypi = math.pi
|
||||
)
|
||||
|
||||
fn main() {
|
||||
println(os.path_separator)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
import math
|
||||
import os
|
||||
|
||||
const (
|
||||
mypi = math.pi
|
||||
)
|
||||
|
||||
fn main() {
|
||||
println(os.path_separator)
|
||||
}
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
import (
|
||||
math as m
|
||||
os
|
||||
math.complex as c
|
||||
math
|
||||
)
|
||||
|
||||
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 math.complex as c
|
||||
import math
|
||||
|
||||
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…
Reference in New Issue