mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: add support for goto
This commit is contained in:
parent
c6107276df
commit
78c885d657
@ -195,6 +195,12 @@ fn (f mut Fmt) stmt(node ast.Stmt) {
|
||||
f.stmts(it.stmts)
|
||||
f.writeln('}')
|
||||
}
|
||||
ast.GotoLabel {
|
||||
f.writeln('$it.name:')
|
||||
}
|
||||
ast.GotoStmt {
|
||||
f.writeln('goto $it.name')
|
||||
}
|
||||
ast.LineComment {
|
||||
f.writeln('// $it.text')
|
||||
}
|
||||
|
@ -3,9 +3,11 @@ fn hello() {
|
||||
a = 10
|
||||
a++
|
||||
-23
|
||||
goto lbl
|
||||
b := 42
|
||||
println('hello')
|
||||
abc()
|
||||
lbl:
|
||||
if true {
|
||||
a = 10
|
||||
a++
|
||||
|
@ -4,9 +4,11 @@ fn hello()
|
||||
a = 10
|
||||
a++
|
||||
-23
|
||||
goto lbl
|
||||
b:= 42
|
||||
println( 'hello' )
|
||||
abc()
|
||||
lbl:
|
||||
if true {
|
||||
a = 10
|
||||
a++
|
||||
|
Loading…
Reference in New Issue
Block a user