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

enable [if vfmt]

This commit is contained in:
Alexander Medvednikov 2019-10-27 12:16:33 +03:00
parent d00fdca38f
commit 293cf18266

View File

@ -7,7 +7,7 @@ module compiler
import strings import strings
// fmt helpers // fmt helpers
//[if vfmt] [if vfmt]
fn (scanner mut Scanner) fgen(s_ string) { fn (scanner mut Scanner) fgen(s_ string) {
mut s := s_ mut s := s_
if scanner.fmt_line_empty { if scanner.fmt_line_empty {
@ -17,7 +17,7 @@ fn (scanner mut Scanner) fgen(s_ string) {
scanner.fmt_line_empty = false scanner.fmt_line_empty = false
} }
//[if vfmt] [if vfmt]
fn (scanner mut Scanner) fgenln(s_ string) { fn (scanner mut Scanner) fgenln(s_ string) {
mut s := s_ mut s := s_
if scanner.fmt_line_empty { if scanner.fmt_line_empty {
@ -27,17 +27,17 @@ fn (scanner mut Scanner) fgenln(s_ string) {
scanner.fmt_line_empty = true scanner.fmt_line_empty = true
} }
//[if vfmt] [if vfmt]
fn (p mut Parser) fgen(s string) { fn (p mut Parser) fgen(s string) {
p.scanner.fgen(s) p.scanner.fgen(s)
} }
//[if vfmt] [if vfmt]
fn (p mut Parser) fspace() { fn (p mut Parser) fspace() {
p.fgen(' ') p.fgen(' ')
} }
//[if vfmt] [if vfmt]
fn (p mut Parser) fgenln(s string) { fn (p mut Parser) fgenln(s string) {
p.scanner.fgenln(s) p.scanner.fgenln(s)
} }
@ -55,12 +55,12 @@ fn (p mut Parser) peek() TokenKind {
} }
*/ */
//[if vfmt] [if vfmt]
fn (p mut Parser) fmt_inc() { fn (p mut Parser) fmt_inc() {
p.scanner.fmt_indent++ p.scanner.fmt_indent++
} }
//[if vfmt] [if vfmt]
fn (p mut Parser) fmt_dec() { fn (p mut Parser) fmt_dec() {
p.scanner.fmt_indent-- p.scanner.fmt_indent--
} }