Use 'when' expression
This commit is contained in:
parent
11fa4f548c
commit
7b57090564
@ -9,8 +9,9 @@ HELP := "
|
||||
file := use ./file.tm
|
||||
|
||||
func parse_ini(filename:Text)->{Text:{Text:Text}}:
|
||||
when file.read(filename) is Failure(err): fail(err)
|
||||
is Success(text):
|
||||
text := when file.read(filename) is Failure(err): fail(err)
|
||||
is Success(text): text
|
||||
|
||||
sections := {:Text:@{Text:Text}}
|
||||
current_section := @{:Text:Text}
|
||||
sections:set("", current_section)
|
||||
|
Loading…
Reference in New Issue
Block a user