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 ===//
|
//=== Specific Stmt methods ===//
|
||||||
|
|
||||||
fn (mut f Fmt) asm_stmt(stmt ast.AsmStmt) {
|
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++
|
f.indent++
|
||||||
for template in stmt.templates {
|
for template in stmt.templates {
|
||||||
if template.is_directive {
|
if template.is_directive {
|
||||||
|
@ -678,7 +684,9 @@ fn (mut f Fmt) asm_stmt(stmt ast.AsmStmt) {
|
||||||
if template.is_label {
|
if template.is_label {
|
||||||
f.write(':')
|
f.write(':')
|
||||||
} else {
|
} else {
|
||||||
f.write(' ')
|
if template.args.len > 0 {
|
||||||
|
f.write(' ')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for i, arg in template.args {
|
for i, arg in template.args {
|
||||||
f.asm_arg(arg)
|
f.asm_arg(arg)
|
||||||
|
|
Loading…
Reference in New Issue