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

parser: support dot prefix for attributes (#12744)

This commit is contained in:
Tim Basel 2021-12-06 23:32:29 +01:00 committed by GitHub
parent 36fbd3c4fa
commit 6d14275106
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1587,6 +1587,12 @@ fn (mut p Parser) parse_attr() ast.Attr {
p.next()
} else {
name = p.check_name()
// support dot prefix `module.name: arg`
if p.tok.kind == .dot {
p.next()
name += '.'
name += p.check_name()
}
if p.tok.kind == .colon {
has_arg = true
p.next()