summaryrefslogtreecommitdiff
path: root/tools/Scanner
diff options
context:
space:
mode:
authorHannes Schulze <contact@haschu.me>2026-04-10 17:36:15 +0200
committerHannes Schulze <contact@haschu.me>2026-04-10 17:36:15 +0200
commitdab858e92dfa5705d1aef7259e03b25747372d95 (patch)
treea08fa2d015adda6a718b4abc5ece2648a6247735 /tools/Scanner
parentbfe6c4cee8b5afcd4078af319ab6b96f6695408b (diff)
implement registry wrapper
Diffstat (limited to 'tools/Scanner')
-rw-r--r--tools/Scanner/Parser.lean16
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/Scanner/Parser.lean b/tools/Scanner/Parser.lean
index 7b64822..bb89648 100644
--- a/tools/Scanner/Parser.lean
+++ b/tools/Scanner/Parser.lean
@@ -44,16 +44,16 @@ private def Element.textContent (el : Xml.Element) : String :=
|> String.intercalate "\n"
|>.trimAscii
|>.toString
- reformat <| String.join <| Array.toList <| el.content.flatMap fun
- | .Element _ => #[]
- | .Comment _ => #[]
- | .Character s => #[s]
+ reformat <| String.join <| Array.toList <| el.content.filterMap fun
+ | .Element _ => .none
+ | .Comment _ => .none
+ | .Character s => .some s
private def Element.getChildrenByName (el : Xml.Element) (name : String) : Array Xml.Element :=
- el.content.flatMap fun
- | .Element child => if child.name == name then #[child] else #[]
- | .Comment _ => #[]
- | .Character _ => #[]
+ el.content.filterMap fun
+ | .Element child => if child.name == name then .some child else .none
+ | .Comment _ => .none
+ | .Character _ => .none
private def Element.getChildByName (el : Xml.Element) (name : String) : Option Xml.Element :=
match el.getChildrenByName name with