INTERNAL.Documentmodule DIAGS = Cobol_common.Diagnosticsmodule TYPES : sig ... endinclude module type of struct include TYPES endtype document = TYPES.document = {project : Superbol_project__.Project.TYPES.project;textdoc : Lsp.Text_document.t;copybook : bool;artifacts : Cobol_parser.Outputs.artifacts;checked : checked_doc option;rewinder : rewinder option;parsing_diags : Cobol_parser.Diagnostics.ALL.t;typecking_diags : Cobol_typeck.Diagnostics.t;}and checked_doc = Cobol_typeck.Outputs.tand rewinder =
(Cobol_ptree.compilation_group option, Cobol_common.Behaviors.eidetic)
Cobol_parser.Outputs.output
Cobol_parser.rewinderRaised by Document.checked.
exception Internal_error of document * exn * Stdlib.Printexc.raw_backtraceRaised by Document.load and Document.update; allows keeping consistent document contents.
type cached = TYPES.cached = {doc_cache_filename : string;doc_cache_checksum : Stdlib.Digest.t;doc_cache_langid : string;doc_cache_version : int;doc_cache_pplog : Cobol_preproc.Trace.log;doc_cache_tokens : Cobol_parser.Outputs.tokens_with_locs;doc_cache_comments : Cobol_preproc.Text.comments;doc_cache_ignored : Cobol_common.Srcloc.lexloc list;doc_cache_checked : checked_doc option;doc_cache_parsing_diags : Cobol_parser.Diagnostics.ALL.t;doc_cache_typecking_diags : Cobol_typeck.Diagnostics.t;}Persistent representation (for caching)
type t = documentval uri : document -> Lsp__.Uri0.tval language_id : document -> stringval rewindable_parse :
document ->
((Cobol_ptree.compilation_group option, Cobol_common.Behaviors.eidetic)
Cobol_parser__.Parser_outputs.output
* (Cobol_ptree.compilation_group option, Cobol_common.Behaviors.eidetic)
Cobol_parser__.Parser_outputs.output
Cobol_parser.rewinder)
Cobol_common__Diagnostics_accumulator.MAKE(Cobol_parser__.Parser_diagnostics.ALL).TYPES.with_diagsval no_artifacts : Cobol_parser.Outputs.artifactsval reparse_and_analyze :
?position:Cobol_parser.position ->
document ->
documentval inspect_at :
position:Lsp.Types.Position.t ->
f:(Cobol_parser.inspectable_parser_state -> 'a) ->
document ->
'a optioninspect_at ~position ~f doc passes to f the state that is reached by the parser at position in doc. Returns None on copybooks, or Some r for r the result of f.
val blank :
project:Superbol_project__.Project.TYPES.project ->
Lsp.Text_document.t ->
documentCreates a record for a document that is not yet parsed or analyzed.
val load :
project:Superbol_project__.Project.TYPES.project ->
Lsp__.Types.DidOpenTextDocumentParams.t ->
documentval first_change_pos :
Lsp.Types.TextDocumentContentChangeEvent.t list ->
Cobol_parser.positionval checked : document -> checked_docRaises Unparseable in case the document cannot be parsed entierely, or Copybook in case the document is not a main program.
val diagnostics : document -> DIAGS.Set.tCaching utilities
Raises Failure in case of bad checksum.