mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
update match statement
This commit is contained in:
parent
4574039e4d
commit
9743b04fe6
3 changed files with 21 additions and 17 deletions
|
@ -135,7 +135,7 @@ fn (s &Scanner) get_error_filepath() string {
|
|||
if s.should_print_relative_paths_on_error {
|
||||
workdir := os.getwd() + os.path_separator
|
||||
if s.file_path.starts_with(workdir) {
|
||||
return s.file_path.replace( workdir, '')
|
||||
return s.file_path.replace( workdir, '')
|
||||
}
|
||||
return s.file_path
|
||||
}
|
||||
|
@ -269,3 +269,12 @@ fn (s mut Scanner) eat_single_newline(){
|
|||
if s.text[ s.pos ] == `\n` { s.pos ++ return }
|
||||
if s.text[ s.pos ] == `\r` { s.pos ++ return }
|
||||
}
|
||||
|
||||
const (
|
||||
match_arrow_warning = '=> is no longer needed in match statements, use\n' +
|
||||
'match foo {
|
||||
1 { bar }
|
||||
2 { baz }
|
||||
else { ... }
|
||||
}'
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue