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

fmt, parser: fix pos.last_line for assembly blocks (#10877)

This commit is contained in:
Lukas Neubert 2021-07-21 10:48:12 +02:00 committed by GitHub
parent aebb028349
commit 38100faecf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -22,3 +22,11 @@ fn y_with_attr() {
[typedef]
struct FooWithAttr {
}
fn between_assembly_blocks() {
asm amd64 {
}
asm i386 {
}
}

View File

@ -1067,7 +1067,7 @@ fn (mut p Parser) asm_stmt(is_top_level bool) ast.AsmStmt {
output: output
input: input
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
scope: scope
global_labels: global_labels