diff --git a/src/lsp/cobol_ast/misc_descr.ml b/src/lsp/cobol_ast/misc_descr.ml index 099a8c4da..3ebf4482a 100644 --- a/src/lsp/cobol_ast/misc_descr.ml +++ b/src/lsp/cobol_ast/misc_descr.ml @@ -656,8 +656,8 @@ let pp_select_clause ppf = function | SelectRecordKey { key; source } -> Fmt.pf ppf "RECORD %a%a" pp_qualname key - Pretty.(list ~fopen:"SOURCE " ~fsep:"@ " ~fclose:"" ~fempty:"" - pp_name') source + (Pretty.list ~fopen:"SOURCE " ~fsep:"@ " ~fclose:"" ~fempty:"" + pp_name') source | SelectRelativeKey n -> Fmt.pf ppf "RELATIVE %a" pp_name' n | SelectReserve n -> Fmt.pf ppf "RESERVE %a" pp_integer n @@ -759,11 +759,10 @@ let pp_comment_entry: comment_entry Pretty.printer = Fmt.(list ~sep:sp string) let pp_informational_paragraph: informational_paragraph Pretty.printer = - Fmt.(any "@[<4>" ++ (* <- indent by 4 to avoid Area A *) + Fmt.(box ~indent:4 @@ (* <- indent by 4 to avoid Area A *) pair ~sep:(any ".@ ") pp_informational_paragraph_header - (pp_with_loc pp_comment_entry) ++ - any "@]") + (pp_with_loc pp_comment_entry)) let pp_informational_paragraphs: informational_paragraphs Pretty.printer = Fmt.(list ~sep:(any "@\n") (* force newlines *) diff --git a/src/lsp/cobol_parser/parser_outputs.ml b/src/lsp/cobol_parser/parser_outputs.ml index ecc869dd0..585865c9b 100644 --- a/src/lsp/cobol_parser/parser_outputs.ml +++ b/src/lsp/cobol_parser/parser_outputs.ml @@ -25,8 +25,17 @@ type artifacts = comments: Cobol_preproc.comments; } -type ('a, 'm) output = - | Only: 'a -> ('a, Cobol_common.Behaviors.amnesic) output - | WithArtifacts: 'a * artifacts -> ('a, Cobol_common.Behaviors.eidetic) output +(** The output of parsing functions depends on its memorization abilities: + + - an amnesic parse (when ['memo = Cobol_common.Behaviors.amnesic]) only + returns a parsing result (of type ['a]); + + - an eidetic parse (when ['memo = Cobol_common.Behaviors.eidetic]) + additionally returns some parsing artefacts. *) +type ('result, 'memo) output = + | Only: + 'result -> ('result, Cobol_common.Behaviors.amnesic) output + | WithArtifacts: + 'result * artifacts -> ('result, Cobol_common.Behaviors.eidetic) output type 'm parsed_compilation_group = (PTree.compilation_group option, 'm) output