mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
Add support for raw json fields in structs
This commit is contained in:
committed by
Alexander Medvednikov
parent
100bb7c54c
commit
79c727f014
@@ -645,6 +645,9 @@ fn (p mut Parser) struct_decl() {
|
||||
attr = p.check_name()
|
||||
p.check(.rsbr)
|
||||
}
|
||||
if attr == 'raw' && field_type != 'string' {
|
||||
p.error('struct field with attribute "raw" should be of type "string" but got "$field_type"')
|
||||
}
|
||||
did_gen_something = true
|
||||
|
||||
typ.add_field(field_name, field_type, is_mut, attr, access_mod)
|
||||
|
||||
Reference in New Issue
Block a user