| 1 | import regex |
| 2 | |
| 3 | struct RegexCache { |
| 4 | mut: |
| 5 | tag_script_start regex.RE = regex.regex_opt(r'^script.*>') or { panic(err) } |
| 6 | } |
| 7 | |
| 8 | pub struct Tokenizer { |
| 9 | mut: |
| 10 | regex_cache RegexCache = RegexCache{} |
| 11 | } |
| 12 | |
| 13 | fn new_parser() &Parser { |
| 14 | mut parser := &Parser{} |
| 15 | return parser |
| 16 | } |
| 17 | |
| 18 | pub struct Parser { |
| 19 | mut: |
| 20 | tnzr Tokenizer |
| 21 | } |
| 22 | |
| 23 | fn test_struct_field_default_value_optional() { |
| 24 | p := new_parser() |
| 25 | println(p) |
| 26 | assert true |
| 27 | } |
| 28 |