update match statement

This commit is contained in:
Alexander Medvednikov 2019-10-23 00:56:25 +03:00
parent 4574039e4d
commit 9743b04fe6
3 changed files with 21 additions and 17 deletions

View file

@ -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 { ... }
}'
)