diff options
| author | rebortg <github@ghlr.de> | 2025-01-13 20:12:23 +0000 |
|---|---|---|
| committer | rebortg <github@ghlr.de> | 2025-01-13 20:13:55 +0000 |
| commit | 6148a0e0379df62aaa8fd96b895021c9928a2a23 (patch) | |
| tree | 0b6beea63c8e96f7a9fe30d73f32b5c5147fb0e1 /src/reference_tree.ml | |
| parent | 80a79c9bc90fefa59b6e1a26684aa5dac0638a4f (diff) | |
| download | vyos1x-config-6148a0e0379df62aaa8fd96b895021c9928a2a23.tar.gz vyos1x-config-6148a0e0379df62aaa8fd96b895021c9928a2a23.zip | |
T6342: formating and delete trailing whitespace
Diffstat (limited to 'src/reference_tree.ml')
| -rw-r--r-- | src/reference_tree.ml | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/reference_tree.ml b/src/reference_tree.ml index fc90bcc..874991d 100644 --- a/src/reference_tree.ml +++ b/src/reference_tree.ml @@ -21,16 +21,16 @@ type completion_help_type = [@@deriving yojson] type doc_hints = { - text: string; - hint_type: string; - } [@@deriving yojson] + text: string; + hint_type: string; +} [@@deriving yojson] type docs = { - headline: string; - text: string; - usageExample: string; - hints: doc_hints list; - } [@@deriving yojson] + headline: string; + text: string; + usageExample: string; + hints: doc_hints list; +} [@@deriving yojson] type ref_node_data = { node_type: node_type; @@ -188,23 +188,19 @@ let load_docs_hints d c = let load_docs_from_xml d x = let aux d x = match x with - | Xml.Element ("headline", _, [Xml.PCData s]) -> - let new_docs = {d.docs with headline = s} in + | Xml.Element ("headline", _, [Xml.PCData s]) -> + let new_docs = {d.docs with headline = s} in {d with docs = new_docs} - | Xml.Element ("text", _, [Xml.PCData s]) -> - let new_docs = {d.docs with text = s} in + | Xml.Element ("text", _, [Xml.PCData s]) -> + let new_docs = {d.docs with text = s} in {d with docs = new_docs} - | Xml.Element ("hints", _, _) -> + | Xml.Element ("hints", _, _) -> load_docs_hints d x - | Xml.Element ("usageExample", _, [Xml.PCData s]) -> - let new_docs = {d.docs with usageExample = s} in + | Xml.Element ("usageExample", _, [Xml.PCData s]) -> + let new_docs = {d.docs with usageExample = s} in {d with docs = new_docs} | _ -> d (* Ignore unknown elements instead of raising an error *) - in - match x with - | Xml.Element ("docs", _, children) -> - List.fold_left aux d children - | _ -> d + in Xml.fold aux d x let data_from_xml d x = let aux d x = |
