parser: support dot prefix for attributes (#12744)

pull/12746/head
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
1 changed files with 6 additions and 0 deletions

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()