diff --git a/vlib/v/fmt/tests/newlines_keep.vv b/vlib/v/fmt/tests/newlines_keep.vv index 01665c0d50..7d70d56af7 100644 --- a/vlib/v/fmt/tests/newlines_keep.vv +++ b/vlib/v/fmt/tests/newlines_keep.vv @@ -22,3 +22,11 @@ fn y_with_attr() { [typedef] struct FooWithAttr { } + +fn between_assembly_blocks() { + asm amd64 { + } + + asm i386 { + } +} diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 4928f25a17..2e6cc7d894 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -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