parser: fix last_line of no body C struct (#9809)

pull/9833/head
Lukas Neubert 2021-04-20 20:37:00 +02:00 committed by GitHub
parent 7abf59710b
commit 2df260acbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -58,3 +58,5 @@ pub:
14 14
*/ */
} }
struct C.Foo {}

View File

@ -61,3 +61,5 @@ somefield4 int
14 14
*/ */
} }
struct C.Foo

View File

@ -96,7 +96,7 @@ fn (mut p Parser) struct_decl() ast.StructDecl {
mut is_field_mut := false mut is_field_mut := false
mut is_field_pub := false mut is_field_pub := false
mut is_field_global := false mut is_field_global := false
mut last_line := -1 mut last_line := p.prev_tok.position().line_nr + 1
mut end_comments := []ast.Comment{} mut end_comments := []ast.Comment{}
if !no_body { if !no_body {
p.check(.lcbr) p.check(.lcbr)