v2 / vlib / v / tests / project_issue_26873 / escaped_keyword_attr.v
31 lines · 26 sloc · 340 bytes · 80536d68d80dee2617feadebd55c073fe349ac3e
Raw
1module main
2
3pub enum ContentType {
4 none
5 block
6 inline
7}
8
9pub struct Content {
10pub:
11 @type ContentType
12 data string
13}
14
15@[params]
16struct Options {
17 path string @[required]
18}
19
20fn new_content(data string) Content {
21 return Content{
22 @type: .block
23 data: data
24 }
25}
26
27fn make_options(opts Options) Options {
28 return Options{
29 ...opts
30 }
31}
32