mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vfmt: fix formatting of 'import mod as alias'
This commit is contained in:

committed by
Alexander Medvednikov

parent
286a0a1371
commit
222f2f08f6
@ -658,7 +658,9 @@ fn (p mut Parser) import_statement() {
|
||||
}
|
||||
// aliasing (import encoding.base64 as b64)
|
||||
if p.tok == .key_as && p.peek() == .name {
|
||||
p.fspace()
|
||||
p.check(.key_as)
|
||||
p.fspace()
|
||||
mod_alias = p.check_name()
|
||||
}
|
||||
// add import to file scope import table
|
||||
@ -1169,7 +1171,7 @@ fn (p mut Parser) get_type() string {
|
||||
}
|
||||
t = p.table.find_type(typ)
|
||||
if t.name == '' && !p.pref.translated && !p.first_pass() && !typ.starts_with('[') {
|
||||
println('get_type() bad type')
|
||||
// println('get_type() bad type')
|
||||
// println('all registered types:')
|
||||
// for q in p.table.types {
|
||||
// println(q.name)
|
||||
@ -1178,7 +1180,8 @@ fn (p mut Parser) get_type() string {
|
||||
if t_suggest.len > 0 {
|
||||
t_suggest = '. did you mean: ($tc_suggest) `$t_suggest`'
|
||||
}
|
||||
p.error('unknown type `$typ`$t_suggest')
|
||||
econtext := if p.pref.is_debug { '('+@FILE+':'+@LINE+')' } else {''}
|
||||
p.error('unknown type `$typ`$t_suggest $econtext')
|
||||
}
|
||||
}
|
||||
else if !t.is_public && t.mod != p.mod && !p.is_vgen && t.name != '' && !p.first_pass() {
|
||||
|
Reference in New Issue
Block a user