vfmt: fix asm volatile & goto (#9688)
parent
a851901620
commit
273655ecc8
|
@ -668,7 +668,13 @@ fn expr_is_single_line(expr ast.Expr) bool {
|
|||
//=== Specific Stmt methods ===//
|
||||
|
||||
fn (mut f Fmt) asm_stmt(stmt ast.AsmStmt) {
|
||||
f.writeln('asm $stmt.arch {')
|
||||
f.write('asm ')
|
||||
if stmt.is_volatile {
|
||||
f.write('volatile ')
|
||||
} else if stmt.is_goto {
|
||||
f.write('goto ')
|
||||
}
|
||||
f.writeln('$stmt.arch {')
|
||||
f.indent++
|
||||
for template in stmt.templates {
|
||||
if template.is_directive {
|
||||
|
@ -678,7 +684,9 @@ fn (mut f Fmt) asm_stmt(stmt ast.AsmStmt) {
|
|||
if template.is_label {
|
||||
f.write(':')
|
||||
} else {
|
||||
f.write(' ')
|
||||
if template.args.len > 0 {
|
||||
f.write(' ')
|
||||
}
|
||||
}
|
||||
for i, arg in template.args {
|
||||
f.asm_arg(arg)
|
||||
|
|
Loading…
Reference in New Issue