fmt, parser: fix pos.last_line for assembly blocks (#10877)
parent
aebb028349
commit
38100faecf
|
@ -22,3 +22,11 @@ fn y_with_attr() {
|
||||||
[typedef]
|
[typedef]
|
||||||
struct FooWithAttr {
|
struct FooWithAttr {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn between_assembly_blocks() {
|
||||||
|
asm amd64 {
|
||||||
|
}
|
||||||
|
|
||||||
|
asm i386 {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ fn (mut p Parser) asm_stmt(is_top_level bool) ast.AsmStmt {
|
||||||
output: output
|
output: output
|
||||||
input: input
|
input: input
|
||||||
clobbered: clobbered
|
clobbered: clobbered
|
||||||
pos: pos.extend(p.tok.position())
|
pos: pos.extend(p.prev_tok.position())
|
||||||
is_basic: is_top_level || output.len + input.len + clobbered.len == 0
|
is_basic: is_top_level || output.len + input.len + clobbered.len == 0
|
||||||
scope: scope
|
scope: scope
|
||||||
global_labels: global_labels
|
global_labels: global_labels
|
||||||
|
|
Loading…
Reference in New Issue