mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
json: custom json field names with "[json:field_name]"
This commit is contained in:
@@ -645,6 +645,10 @@ fn (p mut Parser) struct_decl() {
|
||||
if p.tok == .lsbr {
|
||||
p.next()
|
||||
attr = p.check_name()
|
||||
if p.tok == .colon {
|
||||
p.check(.colon)
|
||||
attr += ':' + p.check_name()
|
||||
}
|
||||
p.check(.rsbr)
|
||||
}
|
||||
if attr == 'raw' && field_type != 'string' {
|
||||
|
||||
Reference in New Issue
Block a user