diff options
| author | gingerBill <bill@gingerbill.org> | 2023-09-30 15:34:39 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2023-09-30 15:34:39 +0100 |
| commit | 14adcb9db89f4a668210a56d909cdca96088aae2 (patch) | |
| tree | 3f11a5d5ca0dd638387abc60e6cc50a8e1604d0c /core/text/i18n | |
| parent | 41a22bd83d9458249a60a9d1415f4862f1593b76 (diff) | |
Use `or_break` and `or_continue` where appropriate in the core library
Diffstat (limited to 'core/text/i18n')
| -rw-r--r-- | core/text/i18n/qt_linguist.odin | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/core/text/i18n/qt_linguist.odin b/core/text/i18n/qt_linguist.odin index f4d2d78d6..72eeb80ff 100644 --- a/core/text/i18n/qt_linguist.odin +++ b/core/text/i18n/qt_linguist.odin @@ -91,10 +91,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI // Find messages in section. nth: int for { - message_id, message_found := xml.find_child_by_ident(ts, child_id, "message", nth) - if !message_found { - break - } + message_id := xml.find_child_by_ident(ts, child_id, "message", nth) or_break numerus_tag, _ := xml.find_attribute_val_by_key(ts, message_id, "numerus") has_plurals := numerus_tag == "yes" @@ -131,10 +128,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI num_plurals: int for { - numerus_id, numerus_found := xml.find_child_by_ident(ts, translation_id, "numerusform", num_plurals) - if !numerus_found { - break - } + numerus_id := xml.find_child_by_ident(ts, translation_id, "numerusform", num_plurals) or_break num_plurals += 1 } @@ -145,10 +139,7 @@ parse_qt_linguist_from_bytes :: proc(data: []byte, options := DEFAULT_PARSE_OPTI num_plurals = 0 for { - numerus_id, numerus_found := xml.find_child_by_ident(ts, translation_id, "numerusform", num_plurals) - if !numerus_found { - break - } + numerus_id := xml.find_child_by_ident(ts, translation_id, "numerusform", num_plurals) or_break numerus := get_str(ts.elements[numerus_id].value[0]) or_return numerus, _ = strings.intern_get(&translation.intern, numerus) section[source][num_plurals] = numerus |