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

compiler: let attributes work with pub functions

This commit is contained in:
joe-conigliaro 2019-09-18 22:32:55 +10:00 committed by Alexander Medvednikov
parent 040d03912b
commit 695d4018ea

View File

@ -3632,7 +3632,7 @@ fn (p mut Parser) attribute() {
p.attr = p.check_name() p.attr = p.check_name()
} }
p.check(.rsbr) p.check(.rsbr)
if p.tok == .func { if p.tok == .func || (p.tok == .key_pub && p.peek() == .func) {
p.fn_decl() p.fn_decl()
p.attr = '' p.attr = ''
return return