Module Cobol_preproc.Diagnostics

type error =
  1. | Copybook_lookup_error of {
    1. copyloc : Cobol_common.Srcloc.TYPES.srcloc option;
    2. lnf : Cobol_common.Copybook.lookup_error;
    }
  2. | Cyclic_copy of {
    1. copyloc : Cobol_common.Srcloc.TYPES.srcloc;
    2. filename : string;
    }
  3. | Feature_error of Cobol_config.DIAG.error
  4. | Forbidden of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : forbidden_stuff;
    }
  5. | Invalid of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : invalid_stuff;
    }
  6. | Literal_error of Cobol_data.Diagnostics.error
  7. | Malformed of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : malformed_stuff;
    }
  8. | Missing of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : missing_stuff;
    }
  9. | Unexpected of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : unexpected_stuff;
    }
  10. | Unterminated of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : unterminated_stuff;
    }
and forbidden_stuff =
  1. | Change_of_source_format
  2. | Multiword_operand
  3. | Operand_with_spaces
and malformed_stuff =
  1. | Compiler_directive
  2. | Preproc_statement of [ `COPY | `REPLACE | `EXEC_BLOCK ]
and missing_stuff =
  1. | At_least_one_text_word
  2. | At_most_one_text_word
  3. | One_text_word
and unexpected_stuff =
  1. | Alphanumeric_literal
  2. | Elif_compiler_directive of {
    1. suggestion : suggested_missing option;
    }
  3. | Else_compiler_directive of {
    1. suggestion : suggested_missing option;
    }
  4. | EndIf_compiler_directive
  5. | Pseudotext
and invalid_stuff =
  1. | Compiler_directive_word of string
  2. | Source_format of string
and suggested_missing =
  1. | EndIf_compiler_directive_missing of {
    1. initial_if_loc : Cobol_common.Srcloc.TYPES.srcloc;
    }
and unterminated_stuff =
  1. | If_compiler_directive of {
    1. suggested_endif_loc : Cobol_common.Srcloc.TYPES.srcloc;
    }
  2. | Exec_block
val error_loc : error -> Cobol_common.srcloc option
val pp_preproc_statement : Stdlib.Format.formatter -> [< `COPY | `EXEC_BLOCK | `REPLACE ] -> unit
val pp_forbidden_stuff : Stdlib.Format.formatter -> forbidden_stuff -> unit
val pp_invalid_stuff : Stdlib.Format.formatter -> invalid_stuff -> unit
val pp_suggestion : Stdlib.Format.formatter -> suggested_missing -> unit
val pp_missing_stuff : Stdlib.Format.formatter -> missing_stuff -> unit
val pp_unexpected_stuff : Stdlib.Format.formatter -> unexpected_stuff -> unit
val pp_unterminated : Stdlib.Format.formatter -> unterminated_stuff -> unit
val pp_error : Stdlib.Format.formatter -> error -> unit
type warning =
  1. | Feature_warning of Cobol_config.DIAG.warning
  2. | Ignored of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. item : ignored_item;
    }
  3. | Incompatible of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : incompatible_warning_stuff;
    }
  4. | Undefined_warning of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : undefined_warning_stuff;
    }
  5. | Unexpected_warning of {
    1. loc : Cobol_common.Srcloc.TYPES.srcloc;
    2. stuff : unexpected_warning_stuff;
    }
and ignored_item =
  1. | Compiler_directive
and incompatible_warning_stuff
and undefined_warning_stuff
and unexpected_warning_stuff
val warning_loc : warning -> Cobol_common.srcloc
val pp_ignored_item : Stdlib.Format.formatter -> ignored_item -> unit
val pp_incompatible_warning_stuff : Stdlib.Format.formatter -> incompatible_warning_stuff -> unit
val pp_undefined_warning_stuff : Stdlib.Format.formatter -> undefined_warning_stuff -> unit
val pp_unexpected_warning_stuff : Stdlib.Format.formatter -> unexpected_warning_stuff -> unit
val pp_warning : Stdlib.Format.formatter -> warning -> unit
type diagnostics = {
  1. errors : error list;
  2. warnings : warning list;
}
type t = diagnostics
val none : diagnostics
val add_error : error -> diagnostics -> diagnostics
val add_warning : warning -> diagnostics -> diagnostics
val has_errors : diagnostics -> bool
val add_src_diagnostics : Cobol_preproc__.Src_diagnostics.diagnostics -> diagnostics -> diagnostics
val add_literal_diagnostics : Cobol_data.Diagnostics.diagnostics -> diagnostics -> diagnostics
val translate : t -> Cobol_common__Diagnostics.TYPES.diagnostics