comboctl-parser: Handle percent symbol in some TBR percentage screens

Some TBR percentage screens like the Lithuanian one show a % symbol
right after the text. Add an optional symbol parser to handle it.

Signed-off-by: Carlos Rafael Giani <crg7475@mailbox.org>
This commit is contained in:
Carlos Rafael Giani 2023-03-08 20:41:45 +01:00
parent dbe72e72da
commit 3f3884e513

View file

@ -1240,6 +1240,7 @@ class TemporaryBasalRatePercentageScreenParser : Parser() {
override fun parseImpl(parseContext: ParseContext): ParseResult {
val parseResult = SequenceParser(
listOf(
OptionalParser(SingleGlyphParser(Glyph.SmallSymbol(SmallSymbol.PERCENT))),
SingleGlyphParser(Glyph.LargeSymbol(LargeSymbol.BASAL)),
OptionalParser(IntegerParser()), // TBR percentage
SingleGlyphParser(Glyph.LargeSymbol(LargeSymbol.PERCENT)),