Use 'when' expression

This commit is contained in:
Bruce Hill 2024-09-06 14:16:45 -04:00
parent 11fa4f548c
commit 7b57090564

View File

@ -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)