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

run vfmt on fn.v

This commit is contained in:
Alexander Medvednikov
2019-12-18 09:04:35 +03:00
parent 81045023c4
commit 569b32bd1e
6 changed files with 347 additions and 323 deletions

View File

@@ -853,6 +853,9 @@ fn (p &Parser) strtok() string {
return p.lit
}
if p.tok == .chartoken {
if p.lit == '`' {
return '`\\$p.lit`'
}
return '`$p.lit`'
}
if p.tok == .str {
@@ -964,7 +967,7 @@ fn (p mut Parser) get_type() string {
// Register anon fn type
fn_typ := Type{
name: f.typ_str() // 'fn (int, int) string'
mod: p.mod
func: f
}
@@ -2902,6 +2905,7 @@ fn (p mut Parser) attribute() {
fn (p mut Parser) defer_st() {
p.check(.key_defer)
p.fspace()
p.check(.lcbr)
pos := p.cgen.lines.len
// Save everything inside the defer block to `defer_text`.