parser: fix InterfaceDecl's position (#9649)

pull/9653/head
Ned Palacios 2021-04-09 23:18:22 +08:00 committed by GitHub
parent 0c710ce470
commit 6948419595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -1,3 +1,3 @@
vlib/v/checker/tests/incorrect_name_interface.vv:1:1: error: interface name `_MyInterface` must begin with capital letter
1 | interface _MyInterface {}
| ~~~~~~~~~
| ~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -571,7 +571,7 @@ fn (mut p Parser) interface_decl() ast.InterfaceDecl {
ts.info = info
p.top_level_statement_end()
p.check(.rcbr)
pos.update_last_line(p.prev_tok.line_nr)
pos = pos.extend_with_last_line(p.prev_tok.position(), p.prev_tok.line_nr)
return ast.InterfaceDecl{
name: interface_name
fields: fields