You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gura is no longer available with recent V compilers.
What did you expect to see?
C:/Users/keito/.vmodules/gura/debug.v:4:1: notice: `[attr]` has been deprecated, use `@[attr]` instead
2 |
3 | // rule_debug is a helper function to debug parser calls
4 | [inline]
| ^
5 | fn rule_debug(rule string) {
6 | debug('Parsing rule $rule')
C:/Users/keito/.vmodules/gura/debug.v:9:1: notice: `[attr]` has been deprecated, use `@[attr]` instead
7 | }
8 |
9 | [inline]
| ^
10 | fn match_rule_debug(matched bool, msg string) {
11 | debug(if matched { ' MATCHED $msg' } else { ' DIDN\'T MATCH $msg' })
C:/Users/keito/.vmodules/gura/debug.v:15:1: notice: `[attr]` has been deprecated, use `@[attr]` instead
13 |
14 | // debug is a helper function to print debug info
15 | [inline]
| ^
16 | fn debug(info string) {
17 | $if debug ? {
C:/Users/keito/.vmodules/gura/result.v:49:1: notice: `[attr]` has been deprecated, use `@[attr]` instead
47 |
48 | // MatchResult is the match result implementation
49 | [heap]
| ^
50 | struct MatchResult {
51 | result_type MatchResultType
C:/Users/keito/.vmodules/gura/any.v:210:8: warning: unused variable: `i`
208 | []Any {
209 | mut ret := '['
210 | for i, v in value {
| ^
211 | ret += '${v.str_with_indentation(indentation_level)},'
212 | }
C:/Users/keito/.vmodules/gura/any.v:37:4: error: Option and Result types have been split, use `!Foo` to return errors
35 | if key_split[0] in m.keys() {
36 | value := m[key_split[0]] or {
37 | return error(@MOD + '.' + @STRUCT + '.' + @FN + ' key "$key" does not exist')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | }
39 | // `match` isn't currently very suitable for these types of sum type constructs...
C:/Users/keito/.vmodules/gura/any.v:50:2: error: Option and Result types have been split, use `!Foo` to return errors
48 | return value
49 | }
50 | return error(@MOD + '.' + @STRUCT + '.' + @FN + ' key "$key" does not exist')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 | }
52 |
C:/Users/keito/.vmodules/gura/errors.v:28:1: error: Option and Result types have been split, use `!Foo` to return errors
26 | }
27 | // if it is not a ParseError, return it to stop parsing
28 | return err
| ~~~~~~~~~~
29 | }
30 |
C:/Users/keito/.vmodules/gura/gura.v:30:4: error: Option and Result types have been split, use `!Foo` to return errors
28 | if result := gp.run() {
29 | if !gp.is_end() {
30 | return new_parse_error(gp.pos + 1, gp.line, 'Expected end of string but got ${gp.text[
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
31 | gp.pos + 1..gp.pos + 2]}')
32 | }
C:/Users/keito/.vmodules/gura/gura.v:35:3: error: Option and Result types have been split, use `!Foo` to return errors
33 | return result
34 | } else {
35 | return err
| ~~~~~~~~~~
36 | }
37 | }
C:/Users/keito/.vmodules/gura/gura.v:62:4: error: Option and Result types have been split, use `!Foo` to return errors
60 | break
61 | }
62 | return err
| ~~~~~~~~~~
63 | }
64 | }
C:/Users/keito/.vmodules/gura/gura.v:78:4: error: Option and Result types have been split, use `!Foo` to return errors
76 | // files can be imported only once.This prevents circular reference
77 | if file_path in gp.imported_files {
78 | return new_duplicated_import_error('file $file_path has been already imported')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79 | }
80 |
C:/Users/keito/.vmodules/gura/gura.v:83:4: error: Option and Result types have been split, use `!Foo` to return errors
81 | // checks if file exists
82 | if !os.is_file(file_path) {
83 | return new_file_not_found_error('file $file_path does not exists')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 | }
85 |
C:/Users/keito/.vmodules/gura/gura.v:86:43: error: Option and Result types have been split, use `!Foo` to return errors
84 | }
85 |
86 | content := os.read_file(file_path) or { return err }
| ~~~~~~~~~~
87 | mut aux_parser := GuraParser{}
88 | next_parent_dir_path := os.dir(file_path)
C:/Users/keito/.vmodules/gura/gura.v:111:4: error: Option and Result types have been split, use `!Foo` to return errors
109 | break
110 | }
111 | return err
| ~~~~~~~~~~
112 | }
113 | }
C:/Users/keito/.vmodules/gura/gura.v:129:2: error: Option and Result types have been split, use `!Foo` to return errors
127 | }
128 |
129 | return new_variable_not_defined_error(key, 'Variable $key is not defined in Gura nor as env variable')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130 | }
131 |
C:/Users/keito/.vmodules/gura/parser.v:29:5: error: Option and Result types have been split, use `!Foo` to return errors
27 | if idx + 2 < len && chars[idx + 1] == `-` {
28 | if chars[idx] >= chars[idx + 2] {
29 | return error('Bad character error')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 | }
31 |
C:/Users/keito/.vmodules/gura/parser.v:60:3: error: Option and Result types have been split, use `!Foo` to return errors
58 | if p.is_end() {
59 | expected_str := if chars == '' { 'character' } else { '[$chars]' }
60 | return new_parse_error(p.pos + 1, p.line, 'Expected $expected_str but got end of string')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61 | }
62 | next_char := p.text[p.pos + 1..p.pos + 2]
C:/Users/keito/.vmodules/gura/parser.v:82:3: error: Option and Result types have been split, use `!Foo` to return errors
80 | }
81 | } else {
82 | return err
| ~~~~~~~~~~
83 | }
84 |
C:/Users/keito/.vmodules/gura/parser.v:85:2: error: Option and Result types have been split, use `!Foo` to return errors
83 | }
84 |
85 | return new_parse_error(p.pos + 1, p.line, 'Expected [$chars] but got $next_char')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86 | }
87 |
C:/Users/keito/.vmodules/gura/parser.v:96:3: error: Option and Result types have been split, use `!Foo` to return errors
94 | fn (mut p Parser) keyword(keywords ...string) ?string {
95 | if p.is_end() {
96 | return new_parse_error(p.pos + 1, p.line, 'Expected ${keywords.join(',')} but got end of string')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97 | }
98 |
C:/Users/keito/.vmodules/gura/parser.v:114:2: error: Option and Result types have been split, use `!Foo` to return errors
112 | }
113 |
114 | return new_parse_error(p.pos + 1, p.line, 'Expected [${keywords.join(',')}] but got ${p.text.runes()[
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
115 | p.pos + 1..p.pos + 2]}')
116 | }
C:/Users/keito/.vmodules/gura/parser.v:149:4: error: Option and Result types have been split, use `!Foo` to return errors
147 | } else {
148 | // if it is not a ParseError, return it to stop parsing
149 | return err
| ~~~~~~~~~~
150 | }
151 | }
C:/Users/keito/.vmodules/gura/parser.v:155:3: error: Option and Result types have been split, use `!Foo` to return errors
153 |
154 | if last_error_rules.len == 1 {
155 | return last_error
| ~~~~~~~~~~~~~~~~~
156 | }
157 |
C:/Users/keito/.vmodules/gura/parser.v:159:2: error: Option and Result types have been split, use `!Foo` to return errors
157 |
158 | last_error_pos = math.min(p.text.len - 1, last_error_pos)
159 | return new_parse_error(last_error_pos, p.line, 'Expected $last_error_rules.str() but got ${p.text[last_error_pos]}')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
160 | }
161 |
C:/Users/keito/.vmodules/gura/stmt.v:41:5: error: Option and Result types have been split, use `!Foo` to return errors
39 | if blank := gp.maybe_keyword(' ', '\t') {
40 | if blank == '\t' {
41 | return new_invalid_indentation_error('Tabs are not allowed to define indentation blocks')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 | }
43 |
C:/Users/keito/.vmodules/gura/stmt.v:50:5: error: Option and Result types have been split, use `!Foo` to return errors
48 | break
49 | } else {
50 | return err
| ~~~~~~~~~~
51 | }
52 | }
C:/Users/keito/.vmodules/gura/stmt.v:72:4: error: Option and Result types have been split, use `!Foo` to return errors
70 | break
71 | }
72 | return err
| ~~~~~~~~~~
73 | }
74 | }
C:/Users/keito/.vmodules/gura/stmt.v:92:4: error: Option and Result types have been split, use `!Foo` to return errors
90 | break
91 | }
92 | return err
| ~~~~~~~~~~
93 | }
94 | }
C:/Users/keito/.vmodules/gura/stmt.v:111:4: error: Option and Result types have been split, use `!Foo` to return errors
109 | } else {
110 | if err !is none {
111 | return err
| ~~~~~~~~~~
112 | }
113 | }
C:/Users/keito/.vmodules/gura/stmt.v:152:4: error: Option and Result types have been split, use `!Foo` to return errors
150 | } else {
151 | if err !is none {
152 | return err
| ~~~~~~~~~~
153 | }
154 | }
C:/Users/keito/.vmodules/gura/stmt.v:167:4: error: Option and Result types have been split, use `!Foo` to return errors
165 | } else {
166 | if err !is none {
167 | return err
| ~~~~~~~~~~
168 | }
169 | }
C:/Users/keito/.vmodules/gura/stmt.v:204:4: error: Option and Result types have been split, use `!Foo` to return errors
202 | } else {
203 | if err !is none {
204 | return err
| ~~~~~~~~~~
205 | }
206 | }
C:/Users/keito/.vmodules/gura/stmt.v:212:3: error: Option and Result types have been split, use `!Foo` to return errors
210 |
211 | if matched_key in gp.variables {
212 | return new_duplicated_variable_error('Variable $matched_key has been already declared')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213 | }
214 |
C:/Users/keito/.vmodules/gura/stmt.v:230:4: error: Option and Result types have been split, use `!Foo` to return errors
228 | } else {
229 | if err !is none {
230 | return err
| ~~~~~~~~~~
231 | }
232 | }
C:/Users/keito/.vmodules/gura/stmt.v:242:5: error: Option and Result types have been split, use `!Foo` to return errors
240 | } else {
241 | if err !is none {
242 | return err
| ~~~~~~~~~~
243 | }
244 | }
C:/Users/keito/.vmodules/gura/stmt.v:260:6: error: Option and Result types have been split, use `!Foo` to return errors
258 | } else {
259 | if err !is none {
260 | return err
| ~~~~~~~~~~
261 | }
262 | }
C:/Users/keito/.vmodules/gura/stmt.v:267:6: error: Option and Result types have been split, use `!Foo` to return errors
265 | } else {
266 | if err !is none {
267 | return err
| ~~~~~~~~~~
268 | }
269 | }
C:/Users/keito/.vmodules/gura/stmt.v:276:6: error: Option and Result types have been split, use `!Foo` to return errors
274 | break
275 | } else {
276 | return err
| ~~~~~~~~~~
277 | }
278 | }
C:/Users/keito/.vmodules/gura/stmt.v:283:4: error: Option and Result types have been split, use `!Foo` to return errors
281 | break
282 | }
283 | return err
| ~~~~~~~~~~
284 | }
285 | }
C:/Users/keito/.vmodules/gura/stmt.v:291:4: error: Option and Result types have been split, use `!Foo` to return errors
289 | } else {
290 | if err !is none {
291 | return err
| ~~~~~~~~~~
292 | }
293 | }
C:/Users/keito/.vmodules/gura/stmt.v:298:4: error: Option and Result types have been split, use `!Foo` to return errors
296 | } else {
297 | if err !is none {
298 | return err
| ~~~~~~~~~~
299 | }
300 | }
C:/Users/keito/.vmodules/gura/stmt.v:315:4: error: Option and Result types have been split, use `!Foo` to return errors
313 | } else {
314 | if err !is none {
315 | return err
| ~~~~~~~~~~
316 | }
317 | }
C:/Users/keito/.vmodules/gura/stmt.v:323:4: error: Option and Result types have been split, use `!Foo` to return errors
321 | } else {
322 | if err !is none {
323 | return err
| ~~~~~~~~~~
324 | }
325 | }
C:/Users/keito/.vmodules/gura/stmt.v:330:3: error: Option and Result types have been split, use `!Foo` to return errors
328 |
329 | if !is_comment && !is_new_line {
330 | return new_parse_error(gp.pos + 1, gp.line, 'It is a valid line')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
331 | }
332 |
C:/Users/keito/.vmodules/gura/stmt.v:355:6: error: Option and Result types have been split, use `!Foo` to return errors
353 |
354 | if key in result {
355 | return new_duplicated_variable_error('the key $key has been already defined')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
356 | }
357 |
C:/Users/keito/.vmodules/gura/stmt.v:365:4: error: Option and Result types have been split, use `!Foo` to return errors
363 | break
364 | }
365 | return err
| ~~~~~~~~~~
366 | }
367 |
C:/Users/keito/.vmodules/gura/stmt.v:375:5: error: Option and Result types have been split, use `!Foo` to return errors
373 | } else {
374 | if err !is none {
375 | return err
| ~~~~~~~~~~
376 | }
377 | }
C:/Users/keito/.vmodules/gura/stmt.v:399:4: error: Option and Result types have been split, use `!Foo` to return errors
397 | } else {
398 | if err is none {
399 | return new_parse_error(gp.pos + 1, gp.line, 'Expected string but got ${gp.text[gp.pos +
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
400 | 1..]}')
401 | }
C:/Users/keito/.vmodules/gura/stmt.v:402:3: error: Option and Result types have been split, use `!Foo` to return errors
400 | 1..]}')
401 | }
402 | return err
| ~~~~~~~~~~
403 | }
404 | }
C:/Users/keito/.vmodules/gura/stmt.v:423:4: error: Option and Result types have been split, use `!Foo` to return errors
421 | } else {
422 | if err !is none {
423 | return err
| ~~~~~~~~~~
424 | }
425 | }
C:/Users/keito/.vmodules/gura/stmt.v:429:3: error: Option and Result types have been split, use `!Foo` to return errors
427 | // check if indentation is divisible by 4
428 | if current_identation_level % 4 != 0 {
429 | return new_invalid_indentation_error('indentation block ($current_identation_level) must be divisible by 4')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
430 | }
431 |
C:/Users/keito/.vmodules/gura/stmt.v:449:4: error: Option and Result types have been split, use `!Foo` to return errors
447 | gp.indentation_levels << current_identation_level
448 | } else {
449 | return err
| ~~~~~~~~~~
450 | }
451 | }
C:/Users/keito/.vmodules/gura/stmt.v:463:5: error: Option and Result types have been split, use `!Foo` to return errors
461 |
462 | if indentation_level == current_identation_level {
463 | return new_invalid_indentation_error('wrong level for parent with key $key_str')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
464 | } else if int(math.abs(current_identation_level - indentation_level)) != 4 {
465 | return new_invalid_indentation_error('difference between different indentation levels must be 4 $current_identation_level $indentation_level')
C:/Users/keito/.vmodules/gura/stmt.v:465:5: error: Option and Result types have been split, use `!Foo` to return errors
463 | return new_invalid_indentation_error('wrong level for parent with key $key_str')
464 | } else if int(math.abs(current_identation_level - indentation_level)) != 4 {
465 | return new_invalid_indentation_error('difference between different indentation levels must be 4 $current_identation_level $indentation_level')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466 | }
467 |
C:/Users/keito/.vmodules/gura/stmt.v:478:6: error: Option and Result types have been split, use `!Foo` to return errors
476 | } else {
477 | if err !is none {
478 | return err
| ~~~~~~~~~~
479 | }
480 | }
C:/Users/keito/.vmodules/gura/stmt.v:496:5: error: Option and Result types have been split, use `!Foo` to return errors
494 | } else {
495 | if err !is none {
496 | return err
| ~~~~~~~~~~
497 | }
498 | }
C:/Users/keito/.vmodules/gura/stmt.v:504:4: error: Option and Result types have been split, use `!Foo` to return errors
502 | } else {
503 | if err is none {
504 | return new_parse_error(gp.pos + 1, gp.line, 'invalid pair')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
505 | } else {
506 | return err
C:/Users/keito/.vmodules/gura/stmt.v:506:4: error: Option and Result types have been split, use `!Foo` to return errors
504 | return new_parse_error(gp.pos + 1, gp.line, 'invalid pair')
505 | } else {
506 | return err
| ~~~~~~~~~~
507 | }
508 | }
C:/Users/keito/.vmodules/gura/stmt.v:551:5: error: Option and Result types have been split, use `!Foo` to return errors
549 | break
550 | } else {
551 | return err
| ~~~~~~~~~~
552 | }
553 | }
C:/Users/keito/.vmodules/gura/stmt.v:579:5: error: Option and Result types have been split, use `!Foo` to return errors
577 | break
578 | } else {
579 | return err
| ~~~~~~~~~~
580 | }
581 | }
C:/Users/keito/.vmodules/gura/stmt.v:602:3: error: Option and Result types have been split, use `!Foo` to return errors
600 | return new_match_result_with_value(.primitive, number.int())
601 | }
602 | return new_parse_error(gp.pos + 1, gp.line, '$number is not a number')
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
603 | }
604 |
C:/Users/keito/.vmodules/gura/stmt.v:621:5: error: Option and Result types have been split, use `!Foo` to return errors
619 | } else {
620 | if err !is none {
621 | return err
| ~~~~~~~~~~
622 | }
623 | }
C:/Users/keito/.vmodules/gura/stmt.v:633:5: error: Option and Result types have been split, use `!Foo` to return errors
631 | } else {
632 | if err !is none {
633 | return err
| ~~~~~~~~~~
634 | }
635 | }
C:/Users/keito/.vmodules/gura/stmt.v:655:70: error: Option and Result types have been split, use `!Foo` to return errors
653 | code_point << code_point_char
654 | }
655 | hex_value := strconv.parse_int(code_point.join(''), 16, 0) or { return err }
| ~~~~~~~~~~
656 | // @todo: String.fromCharCode(hexValue) // converts from UNICODE to string
657 | char_value := hex_value.str()
C:/Users/keito/.vmodules/gura/stmt.v:692:5: error: Option and Result types have been split, use `!Foo` to return errors
690 | } else {
691 | if err !is none {
692 | return err
| ~~~~~~~~~~
693 | }
694 | }
C:/Users/keito/.vmodules/gura/stmt.v:704:5: error: Option and Result types have been split, use `!Foo` to return errors
702 | } else {
703 | if err !is none {
704 | return err
| ~~~~~~~~~~
705 | }
706 | }
examples/main.v:54:43: error: Option and Result types have been split, use `!Foo` to return errors
52 | fn example() ? {
53 | file_path := os.join_path(@VMODROOT, 'examples', 'example.ura')
54 | gura_str := os.read_file(file_path) or { return err }
| ~~~~~~~~~~
55 |
56 | d := gura.raw_parse(gura_str)?
What did you see instead?
The text was updated successfully, but these errors were encountered:
vgura version: 0.1.10
OS: Windows 11
What did you do?
Gura is no longer available with recent V compilers.
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: