diff --git a/dune-project b/dune-project index 6fa9fe1..679d495 100644 --- a/dune-project +++ b/dune-project @@ -23,6 +23,19 @@ (name sarif) (synopsis "Static Analysis Results Interchange Format (SARIF) Version 2.1.0") (description "Static Analysis Results Interchange Format (SARIF) Version 2.1.0") - (depends (ocaml (>= 4.14.0)) dune re (atdgen (>= 2.10.0)) (atdgen-runtime (>= 2.10.0)) timedesc (ppx_expect :with-test) ppx_deriving (uri (>= 4.4.0))) + (depends + (ocaml (>= 4.14.0)) + dune + re + (atdgen (>= 2.10.0)) + ; fix int64 JSON issue https://github.com/ahrefs/atd/issues/402 + (atdgen-runtime (>= 2.12.0)) + timedesc + (ppx_expect :with-test) + ppx_deriving + (uri (>= 4.4.0)) + ) (tags - (sarif))) + (sarif) + ) +) diff --git a/lib/sarif_v_2_1_0_j.ml b/lib/sarif_v_2_1_0_j.ml index 767b3cb..5ca7edd 100644 --- a/lib/sarif_v_2_1_0_j.ml +++ b/lib/sarif_v_2_1_0_j.ml @@ -2,29005 +2,35142 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype [@@deriving show, eq] +type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item [@@deriving show, eq] +type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) type external_properties_guid = Sarif_v_2_1_0_t.external_properties_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = Sarif_v_2_1_0_t.external_properties_run_guid -[@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = + Sarif_v_2_1_0_t.external_properties_run_guid + [@@deriving show,eq] -type external_properties_version = Sarif_v_2_1_0_t.external_properties_version -[@@deriving show, eq] +type external_properties_version = + Sarif_v_2_1_0_t.external_properties_version + [@@deriving show,eq] -type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show, eq] -type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show, eq] +type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show,eq] + +type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = Sarif_v_2_1_0_t.notification_level [@@deriving show, eq] +type notification_level = Sarif_v_2_1_0_t.notification_level + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = Sarif_v_2_1_0_t.property_bag [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = Sarif_v_2_1_0_t.address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = Sarif_v_2_1_0_t.property_bag + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = Sarif_v_2_1_0_t.address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = Sarif_v_2_1_0_t.logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = Sarif_v_2_1_0_t.logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = Sarif_v_2_1_0_t.message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = Sarif_v_2_1_0_t.message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = Sarif_v_2_1_0_t.artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = Sarif_v_2_1_0_t.artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = Sarif_v_2_1_0_t.edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = Sarif_v_2_1_0_t.edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = Sarif_v_2_1_0_t.location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = Sarif_v_2_1_0_t.multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = Sarif_v_2_1_0_t.location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = + Sarif_v_2_1_0_t.multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = Sarif_v_2_1_0_t.artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show, eq] +type artifact_content = Sarif_v_2_1_0_t.artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = Sarif_v_2_1_0_t.graph_traversal [@@deriving show, eq] +type graph_traversal = Sarif_v_2_1_0_t.graph_traversal + [@@deriving show,eq] (** An area within an image. *) -type rectangle = Sarif_v_2_1_0_t.rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = Sarif_v_2_1_0_t.rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = Sarif_v_2_1_0_t.region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = Sarif_v_2_1_0_t.region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = Sarif_v_2_1_0_t.attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = Sarif_v_2_1_0_t.physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = Sarif_v_2_1_0_t.attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = Sarif_v_2_1_0_t.physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = Sarif_v_2_1_0_t.location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = Sarif_v_2_1_0_t.location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = Sarif_v_2_1_0_t.replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = Sarif_v_2_1_0_t.replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = Sarif_v_2_1_0_t.artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = Sarif_v_2_1_0_t.artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = Sarif_v_2_1_0_t.fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = Sarif_v_2_1_0_t.fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = Sarif_v_2_1_0_t.reporting_configuration_level -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = + Sarif_v_2_1_0_t.reporting_configuration_level + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) type reporting_descriptor_deprecated_guids_item = Sarif_v_2_1_0_t.reporting_descriptor_deprecated_guids_item -[@@deriving show, eq] + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) type reporting_descriptor_guid = Sarif_v_2_1_0_t.reporting_descriptor_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) type reporting_descriptor_reference_guid = Sarif_v_2_1_0_t.reporting_descriptor_reference_guid -[@@deriving show, eq] + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state [@@deriving show, eq] +type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state + [@@deriving show,eq] -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) type result_correlation_guid = Sarif_v_2_1_0_t.result_correlation_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = Sarif_v_2_1_0_t.result_guid [@@deriving show, eq] +type result_guid = Sarif_v_2_1_0_t.result_guid + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = Sarif_v_2_1_0_t.result_kind [@@deriving show, eq] +type result_kind = Sarif_v_2_1_0_t.result_kind + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = Sarif_v_2_1_0_t.result_level [@@deriving show, eq] +type result_level = Sarif_v_2_1_0_t.result_level + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) type result_provenance_first_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_first_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) type result_provenance_last_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_last_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = Sarif_v_2_1_0_t.result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = Sarif_v_2_1_0_t.result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = Sarif_v_2_1_0_t.stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = Sarif_v_2_1_0_t.stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = Sarif_v_2_1_0_t.stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = Sarif_v_2_1_0_t.stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = Sarif_v_2_1_0_t.suppression_guid [@@deriving show, eq] +type suppression_guid = Sarif_v_2_1_0_t.suppression_guid + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = Sarif_v_2_1_0_t.suppression_kind [@@deriving show, eq] +type suppression_kind = Sarif_v_2_1_0_t.suppression_kind + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = Sarif_v_2_1_0_t.suppression_status [@@deriving show, eq] +type suppression_status = Sarif_v_2_1_0_t.suppression_status + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = Sarif_v_2_1_0_t.suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = Sarif_v_2_1_0_t.thread_flow_location_importance -[@@deriving show, eq] +type suppression = Sarif_v_2_1_0_t.suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = + Sarif_v_2_1_0_t.thread_flow_location_importance + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = Sarif_v_2_1_0_t.tool_component_contents_item -[@@deriving show, eq] - -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) +type tool_component_contents_item = + Sarif_v_2_1_0_t.tool_component_contents_item + [@@deriving show,eq] + +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) type tool_component_dotted_quad_file_version = Sarif_v_2_1_0_t.tool_component_dotted_quad_file_version -[@@deriving show, eq] + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) +type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) type tool_component_language = Sarif_v_2_1_0_t.tool_component_language -[@@deriving show, eq] + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = Sarif_v_2_1_0_t.tool_component_reference_guid -[@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = + Sarif_v_2_1_0_t.tool_component_reference_guid + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = Sarif_v_2_1_0_t.reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = + Sarif_v_2_1_0_t.reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = Sarif_v_2_1_0_t.configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = Sarif_v_2_1_0_t.configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) type reporting_descriptor_relationship = - Sarif_v_2_1_0_t.reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known + Sarif_v_2_1_0_t.reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = Sarif_v_2_1_0_t.tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = Sarif_v_2_1_0_t.tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = Sarif_v_2_1_0_t.tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = Sarif_v_2_1_0_t.tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = Sarif_v_2_1_0_t.web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = Sarif_v_2_1_0_t.web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = Sarif_v_2_1_0_t.web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = Sarif_v_2_1_0_t.web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = Sarif_v_2_1_0_t.thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = Sarif_v_2_1_0_t.thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = Sarif_v_2_1_0_t.code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = Sarif_v_2_1_0_t.code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = Sarif_v_2_1_0_t.node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = Sarif_v_2_1_0_t.exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = Sarif_v_2_1_0_t.node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = Sarif_v_2_1_0_t.exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = Sarif_v_2_1_0_t.graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = Sarif_v_2_1_0_t.graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = Sarif_v_2_1_0_t.result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = Sarif_v_2_1_0_t.result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = Sarif_v_2_1_0_t.notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = Sarif_v_2_1_0_t.notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = Sarif_v_2_1_0_t.invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = Sarif_v_2_1_0_t.invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = Sarif_v_2_1_0_t.conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = Sarif_v_2_1_0_t.artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = Sarif_v_2_1_0_t.conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = Sarif_v_2_1_0_t.artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = Sarif_v_2_1_0_t.external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = Sarif_v_2_1_0_t.version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = Sarif_v_2_1_0_t.external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = Sarif_v_2_1_0_t.version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = Sarif_v_2_1_0_t.special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = Sarif_v_2_1_0_t.run_language [@@deriving show, eq] +type special_locations = Sarif_v_2_1_0_t.special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = Sarif_v_2_1_0_t.run_language + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = Sarif_v_2_1_0_t.run_column_kind [@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = Sarif_v_2_1_0_t.run_automation_details_guid -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) +type run_column_kind = Sarif_v_2_1_0_t.run_column_kind + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = + Sarif_v_2_1_0_t.run_automation_details_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) type run_automation_details_correlation_guid = Sarif_v_2_1_0_t.run_automation_details_correlation_guid -[@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) type external_property_file_reference_guid = Sarif_v_2_1_0_t.external_property_file_reference_guid -[@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = Sarif_v_2_1_0_t.external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = + Sarif_v_2_1_0_t.external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) type external_property_file_references = - Sarif_v_2_1_0_t.external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = Sarif_v_2_1_0_t.run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the + Sarif_v_2_1_0_t.external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = Sarif_v_2_1_0_t.run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] - -let write__float_option = - Atdgen_runtime.Oj_run.write_std_option Yojson.Safe.write_std_float -;; - + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] + +let write__float_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + Yojson.Safe.write_std_float + ) +) let string_of__float_option ?(len = 1024) x = let ob = Buffer.create len in write__float_option ob x; Buffer.contents ob -;; - -let read__float_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = Atdgen_runtime.Oj_run.read_number p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = Atdgen_runtime.Oj_run.read_number p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__float_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + Atdgen_runtime.Oj_run.read_number + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + Atdgen_runtime.Oj_run.read_number + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _float_option_of_string s = read__float_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__string_list = Atdgen_runtime.Oj_run.write_list Yojson.Safe.write_string - +let write__string_list = ( + Atdgen_runtime.Oj_run.write_list ( + Yojson.Safe.write_string + ) +) let string_of__string_list ?(len = 1024) x = let ob = Buffer.create len in write__string_list ob x; Buffer.contents ob -;; - -let read__string_list = Atdgen_runtime.Oj_run.read_list Atdgen_runtime.Oj_run.read_string - +let read__string_list = ( + Atdgen_runtime.Oj_run.read_list ( + Atdgen_runtime.Oj_run.read_string + ) +) let _string_list_of_string s = read__string_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__string_list_option = Atdgen_runtime.Oj_run.write_std_option write__string_list - +let write__string_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__string_list + ) +) let string_of__string_list_option ?(len = 1024) x = let ob = Buffer.create len in write__string_list_option ob x; Buffer.contents ob -;; - -let read__string_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__string_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__string_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__string_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__string_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__string_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _string_list_option_of_string s = read__string_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__string_option = Atdgen_runtime.Oj_run.write_std_option Yojson.Safe.write_string - +let write__string_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + Yojson.Safe.write_string + ) +) let string_of__string_option ?(len = 1024) x = let ob = Buffer.create len in write__string_option ob x; Buffer.contents ob -;; - -let read__string_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = Atdgen_runtime.Oj_run.read_string p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = Atdgen_runtime.Oj_run.read_string p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__string_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + Atdgen_runtime.Oj_run.read_string + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + Atdgen_runtime.Oj_run.read_string + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _string_option_of_string s = read__string_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__x_c3c9756 = - Atdgen_runtime.Oj_run.write_assoc_list Yojson.Safe.write_string Yojson.Safe.write_string -;; - +let write__x_c3c9756 = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + Yojson.Safe.write_string + ) +) let string_of__x_c3c9756 ?(len = 1024) x = let ob = Buffer.create len in write__x_c3c9756 ob x; Buffer.contents ob -;; - -let read__x_c3c9756 = - Atdgen_runtime.Oj_run.read_assoc_list +let read__x_c3c9756 = ( + Atdgen_runtime.Oj_run.read_assoc_list ( Atdgen_runtime.Oj_run.read_string + ) ( Atdgen_runtime.Oj_run.read_string -;; - + ) +) let _x_c3c9756_of_string s = read__x_c3c9756 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__x_d561347 = - Atdgen_runtime.Oj_run.write_assoc_list Yojson.Safe.write_string Yojson.Safe.write_json -;; - +let write__x_d561347 = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + Yojson.Safe.write_json + ) +) let string_of__x_d561347 ?(len = 1024) x = let ob = Buffer.create len in write__x_d561347 ob x; Buffer.contents ob -;; - -let read__x_d561347 = - Atdgen_runtime.Oj_run.read_assoc_list +let read__x_d561347 = ( + Atdgen_runtime.Oj_run.read_assoc_list ( Atdgen_runtime.Oj_run.read_string + ) ( Atdgen_runtime.Oj_run.read_json -;; - + ) +) let _x_d561347_of_string s = read__x_d561347 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_artifact_mimetype = Yojson.Safe.write_string - +let write_artifact_mimetype = ( + Yojson.Safe.write_string +) let string_of_artifact_mimetype ?(len = 1024) x = let ob = Buffer.create len in write_artifact_mimetype ob x; Buffer.contents ob -;; - -let read_artifact_mimetype = Atdgen_runtime.Oj_run.read_string - +let read_artifact_mimetype = ( + Atdgen_runtime.Oj_run.read_string +) let artifact_mimetype_of_string s = read_artifact_mimetype (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_mimetype_option = - Atdgen_runtime.Oj_run.write_std_option write_artifact_mimetype -;; - +let write__artifact_mimetype_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_artifact_mimetype + ) +) let string_of__artifact_mimetype_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_mimetype_option ob x; Buffer.contents ob -;; - -let read__artifact_mimetype_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_artifact_mimetype p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_artifact_mimetype p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__artifact_mimetype_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_artifact_mimetype + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_artifact_mimetype + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _artifact_mimetype_option_of_string s = read__artifact_mimetype_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_artifact_roles_item ob x = - match x with - | `AnalysisTarget -> Buffer.add_string ob "\"analysisTarget\"" - | `Attachment -> Buffer.add_string ob "\"attachment\"" - | `ResponseFile -> Buffer.add_string ob "\"responseFile\"" - | `ResultFile -> Buffer.add_string ob "\"resultFile\"" - | `StandardStream -> Buffer.add_string ob "\"standardStream\"" - | `TracedFile -> Buffer.add_string ob "\"tracedFile\"" - | `Unmodified -> Buffer.add_string ob "\"unmodified\"" - | `Modified -> Buffer.add_string ob "\"modified\"" - | `Added -> Buffer.add_string ob "\"added\"" - | `Deleted -> Buffer.add_string ob "\"deleted\"" - | `Renamed -> Buffer.add_string ob "\"renamed\"" - | `Uncontrolled -> Buffer.add_string ob "\"uncontrolled\"" - | `Driver -> Buffer.add_string ob "\"driver\"" - | `Extension -> Buffer.add_string ob "\"extension\"" - | `Translation -> Buffer.add_string ob "\"translation\"" - | `Taxonomy -> Buffer.add_string ob "\"taxonomy\"" - | `Policy -> Buffer.add_string ob "\"policy\"" - | `ReferencedOnCommandLine -> Buffer.add_string ob "\"referencedOnCommandLine\"" - | `MemoryContents -> Buffer.add_string ob "\"memoryContents\"" - | `Directory -> Buffer.add_string ob "\"directory\"" - | `UserSpecifiedConfiguration -> Buffer.add_string ob "\"userSpecifiedConfiguration\"" - | `ToolSpecifiedConfiguration -> Buffer.add_string ob "\"toolSpecifiedConfiguration\"" - | `DebugOutputFile -> Buffer.add_string ob "\"debugOutputFile\"" -;; - +let write_artifact_roles_item = ( + fun ob x -> + match x with + | `AnalysisTarget -> Buffer.add_string ob "\"analysisTarget\"" + | `Attachment -> Buffer.add_string ob "\"attachment\"" + | `ResponseFile -> Buffer.add_string ob "\"responseFile\"" + | `ResultFile -> Buffer.add_string ob "\"resultFile\"" + | `StandardStream -> Buffer.add_string ob "\"standardStream\"" + | `TracedFile -> Buffer.add_string ob "\"tracedFile\"" + | `Unmodified -> Buffer.add_string ob "\"unmodified\"" + | `Modified -> Buffer.add_string ob "\"modified\"" + | `Added -> Buffer.add_string ob "\"added\"" + | `Deleted -> Buffer.add_string ob "\"deleted\"" + | `Renamed -> Buffer.add_string ob "\"renamed\"" + | `Uncontrolled -> Buffer.add_string ob "\"uncontrolled\"" + | `Driver -> Buffer.add_string ob "\"driver\"" + | `Extension -> Buffer.add_string ob "\"extension\"" + | `Translation -> Buffer.add_string ob "\"translation\"" + | `Taxonomy -> Buffer.add_string ob "\"taxonomy\"" + | `Policy -> Buffer.add_string ob "\"policy\"" + | `ReferencedOnCommandLine -> Buffer.add_string ob "\"referencedOnCommandLine\"" + | `MemoryContents -> Buffer.add_string ob "\"memoryContents\"" + | `Directory -> Buffer.add_string ob "\"directory\"" + | `UserSpecifiedConfiguration -> Buffer.add_string ob "\"userSpecifiedConfiguration\"" + | `ToolSpecifiedConfiguration -> Buffer.add_string ob "\"toolSpecifiedConfiguration\"" + | `DebugOutputFile -> Buffer.add_string ob "\"debugOutputFile\"" +) let string_of_artifact_roles_item ?(len = 1024) x = let ob = Buffer.create len in write_artifact_roles_item ob x; Buffer.contents ob -;; - -let read_artifact_roles_item p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "analysisTarget" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `AnalysisTarget - | "attachment" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Attachment - | "responseFile" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `ResponseFile - | "resultFile" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `ResultFile - | "standardStream" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `StandardStream - | "tracedFile" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `TracedFile - | "unmodified" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Unmodified - | "modified" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Modified - | "added" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Added - | "deleted" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Deleted - | "renamed" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Renamed - | "uncontrolled" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Uncontrolled - | "driver" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Driver - | "extension" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Extension - | "translation" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Translation - | "taxonomy" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Taxonomy - | "policy" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Policy - | "referencedOnCommandLine" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `ReferencedOnCommandLine - | "memoryContents" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `MemoryContents - | "directory" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Directory - | "userSpecifiedConfiguration" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `UserSpecifiedConfiguration - | "toolSpecifiedConfiguration" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `ToolSpecifiedConfiguration - | "debugOutputFile" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `DebugOutputFile - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "analysisTarget" -> `AnalysisTarget - | "attachment" -> `Attachment - | "responseFile" -> `ResponseFile - | "resultFile" -> `ResultFile - | "standardStream" -> `StandardStream - | "tracedFile" -> `TracedFile - | "unmodified" -> `Unmodified - | "modified" -> `Modified - | "added" -> `Added - | "deleted" -> `Deleted - | "renamed" -> `Renamed - | "uncontrolled" -> `Uncontrolled - | "driver" -> `Driver - | "extension" -> `Extension - | "translation" -> `Translation - | "taxonomy" -> `Taxonomy - | "policy" -> `Policy - | "referencedOnCommandLine" -> `ReferencedOnCommandLine - | "memoryContents" -> `MemoryContents - | "directory" -> `Directory - | "userSpecifiedConfiguration" -> `UserSpecifiedConfiguration - | "toolSpecifiedConfiguration" -> `ToolSpecifiedConfiguration - | "debugOutputFile" -> `DebugOutputFile - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_artifact_roles_item = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "analysisTarget" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `AnalysisTarget + | "attachment" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Attachment + | "responseFile" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `ResponseFile + | "resultFile" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `ResultFile + | "standardStream" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `StandardStream + | "tracedFile" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `TracedFile + | "unmodified" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Unmodified + | "modified" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Modified + | "added" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Added + | "deleted" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Deleted + | "renamed" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Renamed + | "uncontrolled" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Uncontrolled + | "driver" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Driver + | "extension" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Extension + | "translation" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Translation + | "taxonomy" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Taxonomy + | "policy" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Policy + | "referencedOnCommandLine" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `ReferencedOnCommandLine + | "memoryContents" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `MemoryContents + | "directory" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Directory + | "userSpecifiedConfiguration" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `UserSpecifiedConfiguration + | "toolSpecifiedConfiguration" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `ToolSpecifiedConfiguration + | "debugOutputFile" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `DebugOutputFile + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "analysisTarget" -> + `AnalysisTarget + | "attachment" -> + `Attachment + | "responseFile" -> + `ResponseFile + | "resultFile" -> + `ResultFile + | "standardStream" -> + `StandardStream + | "tracedFile" -> + `TracedFile + | "unmodified" -> + `Unmodified + | "modified" -> + `Modified + | "added" -> + `Added + | "deleted" -> + `Deleted + | "renamed" -> + `Renamed + | "uncontrolled" -> + `Uncontrolled + | "driver" -> + `Driver + | "extension" -> + `Extension + | "translation" -> + `Translation + | "taxonomy" -> + `Taxonomy + | "policy" -> + `Policy + | "referencedOnCommandLine" -> + `ReferencedOnCommandLine + | "memoryContents" -> + `MemoryContents + | "directory" -> + `Directory + | "userSpecifiedConfiguration" -> + `UserSpecifiedConfiguration + | "toolSpecifiedConfiguration" -> + `ToolSpecifiedConfiguration + | "debugOutputFile" -> + `DebugOutputFile + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let artifact_roles_item_of_string s = read_artifact_roles_item (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_roles_item_list = - Atdgen_runtime.Oj_run.write_list write_artifact_roles_item -;; - +let write__artifact_roles_item_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_artifact_roles_item + ) +) let string_of__artifact_roles_item_list ?(len = 1024) x = let ob = Buffer.create len in write__artifact_roles_item_list ob x; Buffer.contents ob -;; - -let read__artifact_roles_item_list = - Atdgen_runtime.Oj_run.read_list read_artifact_roles_item -;; - +let read__artifact_roles_item_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_artifact_roles_item + ) +) let _artifact_roles_item_list_of_string s = read__artifact_roles_item_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_roles_item_list_option = - Atdgen_runtime.Oj_run.write_std_option write__artifact_roles_item_list -;; - +let write__artifact_roles_item_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__artifact_roles_item_list + ) +) let string_of__artifact_roles_item_list_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_roles_item_list_option ob x; Buffer.contents ob -;; - -let read__artifact_roles_item_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__artifact_roles_item_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__artifact_roles_item_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__artifact_roles_item_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__artifact_roles_item_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__artifact_roles_item_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _artifact_roles_item_list_option_of_string s = read__artifact_roles_item_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_external_properties_guid = Yojson.Safe.write_string - +let write_external_properties_guid = ( + Yojson.Safe.write_string +) let string_of_external_properties_guid ?(len = 1024) x = let ob = Buffer.create len in write_external_properties_guid ob x; Buffer.contents ob -;; - -let read_external_properties_guid = Atdgen_runtime.Oj_run.read_string - +let read_external_properties_guid = ( + Atdgen_runtime.Oj_run.read_string +) let external_properties_guid_of_string s = read_external_properties_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_properties_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_external_properties_guid -;; - +let write__external_properties_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_properties_guid + ) +) let string_of__external_properties_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_guid_option ob x; Buffer.contents ob -;; - -let read__external_properties_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_properties_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_properties_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_properties_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_properties_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_properties_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_properties_guid_option_of_string s = read__external_properties_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_external_properties_run_guid = Yojson.Safe.write_string - +let write_external_properties_run_guid = ( + Yojson.Safe.write_string +) let string_of_external_properties_run_guid ?(len = 1024) x = let ob = Buffer.create len in write_external_properties_run_guid ob x; Buffer.contents ob -;; - -let read_external_properties_run_guid = Atdgen_runtime.Oj_run.read_string - +let read_external_properties_run_guid = ( + Atdgen_runtime.Oj_run.read_string +) let external_properties_run_guid_of_string s = read_external_properties_run_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_properties_run_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_external_properties_run_guid -;; - +let write__external_properties_run_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_properties_run_guid + ) +) let string_of__external_properties_run_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_run_guid_option ob x; Buffer.contents ob -;; - -let read__external_properties_run_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_properties_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_properties_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_properties_run_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_properties_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_properties_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_properties_run_guid_option_of_string s = - read__external_properties_run_guid_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_external_properties_version ob x = - match x with - | `TwoDotOneDotZero -> Buffer.add_string ob "\"2.1.0\"" -;; - + read__external_properties_run_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_external_properties_version = ( + fun ob x -> + match x with + | `TwoDotOneDotZero -> Buffer.add_string ob "\"2.1.0\"" +) let string_of_external_properties_version ?(len = 1024) x = let ob = Buffer.create len in write_external_properties_version ob x; Buffer.contents ob -;; - -let read_external_properties_version p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "2.1.0" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `TwoDotOneDotZero - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "2.1.0" -> `TwoDotOneDotZero - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_external_properties_version = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "2.1.0" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `TwoDotOneDotZero + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "2.1.0" -> + `TwoDotOneDotZero + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let external_properties_version_of_string s = read_external_properties_version (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_properties_version_option = - Atdgen_runtime.Oj_run.write_std_option write_external_properties_version -;; - +let write__external_properties_version_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_properties_version + ) +) let string_of__external_properties_version_option ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_version_option ob x; Buffer.contents ob -;; - -let read__external_properties_version_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_properties_version p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_properties_version p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_properties_version_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_properties_version + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_properties_version + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_properties_version_option_of_string s = - read__external_properties_version_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_hm_str_str = write__x_c3c9756 - + read__external_properties_version_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_hm_str_str = ( + write__x_c3c9756 +) let string_of_hm_str_str ?(len = 1024) x = let ob = Buffer.create len in write_hm_str_str ob x; Buffer.contents ob -;; - -let read_hm_str_str = read__x_c3c9756 - +let read_hm_str_str = ( + read__x_c3c9756 +) let hm_str_str_of_string s = read_hm_str_str (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__hm_str_str_option = Atdgen_runtime.Oj_run.write_std_option write_hm_str_str - +let write__hm_str_str_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_hm_str_str + ) +) let string_of__hm_str_str_option ?(len = 1024) x = let ob = Buffer.create len in write__hm_str_str_option ob x; Buffer.contents ob -;; - -let read__hm_str_str_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_hm_str_str p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_hm_str_str p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__hm_str_str_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_hm_str_str + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_hm_str_str + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _hm_str_str_option_of_string s = read__hm_str_str_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_int64 = Atdgen_runtime.Oj_run.write_int64 - +let write_int64 = ( + Atdgen_runtime.Oj_run.write_int64 +) let string_of_int64 ?(len = 1024) x = let ob = Buffer.create len in write_int64 ob x; Buffer.contents ob -;; - -let read_int64 = Atdgen_runtime.Oj_run.read_int64 -let int64_of_string s = read_int64 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__int64_option = Atdgen_runtime.Oj_run.write_std_option write_int64 - +let read_int64 = ( + Atdgen_runtime.Oj_run.read_int64 +) +let int64_of_string s = + read_int64 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__int64_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_int64 + ) +) let string_of__int64_option ?(len = 1024) x = let ob = Buffer.create len in write__int64_option ob x; Buffer.contents ob -;; - -let read__int64_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_int64 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_int64 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__int64_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_int64 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_int64 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _int64_option_of_string s = read__int64_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_notification_level ob x = - match x with - | `None -> Buffer.add_string ob "\"none\"" - | `Note -> Buffer.add_string ob "\"note\"" - | `Warning -> Buffer.add_string ob "\"warning\"" - | `Error -> Buffer.add_string ob "\"error\"" -;; - +let write_notification_level = ( + fun ob x -> + match x with + | `None -> Buffer.add_string ob "\"none\"" + | `Note -> Buffer.add_string ob "\"note\"" + | `Warning -> Buffer.add_string ob "\"warning\"" + | `Error -> Buffer.add_string ob "\"error\"" +) let string_of_notification_level ?(len = 1024) x = let ob = Buffer.create len in write_notification_level ob x; Buffer.contents ob -;; - -let read_notification_level p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "none" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `None - | "note" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Note - | "warning" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Warning - | "error" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "none" -> `None - | "note" -> `Note - | "warning" -> `Warning - | "error" -> `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_notification_level = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "none" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `None + | "note" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Note + | "warning" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Warning + | "error" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "none" -> + `None + | "note" -> + `Note + | "warning" -> + `Warning + | "error" -> + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let notification_level_of_string s = read_notification_level (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__notification_level_option = - Atdgen_runtime.Oj_run.write_std_option write_notification_level -;; - +let write__notification_level_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_notification_level + ) +) let string_of__notification_level_option ?(len = 1024) x = let ob = Buffer.create len in write__notification_level_option ob x; Buffer.contents ob -;; - -let read__notification_level_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_notification_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_notification_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__notification_level_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_notification_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_notification_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _notification_level_option_of_string s = read__notification_level_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_property_bag = write__x_d561347 - +let write_property_bag = ( + write__x_d561347 +) let string_of_property_bag ?(len = 1024) x = let ob = Buffer.create len in write_property_bag ob x; Buffer.contents ob -;; - -let read_property_bag = read__x_d561347 - +let read_property_bag = ( + read__x_d561347 +) let property_bag_of_string s = read_property_bag (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__property_bag_option = Atdgen_runtime.Oj_run.write_std_option write_property_bag - +let write__property_bag_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_property_bag + ) +) let string_of__property_bag_option ?(len = 1024) x = let ob = Buffer.create len in write__property_bag_option ob x; Buffer.contents ob -;; - -let read__property_bag_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_property_bag p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_property_bag p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__property_bag_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_property_bag + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_property_bag + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _property_bag_option_of_string s = read__property_bag_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_address : _ -> address -> _ = +let write_address : _ -> address -> _ = ( fun ob (x : address) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if x.absolute_address <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"absoluteAddress\":"; - write_int64 ob x.absolute_address); - (match x.fully_qualified_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullyQualifiedName\":"; - Yojson.Safe.write_string ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.kind with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kind\":"; - Yojson.Safe.write_string ob x); - (match x.length with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"length\":"; - write_int64 ob x); - (match x.name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x); - (match x.offset_from_parent with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"offsetFromParent\":"; - write_int64 ob x); - if x.parent_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parentIndex\":"; - write_int64 ob x.parent_index); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.relative_address with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"relativeAddress\":"; - write_int64 ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if x.absolute_address <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"absoluteAddress\":"; + ( + write_int64 + ) + ob x.absolute_address; + ); + (match x.fully_qualified_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullyQualifiedName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.kind with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kind\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.length with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"length\":"; + ( + write_int64 + ) + ob x; + ); + (match x.name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.offset_from_parent with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"offsetFromParent\":"; + ( + write_int64 + ) + ob x; + ); + if x.parent_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parentIndex\":"; + ( + write_int64 + ) + ob x.parent_index; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.relative_address with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"relativeAddress\":"; + ( + write_int64 + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_address ?(len = 1024) x = let ob = Buffer.create len in write_address ob x; Buffer.contents ob -;; - -let read_address p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_absolute_address = ref (-1L) in - let field_fully_qualified_name = ref None in - let field_index = ref (-1L) in - let field_kind = ref None in - let field_length = ref None in - let field_name = ref None in - let field_offset_from_parent = ref None in - let field_parent_index = ref (-1L) in - let field_properties = ref None in - let field_relative_address = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_address = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 3 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 5 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 6 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'h' - then 4 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 8 - else -1 - | 11 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 7 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 'b' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'u' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'A' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'v' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'A' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 's' - then 9 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'o' - && String.unsafe_get s (pos + 1) = 'f' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'm' - && String.unsafe_get s (pos + 10) = 'P' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 't' - then 6 - else -1 - | 18 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 'Q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'N' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_absolute_address := read_int64 p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fully_qualified_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_length := Some (read_int64 p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_offset_from_parent := Some (read_int64 p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_relative_address := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_absolute_address = ref (-1L) in + let field_fully_qualified_name = ref (None) in + let field_index = ref (-1L) in + let field_kind = ref (None) in + let field_length = ref (None) in + let field_name = ref (None) in + let field_offset_from_parent = ref (None) in + let field_parent_index = ref (-1L) in + let field_properties = ref (None) in + let field_relative_address = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 3 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 5 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 6 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'h' - then 4 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 8 - else -1 - | 11 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 7 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 'b' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'u' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'A' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'v' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'A' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 's' - then 9 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'o' - && String.unsafe_get s (pos + 1) = 'f' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'm' - && String.unsafe_get s (pos + 10) = 'P' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 't' - then 6 - else -1 - | 18 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 'Q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'N' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'h' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 7 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 'b' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'A' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'v' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'A' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'f' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'P' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( + 6 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 'Q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'N' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_absolute_address := read_int64 p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fully_qualified_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_length := Some (read_int64 p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_offset_from_parent := Some (read_int64 p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_relative_address := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ absolute_address = !field_absolute_address - ; fully_qualified_name = !field_fully_qualified_name - ; index = !field_index - ; kind = !field_kind - ; length = !field_length - ; name = !field_name - ; offset_from_parent = !field_offset_from_parent - ; parent_index = !field_parent_index - ; properties = !field_properties - ; relative_address = !field_relative_address - } - : address) -;; - -let address_of_string s = read_address (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__address_list = Atdgen_runtime.Oj_run.write_list write_address - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_absolute_address := ( + ( + read_int64 + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fully_qualified_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_offset_from_parent := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relative_address := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'h' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 7 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 'b' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'A' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'v' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'A' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'f' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'P' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 't' then ( + 6 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 'Q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'N' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_absolute_address := ( + ( + read_int64 + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fully_qualified_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_offset_from_parent := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relative_address := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + absolute_address = !field_absolute_address; + fully_qualified_name = !field_fully_qualified_name; + index = !field_index; + kind = !field_kind; + length = !field_length; + name = !field_name; + offset_from_parent = !field_offset_from_parent; + parent_index = !field_parent_index; + properties = !field_properties; + relative_address = !field_relative_address; + } + : address) + ) +) +let address_of_string s = + read_address (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__address_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_address + ) +) let string_of__address_list ?(len = 1024) x = let ob = Buffer.create len in write__address_list ob x; Buffer.contents ob -;; - -let read__address_list = Atdgen_runtime.Oj_run.read_list read_address - +let read__address_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_address + ) +) let _address_list_of_string s = read__address_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__address_list_option = - Atdgen_runtime.Oj_run.write_std_option write__address_list -;; - +let write__address_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__address_list + ) +) let string_of__address_list_option ?(len = 1024) x = let ob = Buffer.create len in write__address_list_option ob x; Buffer.contents ob -;; - -let read__address_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__address_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__address_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__address_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__address_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__address_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _address_list_option_of_string s = read__address_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__address_option = Atdgen_runtime.Oj_run.write_std_option write_address - +let write__address_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_address + ) +) let string_of__address_option ?(len = 1024) x = let ob = Buffer.create len in write__address_option ob x; Buffer.contents ob -;; - -let read__address_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_address p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_address p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__address_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_address + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_address + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _address_option_of_string s = read__address_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_logical_location : _ -> logical_location -> _ = +let write_logical_location : _ -> logical_location -> _ = ( fun ob (x : logical_location) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.decorated_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"decoratedName\":"; - Yojson.Safe.write_string ob x); - (match x.fully_qualified_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullyQualifiedName\":"; - Yojson.Safe.write_string ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.kind with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kind\":"; - Yojson.Safe.write_string ob x); - (match x.name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x); - if x.parent_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parentIndex\":"; - write_int64 ob x.parent_index); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.decorated_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"decoratedName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.fully_qualified_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullyQualifiedName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.kind with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kind\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.parent_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parentIndex\":"; + ( + write_int64 + ) + ob x.parent_index; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_logical_location ?(len = 1024) x = let ob = Buffer.create len in write_logical_location ob x; Buffer.contents ob -;; - -let read_logical_location p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_decorated_name = ref None in - let field_fully_qualified_name = ref None in - let field_index = ref (-1L) in - let field_kind = ref None in - let field_name = ref None in - let field_parent_index = ref (-1L) in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_logical_location = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 3 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 4 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | 11 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 5 - else -1 - | 13 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'N' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'm' - && String.unsafe_get s (pos + 12) = 'e' - then 0 - else -1 - | 18 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 'Q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'N' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_decorated_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fully_qualified_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_decorated_name = ref (None) in + let field_fully_qualified_name = ref (None) in + let field_index = ref (-1L) in + let field_kind = ref (None) in + let field_name = ref (None) in + let field_parent_index = ref (-1L) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 3 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 4 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | 11 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 5 - else -1 - | 13 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'N' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'm' - && String.unsafe_get s (pos + 12) = 'e' - then 0 - else -1 - | 18 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 'Q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'N' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'N' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 'Q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'N' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_decorated_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fully_qualified_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ decorated_name = !field_decorated_name - ; fully_qualified_name = !field_fully_qualified_name - ; index = !field_index - ; kind = !field_kind - ; name = !field_name - ; parent_index = !field_parent_index - ; properties = !field_properties - } - : logical_location) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_decorated_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fully_qualified_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'N' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 'Q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'N' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_decorated_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fully_qualified_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + decorated_name = !field_decorated_name; + fully_qualified_name = !field_fully_qualified_name; + index = !field_index; + kind = !field_kind; + name = !field_name; + parent_index = !field_parent_index; + properties = !field_properties; + } + : logical_location) + ) +) let logical_location_of_string s = read_logical_location (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__logical_location_list = Atdgen_runtime.Oj_run.write_list write_logical_location - +let write__logical_location_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_logical_location + ) +) let string_of__logical_location_list ?(len = 1024) x = let ob = Buffer.create len in write__logical_location_list ob x; Buffer.contents ob -;; - -let read__logical_location_list = Atdgen_runtime.Oj_run.read_list read_logical_location - +let read__logical_location_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_logical_location + ) +) let _logical_location_list_of_string s = read__logical_location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__logical_location_list_option = - Atdgen_runtime.Oj_run.write_std_option write__logical_location_list -;; - +let write__logical_location_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__logical_location_list + ) +) let string_of__logical_location_list_option ?(len = 1024) x = let ob = Buffer.create len in write__logical_location_list_option ob x; Buffer.contents ob -;; - -let read__logical_location_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__logical_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__logical_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__logical_location_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__logical_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__logical_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _logical_location_list_option_of_string s = read__logical_location_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_message : _ -> message -> _ = +let write_message : _ -> message -> _ = ( fun ob (x : message) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.arguments with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"arguments\":"; - write__string_list ob x); - (match x.id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x); - (match x.markdown with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"markdown\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.text with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"text\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.arguments with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"arguments\":"; + ( + write__string_list + ) + ob x; + ); + (match x.id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.markdown with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"markdown\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.text with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"text\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_message ?(len = 1024) x = let ob = Buffer.create len in write_message ob x; Buffer.contents ob -;; - -let read_message p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_arguments = ref None in - let field_id = ref None in - let field_markdown = ref None in - let field_properties = ref None in - let field_text = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_message = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 4 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'w' - && String.unsafe_get s (pos + 7) = 'n' - then 2 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_arguments := Some (read__string_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_markdown := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_arguments = ref (None) in + let field_id = ref (None) in + let field_markdown = ref (None) in + let field_properties = ref (None) in + let field_text = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 4 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'w' - && String.unsafe_get s (pos + 7) = 'n' - then 2 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'w' && String.unsafe_get s (pos+7) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_arguments := Some (read__string_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_markdown := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ arguments = !field_arguments - ; id = !field_id - ; markdown = !field_markdown - ; properties = !field_properties - ; text = !field_text - } - : message) -;; - -let message_of_string s = read_message (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__message_option = Atdgen_runtime.Oj_run.write_std_option write_message - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_arguments := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_markdown := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'w' && String.unsafe_get s (pos+7) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_arguments := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_markdown := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + arguments = !field_arguments; + id = !field_id; + markdown = !field_markdown; + properties = !field_properties; + text = !field_text; + } + : message) + ) +) +let message_of_string s = + read_message (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__message_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_message + ) +) let string_of__message_option ?(len = 1024) x = let ob = Buffer.create len in write__message_option ob x; Buffer.contents ob -;; - -let read__message_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_message p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_message p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__message_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_message + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_message + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _message_option_of_string s = read__message_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_artifact_location : _ -> artifact_location -> _ = +let write_artifact_location : _ -> artifact_location -> _ = ( fun ob (x : artifact_location) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"uri\":"; - Yojson.Safe.write_string ob x); - (match x.uri_base_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"uriBaseId\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"uri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.uri_base_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"uriBaseId\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_artifact_location ?(len = 1024) x = let ob = Buffer.create len in write_artifact_location ob x; Buffer.contents ob -;; - -let read_artifact_location p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_index = ref (-1L) in - let field_properties = ref None in - let field_uri = ref None in - let field_uri_base_id = ref None in - try +let read_artifact_location = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 3 -> - if String.unsafe_get s pos = 'u' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - then 3 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 1 - else -1 - | 9 -> - if String.unsafe_get s pos = 'u' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'B' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'I' - && String.unsafe_get s (pos + 8) = 'd' - then 4 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_uri_base_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_index = ref (-1L) in + let field_properties = ref (None) in + let field_uri = ref (None) in + let field_uri_base_id = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 3 -> - if String.unsafe_get s pos = 'u' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - then 3 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 1 - else -1 - | 9 -> - if String.unsafe_get s pos = 'u' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'B' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'I' - && String.unsafe_get s (pos + 8) = 'd' - then 4 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 3 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'B' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'I' && String.unsafe_get s (pos+8) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_uri_base_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; index = !field_index - ; properties = !field_properties - ; uri = !field_uri - ; uri_base_id = !field_uri_base_id - } - : artifact_location) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_uri_base_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 3 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'B' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'I' && String.unsafe_get s (pos+8) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_uri_base_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + index = !field_index; + properties = !field_properties; + uri = !field_uri; + uri_base_id = !field_uri_base_id; + } + : artifact_location) + ) +) let artifact_location_of_string s = read_artifact_location (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_location_list = - Atdgen_runtime.Oj_run.write_list write_artifact_location -;; - +let write__artifact_location_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_artifact_location + ) +) let string_of__artifact_location_list ?(len = 1024) x = let ob = Buffer.create len in write__artifact_location_list ob x; Buffer.contents ob -;; - -let read__artifact_location_list = Atdgen_runtime.Oj_run.read_list read_artifact_location - +let read__artifact_location_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_artifact_location + ) +) let _artifact_location_list_of_string s = read__artifact_location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_location_list_option = - Atdgen_runtime.Oj_run.write_std_option write__artifact_location_list -;; - +let write__artifact_location_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__artifact_location_list + ) +) let string_of__artifact_location_list_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_location_list_option ob x; Buffer.contents ob -;; - -let read__artifact_location_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__artifact_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__artifact_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__artifact_location_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__artifact_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__artifact_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _artifact_location_list_option_of_string s = read__artifact_location_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_location_option = - Atdgen_runtime.Oj_run.write_std_option write_artifact_location -;; - +let write__artifact_location_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_artifact_location + ) +) let string_of__artifact_location_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_location_option ob x; Buffer.contents ob -;; - -let read__artifact_location_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_artifact_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_artifact_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__artifact_location_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_artifact_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_artifact_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _artifact_location_option_of_string s = read__artifact_location_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_edge : _ -> edge -> _ = +let write_edge : _ -> edge -> _ = ( fun ob (x : edge) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x.id; - (match x.label with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"label\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"sourceNodeId\":"; - Yojson.Safe.write_string ob x.source_node_id; - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"targetNodeId\":"; - Yojson.Safe.write_string ob x.target_node_id; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x.id; + (match x.label with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"label\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"sourceNodeId\":"; + ( + Yojson.Safe.write_string + ) + ob x.source_node_id; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"targetNodeId\":"; + ( + Yojson.Safe.write_string + ) + ob x.target_node_id; + Buffer.add_char ob '}'; +) let string_of_edge ?(len = 1024) x = let ob = Buffer.create len in write_edge ob x; Buffer.contents ob -;; - -let read_edge p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_id = ref None in - let field_label = ref None in - let field_properties = ref None in - let field_source_node_id = ref None in - let field_target_node_id = ref None in - try +let read_edge = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 12 -> - (match String.unsafe_get s pos with - | 's' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'N' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'N' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - then 4 - else -1 - | _ -> -1) - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_label := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_source_node_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> field_target_node_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_id = ref (None) in + let field_label = ref (None) in + let field_properties = ref (None) in + let field_source_node_id = ref (None) in + let field_target_node_id = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 12 -> - (match String.unsafe_get s pos with - | 's' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'N' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'N' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - then 4 - else -1 - | _ -> -1) - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 's' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'N' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'N' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_label := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_source_node_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> field_target_node_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ id = - (match !field_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "id") - ; label = !field_label - ; properties = !field_properties - ; source_node_id = - (match !field_source_node_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "source_node_id") - ; target_node_id = - (match !field_target_node_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "target_node_id") - } - : edge) -;; - -let edge_of_string s = read_edge (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__edge_list = Atdgen_runtime.Oj_run.write_list write_edge - + ( + match i with + | 0 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_label := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_source_node_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 4 -> + field_target_node_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 's' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'N' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'N' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_label := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_source_node_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 4 -> + field_target_node_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + id = (match !field_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "id"); + label = !field_label; + properties = !field_properties; + source_node_id = (match !field_source_node_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "source_node_id"); + target_node_id = (match !field_target_node_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "target_node_id"); + } + : edge) + ) +) +let edge_of_string s = + read_edge (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__edge_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_edge + ) +) let string_of__edge_list ?(len = 1024) x = let ob = Buffer.create len in write__edge_list ob x; Buffer.contents ob -;; - -let read__edge_list = Atdgen_runtime.Oj_run.read_list read_edge - +let read__edge_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_edge + ) +) let _edge_list_of_string s = read__edge_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__edge_list_option = Atdgen_runtime.Oj_run.write_std_option write__edge_list - +let write__edge_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__edge_list + ) +) let string_of__edge_list_option ?(len = 1024) x = let ob = Buffer.create len in write__edge_list_option ob x; Buffer.contents ob -;; - -let read__edge_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__edge_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__edge_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__edge_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__edge_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__edge_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _edge_list_option_of_string s = read__edge_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_location_relationship : _ -> location_relationship -> _ = +let write_location_relationship : _ -> location_relationship -> _ = ( fun ob (x : location_relationship) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.kinds with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kinds\":"; - write__string_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"target\":"; - write_int64 ob x.target; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.kinds with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kinds\":"; + ( + write__string_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"target\":"; + ( + write_int64 + ) + ob x.target; + Buffer.add_char ob '}'; +) let string_of_location_relationship ?(len = 1024) x = let ob = Buffer.create len in write_location_relationship ob x; Buffer.contents ob -;; - -let read_location_relationship p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_kinds = ref None in - let field_properties = ref None in - let field_target = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_location_relationship = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 6 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_target := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_kinds = ref (None) in + let field_properties = ref (None) in + let field_target = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 6 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_target := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; kinds = !field_kinds - ; properties = !field_properties - ; target = - (match !field_target with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "target") - } - : location_relationship) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_target := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_target := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + kinds = !field_kinds; + properties = !field_properties; + target = (match !field_target with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "target"); + } + : location_relationship) + ) +) let location_relationship_of_string s = read_location_relationship (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__location_relationship_list = - Atdgen_runtime.Oj_run.write_list write_location_relationship -;; - +let write__location_relationship_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_location_relationship + ) +) let string_of__location_relationship_list ?(len = 1024) x = let ob = Buffer.create len in write__location_relationship_list ob x; Buffer.contents ob -;; - -let read__location_relationship_list = - Atdgen_runtime.Oj_run.read_list read_location_relationship -;; - +let read__location_relationship_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_location_relationship + ) +) let _location_relationship_list_of_string s = read__location_relationship_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__location_relationship_list_option = - Atdgen_runtime.Oj_run.write_std_option write__location_relationship_list -;; - +let write__location_relationship_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__location_relationship_list + ) +) let string_of__location_relationship_list_option ?(len = 1024) x = let ob = Buffer.create len in write__location_relationship_list_option ob x; Buffer.contents ob -;; - -let read__location_relationship_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__location_relationship_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__location_relationship_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__location_relationship_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__location_relationship_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__location_relationship_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _location_relationship_list_option_of_string s = - read__location_relationship_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_multiformat_message_string : _ -> multiformat_message_string -> _ = + read__location_relationship_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_multiformat_message_string : _ -> multiformat_message_string -> _ = ( fun ob (x : multiformat_message_string) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.markdown with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"markdown\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"text\":"; - Yojson.Safe.write_string ob x.text; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.markdown with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"markdown\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"text\":"; + ( + Yojson.Safe.write_string + ) + ob x.text; + Buffer.add_char ob '}'; +) let string_of_multiformat_message_string ?(len = 1024) x = let ob = Buffer.create len in write_multiformat_message_string ob x; Buffer.contents ob -;; - -let read_multiformat_message_string p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_markdown = ref None in - let field_properties = ref None in - let field_text = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_multiformat_message_string = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 2 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'w' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_markdown := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_markdown = ref (None) in + let field_properties = ref (None) in + let field_text = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 2 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'w' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 2 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'w' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_markdown := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ markdown = !field_markdown - ; properties = !field_properties - ; text = - (match !field_text with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "text") - } - : multiformat_message_string) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_markdown := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 2 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'w' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_markdown := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + markdown = !field_markdown; + properties = !field_properties; + text = (match !field_text with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "text"); + } + : multiformat_message_string) + ) +) let multiformat_message_string_of_string s = read_multiformat_message_string (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__multiformat_message_string_option = - Atdgen_runtime.Oj_run.write_std_option write_multiformat_message_string -;; - +let write__multiformat_message_string_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_multiformat_message_string + ) +) let string_of__multiformat_message_string_option ?(len = 1024) x = let ob = Buffer.create len in write__multiformat_message_string_option ob x; Buffer.contents ob -;; - -let read__multiformat_message_string_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_multiformat_message_string p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_multiformat_message_string p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__multiformat_message_string_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_multiformat_message_string + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_multiformat_message_string + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _multiformat_message_string_option_of_string s = - read__multiformat_message_string_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__x_a05fe6a = - Atdgen_runtime.Oj_run.write_assoc_list + read__multiformat_message_string_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__x_a05fe6a = ( + Atdgen_runtime.Oj_run.write_assoc_list ( Yojson.Safe.write_string + ) ( write_multiformat_message_string -;; - + ) +) let string_of__x_a05fe6a ?(len = 1024) x = let ob = Buffer.create len in write__x_a05fe6a ob x; Buffer.contents ob -;; - -let read__x_a05fe6a = - Atdgen_runtime.Oj_run.read_assoc_list +let read__x_a05fe6a = ( + Atdgen_runtime.Oj_run.read_assoc_list ( Atdgen_runtime.Oj_run.read_string + ) ( read_multiformat_message_string -;; - + ) +) let _x_a05fe6a_of_string s = read__x_a05fe6a (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_artifact_content : _ -> artifact_content -> _ = +let write_artifact_content : _ -> artifact_content -> _ = ( fun ob (x : artifact_content) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.binary with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"binary\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.rendered with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rendered\":"; - write_multiformat_message_string ob x); - (match x.text with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"text\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.binary with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"binary\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.rendered with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rendered\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.text with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"text\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_artifact_content ?(len = 1024) x = let ob = Buffer.create len in write_artifact_content ob x; Buffer.contents ob -;; - -let read_artifact_content p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_binary = ref None in - let field_properties = ref None in - let field_rendered = ref None in - let field_text = ref None in - try +let read_artifact_content = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 3 - else -1 - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'y' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'd' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_binary := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rendered := Some (read_multiformat_message_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_binary = ref (None) in + let field_properties = ref (None) in + let field_rendered = ref (None) in + let field_text = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 't' - then 3 - else -1 - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'y' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'd' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_binary := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rendered := Some (read_multiformat_message_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_text := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ binary = !field_binary - ; properties = !field_properties - ; rendered = !field_rendered - ; text = !field_text - } - : artifact_content) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_binary := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rendered := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_binary := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rendered := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_text := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + binary = !field_binary; + properties = !field_properties; + rendered = !field_rendered; + text = !field_text; + } + : artifact_content) + ) +) let artifact_content_of_string s = read_artifact_content (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_content_option = - Atdgen_runtime.Oj_run.write_std_option write_artifact_content -;; - +let write__artifact_content_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_artifact_content + ) +) let string_of__artifact_content_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_content_option ob x; Buffer.contents ob -;; - -let read__artifact_content_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_artifact_content p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_artifact_content p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__artifact_content_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_artifact_content + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_artifact_content + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _artifact_content_option_of_string s = read__artifact_content_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_hm_str_mms = write__x_a05fe6a - +let write_hm_str_mms = ( + write__x_a05fe6a +) let string_of_hm_str_mms ?(len = 1024) x = let ob = Buffer.create len in write_hm_str_mms ob x; Buffer.contents ob -;; - -let read_hm_str_mms = read__x_a05fe6a - +let read_hm_str_mms = ( + read__x_a05fe6a +) let hm_str_mms_of_string s = read_hm_str_mms (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__hm_str_mms_option = Atdgen_runtime.Oj_run.write_std_option write_hm_str_mms - +let write__hm_str_mms_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_hm_str_mms + ) +) let string_of__hm_str_mms_option ?(len = 1024) x = let ob = Buffer.create len in write__hm_str_mms_option ob x; Buffer.contents ob -;; - -let read__hm_str_mms_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_hm_str_mms p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_hm_str_mms p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__hm_str_mms_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_hm_str_mms + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_hm_str_mms + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _hm_str_mms_option_of_string s = read__hm_str_mms_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_edge_traversal : _ -> edge_traversal -> _ = +let write_edge_traversal : _ -> edge_traversal -> _ = ( fun ob (x : edge_traversal) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"edgeId\":"; - Yojson.Safe.write_string ob x.edge_id; - (match x.final_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"finalState\":"; - write_hm_str_mms ob x); - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.step_over_edge_count with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stepOverEdgeCount\":"; - write_int64 ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"edgeId\":"; + ( + Yojson.Safe.write_string + ) + ob x.edge_id; + (match x.final_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"finalState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.step_over_edge_count with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stepOverEdgeCount\":"; + ( + write_int64 + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_edge_traversal ?(len = 1024) x = let ob = Buffer.create len in write_edge_traversal ob x; Buffer.contents ob -;; - -let read_edge_traversal p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_edge_id = ref None in - let field_final_state = ref None in - let field_message = ref None in - let field_properties = ref None in - let field_step_over_edge_count = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_edge_traversal = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'd' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'S' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'e' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - | 17 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'O' - && String.unsafe_get s (pos + 5) = 'v' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'E' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'g' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'C' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'u' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 't' - then 4 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_edge_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_final_state := Some (read_hm_str_mms p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_step_over_edge_count := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_edge_id = ref (None) in + let field_final_state = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + let field_step_over_edge_count = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'd' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'S' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'e' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - | 17 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'O' - && String.unsafe_get s (pos + 5) = 'v' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'E' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'g' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'C' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'u' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 't' - then 4 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'S' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'O' && String.unsafe_get s (pos+5) = 'v' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'E' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'g' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'C' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_edge_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_final_state := Some (read_hm_str_mms p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_step_over_edge_count := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ edge_id = - (match !field_edge_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "edge_id") - ; final_state = !field_final_state - ; message = !field_message - ; properties = !field_properties - ; step_over_edge_count = !field_step_over_edge_count - } - : edge_traversal) -;; - + ( + match i with + | 0 -> + field_edge_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_final_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_step_over_edge_count := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'S' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'O' && String.unsafe_get s (pos+5) = 'v' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'E' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'g' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'C' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_edge_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_final_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_step_over_edge_count := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + edge_id = (match !field_edge_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "edge_id"); + final_state = !field_final_state; + message = !field_message; + properties = !field_properties; + step_over_edge_count = !field_step_over_edge_count; + } + : edge_traversal) + ) +) let edge_traversal_of_string s = read_edge_traversal (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__edge_traversal_list = Atdgen_runtime.Oj_run.write_list write_edge_traversal - +let write__edge_traversal_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_edge_traversal + ) +) let string_of__edge_traversal_list ?(len = 1024) x = let ob = Buffer.create len in write__edge_traversal_list ob x; Buffer.contents ob -;; - -let read__edge_traversal_list = Atdgen_runtime.Oj_run.read_list read_edge_traversal - +let read__edge_traversal_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_edge_traversal + ) +) let _edge_traversal_list_of_string s = read__edge_traversal_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__edge_traversal_list_option = - Atdgen_runtime.Oj_run.write_std_option write__edge_traversal_list -;; - +let write__edge_traversal_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__edge_traversal_list + ) +) let string_of__edge_traversal_list_option ?(len = 1024) x = let ob = Buffer.create len in write__edge_traversal_list_option ob x; Buffer.contents ob -;; - -let read__edge_traversal_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__edge_traversal_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__edge_traversal_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__edge_traversal_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__edge_traversal_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__edge_traversal_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _edge_traversal_list_option_of_string s = read__edge_traversal_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_graph_traversal_variant0 : _ -> graph_traversal_variant0 -> _ = +let write_graph_traversal_variant0 : _ -> graph_traversal_variant0 -> _ = ( fun ob (x : graph_traversal_variant0) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.edge_traversals with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"edgeTraversals\":"; - write__edge_traversal_list ob x); - (match x.immutable_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"immutableState\":"; - write_hm_str_mms ob x); - (match x.initial_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"initialState\":"; - write_hm_str_mms ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if x.result_graph_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"resultGraphIndex\":"; - write_int64 ob x.result_graph_index); - if x.run_graph_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"runGraphIndex\":"; - write_int64 ob x.run_graph_index); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.edge_traversals with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"edgeTraversals\":"; + ( + write__edge_traversal_list + ) + ob x; + ); + (match x.immutable_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"immutableState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.initial_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"initialState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if x.result_graph_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"resultGraphIndex\":"; + ( + write_int64 + ) + ob x.result_graph_index; + ); + if x.run_graph_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"runGraphIndex\":"; + ( + write_int64 + ) + ob x.run_graph_index; + ); + Buffer.add_char ob '}'; +) let string_of_graph_traversal_variant0 ?(len = 1024) x = let ob = Buffer.create len in write_graph_traversal_variant0 ob x; Buffer.contents ob -;; - -let read_graph_traversal_variant0 p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_edge_traversals = ref None in - let field_immutable_state = ref None in - let field_initial_state = ref None in - let field_properties = ref None in - let field_result_graph_index = ref (-1L) in - let field_run_graph_index = ref (-1L) in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_graph_traversal_variant0 = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'x' - then 6 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'v' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 's' - then 1 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 2 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'G' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 'h' - && String.unsafe_get s (pos + 11) = 'I' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'x' - then 5 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edge_traversals := Some (read__edge_traversal_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_result_graph_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_graph_index := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_edge_traversals = ref (None) in + let field_immutable_state = ref (None) in + let field_initial_state = ref (None) in + let field_properties = ref (None) in + let field_result_graph_index = ref (-1L) in + let field_run_graph_index = ref (-1L) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'x' - then 6 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'v' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 's' - then 1 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 2 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'G' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 'h' - && String.unsafe_get s (pos + 11) = 'I' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'x' - then 5 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'x' then ( + 6 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'G' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'I' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edge_traversals := Some (read__edge_traversal_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_result_graph_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_graph_index := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; edge_traversals = !field_edge_traversals - ; immutable_state = !field_immutable_state - ; initial_state = !field_initial_state - ; properties = !field_properties - ; result_graph_index = !field_result_graph_index - ; run_graph_index = !field_run_graph_index - } - : graph_traversal_variant0) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edge_traversals := ( + Some ( + ( + read__edge_traversal_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_result_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'x' then ( + 6 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'G' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'I' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edge_traversals := ( + Some ( + ( + read__edge_traversal_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_result_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + edge_traversals = !field_edge_traversals; + immutable_state = !field_immutable_state; + initial_state = !field_initial_state; + properties = !field_properties; + result_graph_index = !field_result_graph_index; + run_graph_index = !field_run_graph_index; + } + : graph_traversal_variant0) + ) +) let graph_traversal_variant0_of_string s = read_graph_traversal_variant0 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_graph_traversal_variant1 : _ -> graph_traversal_variant1 -> _ = +let write_graph_traversal_variant1 : _ -> graph_traversal_variant1 -> _ = ( fun ob (x : graph_traversal_variant1) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.edge_traversals with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"edgeTraversals\":"; - write__edge_traversal_list ob x); - (match x.immutable_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"immutableState\":"; - write_hm_str_mms ob x); - (match x.initial_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"initialState\":"; - write_hm_str_mms ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if x.result_graph_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"resultGraphIndex\":"; - write_int64 ob x.result_graph_index); - if x.run_graph_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"runGraphIndex\":"; - write_int64 ob x.run_graph_index); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.edge_traversals with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"edgeTraversals\":"; + ( + write__edge_traversal_list + ) + ob x; + ); + (match x.immutable_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"immutableState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.initial_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"initialState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if x.result_graph_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"resultGraphIndex\":"; + ( + write_int64 + ) + ob x.result_graph_index; + ); + if x.run_graph_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"runGraphIndex\":"; + ( + write_int64 + ) + ob x.run_graph_index; + ); + Buffer.add_char ob '}'; +) let string_of_graph_traversal_variant1 ?(len = 1024) x = let ob = Buffer.create len in write_graph_traversal_variant1 ob x; Buffer.contents ob -;; - -let read_graph_traversal_variant1 p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_edge_traversals = ref None in - let field_immutable_state = ref None in - let field_initial_state = ref None in - let field_properties = ref None in - let field_result_graph_index = ref (-1L) in - let field_run_graph_index = ref (-1L) in - try +let read_graph_traversal_variant1 = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'x' - then 6 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'v' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 's' - then 1 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 2 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'G' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 'h' - && String.unsafe_get s (pos + 11) = 'I' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'x' - then 5 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edge_traversals := Some (read__edge_traversal_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_result_graph_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_graph_index := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_edge_traversals = ref (None) in + let field_immutable_state = ref (None) in + let field_initial_state = ref (None) in + let field_properties = ref (None) in + let field_result_graph_index = ref (-1L) in + let field_run_graph_index = ref (-1L) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'd' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'x' - then 6 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'v' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 's' - then 1 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 2 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'G' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 'h' - && String.unsafe_get s (pos + 11) = 'I' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'x' - then 5 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'x' then ( + 6 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'G' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'I' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edge_traversals := Some (read__edge_traversal_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_result_graph_index := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_graph_index := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; edge_traversals = !field_edge_traversals - ; immutable_state = !field_immutable_state - ; initial_state = !field_initial_state - ; properties = !field_properties - ; result_graph_index = !field_result_graph_index - ; run_graph_index = !field_run_graph_index - } - : graph_traversal_variant1) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edge_traversals := ( + Some ( + ( + read__edge_traversal_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_result_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'd' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'x' then ( + 6 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'v' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'G' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 'h' && String.unsafe_get s (pos+11) = 'I' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'x' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edge_traversals := ( + Some ( + ( + read__edge_traversal_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_result_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_graph_index := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + edge_traversals = !field_edge_traversals; + immutable_state = !field_immutable_state; + initial_state = !field_initial_state; + properties = !field_properties; + result_graph_index = !field_result_graph_index; + run_graph_index = !field_run_graph_index; + } + : graph_traversal_variant1) + ) +) let graph_traversal_variant1_of_string s = read_graph_traversal_variant1 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_graph_traversal ob x = - match x with - | `Variant0 x -> - Buffer.add_string ob "[\"Variant0\","; - write_graph_traversal_variant0 ob x; - Buffer.add_char ob ']' - | `Variant1 x -> - Buffer.add_string ob "[\"Variant1\","; - write_graph_traversal_variant1 ob x; - Buffer.add_char ob ']' -;; - +let write_graph_traversal = ( + fun ob x -> + match x with + | `Variant0 x -> + Buffer.add_string ob "[\"Variant0\","; + ( + write_graph_traversal_variant0 + ) ob x; + Buffer.add_char ob ']' + | `Variant1 x -> + Buffer.add_string ob "[\"Variant1\","; + ( + write_graph_traversal_variant1 + ) ob x; + Buffer.add_char ob ']' +) let string_of_graph_traversal ?(len = 1024) x = let ob = Buffer.create len in write_graph_traversal ob x; Buffer.contents ob -;; - -let read_graph_traversal p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "Variant0" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_graph_traversal_variant0 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Variant0 x - | "Variant1" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_graph_traversal_variant1 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Variant1 x - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Variant0" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_graph_traversal_variant0 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - `Variant0 x - | "Variant1" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_graph_traversal_variant1 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - `Variant1 x - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_graph_traversal = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "Variant0" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_graph_traversal_variant0 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Variant0 x + | "Variant1" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_graph_traversal_variant1 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Variant1 x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Variant0" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_graph_traversal_variant0 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Variant0 x + | "Variant1" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_graph_traversal_variant1 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + `Variant1 x + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let graph_traversal_of_string s = read_graph_traversal (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__graph_traversal_list = Atdgen_runtime.Oj_run.write_list write_graph_traversal - +let write__graph_traversal_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_graph_traversal + ) +) let string_of__graph_traversal_list ?(len = 1024) x = let ob = Buffer.create len in write__graph_traversal_list ob x; Buffer.contents ob -;; - -let read__graph_traversal_list = Atdgen_runtime.Oj_run.read_list read_graph_traversal - +let read__graph_traversal_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_graph_traversal + ) +) let _graph_traversal_list_of_string s = read__graph_traversal_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__graph_traversal_list_option = - Atdgen_runtime.Oj_run.write_std_option write__graph_traversal_list -;; - +let write__graph_traversal_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__graph_traversal_list + ) +) let string_of__graph_traversal_list_option ?(len = 1024) x = let ob = Buffer.create len in write__graph_traversal_list_option ob x; Buffer.contents ob -;; - -let read__graph_traversal_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__graph_traversal_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__graph_traversal_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__graph_traversal_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__graph_traversal_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__graph_traversal_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _graph_traversal_list_option_of_string s = read__graph_traversal_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_rectangle : _ -> rectangle -> _ = +let write_rectangle : _ -> rectangle -> _ = ( fun ob (x : rectangle) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.bottom with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"bottom\":"; - Yojson.Safe.write_std_float ob x); - (match x.left with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"left\":"; - Yojson.Safe.write_std_float ob x); - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.right with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"right\":"; - Yojson.Safe.write_std_float ob x); - (match x.top with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"top\":"; - Yojson.Safe.write_std_float ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.bottom with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"bottom\":"; + ( + Yojson.Safe.write_std_float + ) + ob x; + ); + (match x.left with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"left\":"; + ( + Yojson.Safe.write_std_float + ) + ob x; + ); + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.right with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"right\":"; + ( + Yojson.Safe.write_std_float + ) + ob x; + ); + (match x.top with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"top\":"; + ( + Yojson.Safe.write_std_float + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_rectangle ?(len = 1024) x = let ob = Buffer.create len in write_rectangle ob x; Buffer.contents ob -;; - -let read_rectangle p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_bottom = ref None in - let field_left = ref None in - let field_message = ref None in - let field_properties = ref None in - let field_right = ref None in - let field_top = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_rectangle = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 3 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'p' - then 5 - else -1 - | 4 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 't' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 't' - then 4 - else -1 - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'm' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_bottom := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_left := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_right := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_top := Some (Atdgen_runtime.Oj_run.read_number p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_bottom = ref (None) in + let field_left = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + let field_right = ref (None) in + let field_top = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 3 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'p' - then 5 - else -1 - | 4 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 't' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 't' - then 4 - else -1 - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'm' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 3 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'p' then ( + 5 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'm' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_bottom := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_left := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_right := Some (Atdgen_runtime.Oj_run.read_number p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_top := Some (Atdgen_runtime.Oj_run.read_number p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ bottom = !field_bottom - ; left = !field_left - ; message = !field_message - ; properties = !field_properties - ; right = !field_right - ; top = !field_top - } - : rectangle) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_bottom := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_left := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_right := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_top := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 3 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'p' then ( + 5 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'm' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_bottom := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_left := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_right := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_top := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_number + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + bottom = !field_bottom; + left = !field_left; + message = !field_message; + properties = !field_properties; + right = !field_right; + top = !field_top; + } + : rectangle) + ) +) let rectangle_of_string s = read_rectangle (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__rectangle_list = Atdgen_runtime.Oj_run.write_list write_rectangle - +let write__rectangle_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_rectangle + ) +) let string_of__rectangle_list ?(len = 1024) x = let ob = Buffer.create len in write__rectangle_list ob x; Buffer.contents ob -;; - -let read__rectangle_list = Atdgen_runtime.Oj_run.read_list read_rectangle - +let read__rectangle_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_rectangle + ) +) let _rectangle_list_of_string s = read__rectangle_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__rectangle_list_option = - Atdgen_runtime.Oj_run.write_std_option write__rectangle_list -;; - +let write__rectangle_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__rectangle_list + ) +) let string_of__rectangle_list_option ?(len = 1024) x = let ob = Buffer.create len in write__rectangle_list_option ob x; Buffer.contents ob -;; - -let read__rectangle_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__rectangle_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__rectangle_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__rectangle_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__rectangle_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__rectangle_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _rectangle_list_option_of_string s = read__rectangle_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_region : _ -> region -> _ = +let write_region : _ -> region -> _ = ( fun ob (x : region) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.byte_length with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"byteLength\":"; - write_int64 ob x); - if x.byte_offset <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"byteOffset\":"; - write_int64 ob x.byte_offset); - (match x.char_length with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"charLength\":"; - write_int64 ob x); - if x.char_offset <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"charOffset\":"; - write_int64 ob x.char_offset); - (match x.end_column with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"endColumn\":"; - write_int64 ob x); - (match x.end_line with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"endLine\":"; - write_int64 ob x); - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.snippet with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"snippet\":"; - write_artifact_content ob x); - (match x.source_language with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"sourceLanguage\":"; - Yojson.Safe.write_string ob x); - (match x.start_column with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"startColumn\":"; - write_int64 ob x); - (match x.start_line with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"startLine\":"; - write_int64 ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.byte_length with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"byteLength\":"; + ( + write_int64 + ) + ob x; + ); + if x.byte_offset <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"byteOffset\":"; + ( + write_int64 + ) + ob x.byte_offset; + ); + (match x.char_length with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"charLength\":"; + ( + write_int64 + ) + ob x; + ); + if x.char_offset <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"charOffset\":"; + ( + write_int64 + ) + ob x.char_offset; + ); + (match x.end_column with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"endColumn\":"; + ( + write_int64 + ) + ob x; + ); + (match x.end_line with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"endLine\":"; + ( + write_int64 + ) + ob x; + ); + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.snippet with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"snippet\":"; + ( + write_artifact_content + ) + ob x; + ); + (match x.source_language with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"sourceLanguage\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.start_column with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"startColumn\":"; + ( + write_int64 + ) + ob x; + ); + (match x.start_line with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"startLine\":"; + ( + write_int64 + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_region ?(len = 1024) x = let ob = Buffer.create len in write_region ob x; Buffer.contents ob -;; - -let read_region p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_byte_length = ref None in - let field_byte_offset = ref (-1L) in - let field_char_length = ref None in - let field_char_offset = ref (-1L) in - let field_end_column = ref None in - let field_end_line = ref None in - let field_message = ref None in - let field_properties = ref None in - let field_snippet = ref None in - let field_source_language = ref None in - let field_start_column = ref None in - let field_start_line = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_region = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'L' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'e' - then 5 - else -1 - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 6 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'p' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - then 8 - else -1 - | _ -> -1) - | 9 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'C' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'n' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'L' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'e' - then 11 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'b' -> - if String.unsafe_get s (pos + 1) = 'y' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - then ( - match String.unsafe_get s (pos + 4) with - | 'L' -> - if String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'h' - then 0 - else -1 - | 'O' -> - if String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'f' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 't' - then 1 - else -1 - | _ -> -1) - else -1 - | 'c' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - then ( - match String.unsafe_get s (pos + 4) with - | 'L' -> - if String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'h' - then 2 - else -1 - | 'O' -> - if String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'f' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 't' - then 3 - else -1 - | _ -> -1) - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 7 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'C' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 'm' - && String.unsafe_get s (pos + 10) = 'n' - then 10 - else -1 - | 14 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'L' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - then 9 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_byte_length := Some (read_int64 p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_byte_offset := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_char_length := Some (read_int64 p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_char_offset := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_column := Some (read_int64 p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_line := Some (read_int64 p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_snippet := Some (read_artifact_content p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_column := Some (read_int64 p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_line := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_byte_length = ref (None) in + let field_byte_offset = ref (-1L) in + let field_char_length = ref (None) in + let field_char_offset = ref (-1L) in + let field_end_column = ref (None) in + let field_end_line = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + let field_snippet = ref (None) in + let field_source_language = ref (None) in + let field_start_column = ref (None) in + let field_start_line = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'L' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'e' - then 5 - else -1 - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 6 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'p' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - then 8 - else -1 - | _ -> -1) - | 9 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'C' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'n' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'L' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'e' - then 11 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'b' -> - if String.unsafe_get s (pos + 1) = 'y' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - then ( - match String.unsafe_get s (pos + 4) with - | 'L' -> - if String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'h' - then 0 - else -1 - | 'O' -> - if String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'f' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 't' - then 1 - else -1 - | _ -> -1) - else -1 - | 'c' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - then ( - match String.unsafe_get s (pos + 4) with - | 'L' -> - if String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'h' - then 2 - else -1 - | 'O' -> - if String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'f' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 't' - then 3 - else -1 - | _ -> -1) - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 7 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'C' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 'm' - && String.unsafe_get s (pos + 10) = 'n' - then 10 - else -1 - | 14 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'L' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - then 9 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'L' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'p' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'C' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'L' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'e' then ( + 11 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'b' -> ( + if String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' then ( + match String.unsafe_get s (pos+4) with + | 'L' -> ( + if String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'h' then ( + 0 + ) + else ( + -1 + ) + ) + | 'O' -> ( + if String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' then ( + match String.unsafe_get s (pos+4) with + | 'L' -> ( + if String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'h' then ( + 2 + ) + else ( + -1 + ) + ) + | 'O' -> ( + if String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'C' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'n' then ( + 10 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'L' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_byte_length := Some (read_int64 p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_byte_offset := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_char_length := Some (read_int64 p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_char_offset := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_column := Some (read_int64 p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_line := Some (read_int64 p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_snippet := Some (read_artifact_content p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_column := Some (read_int64 p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_line := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ byte_length = !field_byte_length - ; byte_offset = !field_byte_offset - ; char_length = !field_char_length - ; char_offset = !field_char_offset - ; end_column = !field_end_column - ; end_line = !field_end_line - ; message = !field_message - ; properties = !field_properties - ; snippet = !field_snippet - ; source_language = !field_source_language - ; start_column = !field_start_column - ; start_line = !field_start_line - } - : region) -;; - -let region_of_string s = read_region (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__region_list = Atdgen_runtime.Oj_run.write_list write_region - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_byte_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_byte_offset := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_char_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_char_offset := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_column := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_line := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_snippet := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_column := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_line := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'L' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'p' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'C' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'L' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'e' then ( + 11 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'b' -> ( + if String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' then ( + match String.unsafe_get s (pos+4) with + | 'L' -> ( + if String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'h' then ( + 0 + ) + else ( + -1 + ) + ) + | 'O' -> ( + if String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' then ( + match String.unsafe_get s (pos+4) with + | 'L' -> ( + if String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'h' then ( + 2 + ) + else ( + -1 + ) + ) + | 'O' -> ( + if String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'f' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'C' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'm' && String.unsafe_get s (pos+10) = 'n' then ( + 10 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'L' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_byte_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_byte_offset := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_char_length := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_char_offset := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_column := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_line := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_snippet := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_column := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_line := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + byte_length = !field_byte_length; + byte_offset = !field_byte_offset; + char_length = !field_char_length; + char_offset = !field_char_offset; + end_column = !field_end_column; + end_line = !field_end_line; + message = !field_message; + properties = !field_properties; + snippet = !field_snippet; + source_language = !field_source_language; + start_column = !field_start_column; + start_line = !field_start_line; + } + : region) + ) +) +let region_of_string s = + read_region (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__region_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_region + ) +) let string_of__region_list ?(len = 1024) x = let ob = Buffer.create len in write__region_list ob x; Buffer.contents ob -;; - -let read__region_list = Atdgen_runtime.Oj_run.read_list read_region - +let read__region_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_region + ) +) let _region_list_of_string s = read__region_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__region_list_option = Atdgen_runtime.Oj_run.write_std_option write__region_list - +let write__region_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__region_list + ) +) let string_of__region_list_option ?(len = 1024) x = let ob = Buffer.create len in write__region_list_option ob x; Buffer.contents ob -;; - -let read__region_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__region_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__region_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__region_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__region_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__region_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _region_list_option_of_string s = read__region_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__region_option = Atdgen_runtime.Oj_run.write_std_option write_region - +let write__region_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_region + ) +) let string_of__region_option ?(len = 1024) x = let ob = Buffer.create len in write__region_option ob x; Buffer.contents ob -;; - -let read__region_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_region p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_region p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__region_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_region + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_region + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _region_option_of_string s = read__region_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_attachment : _ -> attachment -> _ = +let write_attachment : _ -> attachment -> _ = ( fun ob (x : attachment) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifactLocation\":"; - write_artifact_location ob x.artifact_location; - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.rectangles with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rectangles\":"; - write__rectangle_list ob x); - (match x.regions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"regions\":"; - write__region_list ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifactLocation\":"; + ( + write_artifact_location + ) + ob x.artifact_location; + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.rectangles with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rectangles\":"; + ( + write__rectangle_list + ) + ob x; + ); + (match x.regions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"regions\":"; + ( + write__region_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_attachment ?(len = 1024) x = let ob = Buffer.create len in write_attachment ob x; Buffer.contents ob -;; - -let read_attachment p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_artifact_location = ref None in - let field_description = ref None in - let field_properties = ref None in - let field_rectangles = ref None in - let field_regions = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_attachment = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 's' - then 4 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_artifact_location := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rectangles := Some (read__rectangle_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_regions := Some (read__region_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_artifact_location = ref (None) in + let field_description = ref (None) in + let field_properties = ref (None) in + let field_rectangles = ref (None) in + let field_regions = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 's' - then 4 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_artifact_location := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rectangles := Some (read__rectangle_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_regions := Some (read__region_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ artifact_location = - (match !field_artifact_location with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_location") - ; description = !field_description - ; properties = !field_properties - ; rectangles = !field_rectangles - ; regions = !field_regions - } - : attachment) -;; - + ( + match i with + | 0 -> + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rectangles := ( + Some ( + ( + read__rectangle_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_regions := ( + Some ( + ( + read__region_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rectangles := ( + Some ( + ( + read__rectangle_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_regions := ( + Some ( + ( + read__region_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + artifact_location = (match !field_artifact_location with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_location"); + description = !field_description; + properties = !field_properties; + rectangles = !field_rectangles; + regions = !field_regions; + } + : attachment) + ) +) let attachment_of_string s = read_attachment (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__attachment_list = Atdgen_runtime.Oj_run.write_list write_attachment - +let write__attachment_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_attachment + ) +) let string_of__attachment_list ?(len = 1024) x = let ob = Buffer.create len in write__attachment_list ob x; Buffer.contents ob -;; - -let read__attachment_list = Atdgen_runtime.Oj_run.read_list read_attachment - +let read__attachment_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_attachment + ) +) let _attachment_list_of_string s = read__attachment_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__attachment_list_option = - Atdgen_runtime.Oj_run.write_std_option write__attachment_list -;; - +let write__attachment_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__attachment_list + ) +) let string_of__attachment_list_option ?(len = 1024) x = let ob = Buffer.create len in write__attachment_list_option ob x; Buffer.contents ob -;; - -let read__attachment_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__attachment_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__attachment_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__attachment_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__attachment_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__attachment_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _attachment_list_option_of_string s = read__attachment_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_physical_location : _ -> physical_location -> _ = +let write_physical_location : _ -> physical_location -> _ = ( fun ob (x : physical_location) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.address with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"address\":"; - write_address ob x); - (match x.artifact_location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifactLocation\":"; - write_artifact_location ob x); - (match x.context_region with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"contextRegion\":"; - write_region ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.region with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"region\":"; - write_region ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.address with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"address\":"; + ( + write_address + ) + ob x; + ); + (match x.artifact_location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifactLocation\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.context_region with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"contextRegion\":"; + ( + write_region + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.region with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"region\":"; + ( + write_region + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_physical_location ?(len = 1024) x = let ob = Buffer.create len in write_physical_location ob x; Buffer.contents ob -;; - -let read_physical_location p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_address = ref None in - let field_artifact_location = ref None in - let field_context_region = ref None in - let field_properties = ref None in - let field_region = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_physical_location = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - then 4 - else -1 - | 7 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'x' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 2 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_address := Some (read_address p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifact_location := Some (read_artifact_location p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_context_region := Some (read_region p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_region := Some (read_region p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_address = ref (None) in + let field_artifact_location = ref (None) in + let field_context_region = ref (None) in + let field_properties = ref (None) in + let field_region = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - then 4 - else -1 - | 7 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'x' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 2 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'x' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_address := Some (read_address p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifact_location := Some (read_artifact_location p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_context_region := Some (read_region p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_region := Some (read_region p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ address = !field_address - ; artifact_location = !field_artifact_location - ; context_region = !field_context_region - ; properties = !field_properties - ; region = !field_region - } - : physical_location) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_address := ( + Some ( + ( + read_address + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_context_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'x' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_address := ( + Some ( + ( + read_address + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_context_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + address = !field_address; + artifact_location = !field_artifact_location; + context_region = !field_context_region; + properties = !field_properties; + region = !field_region; + } + : physical_location) + ) +) let physical_location_of_string s = read_physical_location (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__physical_location_list = - Atdgen_runtime.Oj_run.write_list write_physical_location -;; - +let write__physical_location_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_physical_location + ) +) let string_of__physical_location_list ?(len = 1024) x = let ob = Buffer.create len in write__physical_location_list ob x; Buffer.contents ob -;; - -let read__physical_location_list = Atdgen_runtime.Oj_run.read_list read_physical_location - +let read__physical_location_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_physical_location + ) +) let _physical_location_list_of_string s = read__physical_location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__physical_location_list_option = - Atdgen_runtime.Oj_run.write_std_option write__physical_location_list -;; - +let write__physical_location_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__physical_location_list + ) +) let string_of__physical_location_list_option ?(len = 1024) x = let ob = Buffer.create len in write__physical_location_list_option ob x; Buffer.contents ob -;; - -let read__physical_location_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__physical_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__physical_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__physical_location_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__physical_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__physical_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _physical_location_list_option_of_string s = read__physical_location_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__physical_location_option = - Atdgen_runtime.Oj_run.write_std_option write_physical_location -;; - +let write__physical_location_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_physical_location + ) +) let string_of__physical_location_option ?(len = 1024) x = let ob = Buffer.create len in write__physical_location_option ob x; Buffer.contents ob -;; - -let read__physical_location_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_physical_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_physical_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__physical_location_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_physical_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_physical_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _physical_location_option_of_string s = read__physical_location_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_location : _ -> location -> _ = +let write_location : _ -> location -> _ = ( fun ob (x : location) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.annotations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"annotations\":"; - write__region_list ob x); - if x.id <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - write_int64 ob x.id); - (match x.logical_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"logicalLocations\":"; - write__logical_location_list ob x); - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.physical_location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"physicalLocation\":"; - write_physical_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.relationships with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"relationships\":"; - write__location_relationship_list ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.annotations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"annotations\":"; + ( + write__region_list + ) + ob x; + ); + if x.id <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + write_int64 + ) + ob x.id; + ); + (match x.logical_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"logicalLocations\":"; + ( + write__logical_location_list + ) + ob x; + ); + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.physical_location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"physicalLocation\":"; + ( + write_physical_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.relationships with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"relationships\":"; + ( + write__location_relationship_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_location ?(len = 1024) x = let ob = Buffer.create len in write_location ob x; Buffer.contents ob -;; - -let read_location p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_annotations = ref None in - let field_id = ref (-1L) in - let field_logical_locations = ref None in - let field_message = ref None in - let field_physical_location = ref None in - let field_properties = ref None in - let field_relationships = ref None in - try +let read_location = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 11 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 0 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 's' - then 6 - else -1 - | 16 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 2 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'y' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 4 - else -1 - | _ -> -1) - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_annotations := Some (read__region_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_id := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_physical_location := Some (read_physical_location p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_relationships := Some (read__location_relationship_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_annotations = ref (None) in + let field_id = ref (-1L) in + let field_logical_locations = ref (None) in + let field_message = ref (None) in + let field_physical_location = ref (None) in + let field_properties = ref (None) in + let field_relationships = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 11 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 0 - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 's' - then 6 - else -1 - | 16 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 2 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'y' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 4 - else -1 - | _ -> -1) - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'y' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_annotations := Some (read__region_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_id := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_physical_location := Some (read_physical_location p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_relationships := Some (read__location_relationship_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ annotations = !field_annotations - ; id = !field_id - ; logical_locations = !field_logical_locations - ; message = !field_message - ; physical_location = !field_physical_location - ; properties = !field_properties - ; relationships = !field_relationships - } - : location) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_annotations := ( + Some ( + ( + read__region_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_physical_location := ( + Some ( + ( + read_physical_location + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relationships := ( + Some ( + ( + read__location_relationship_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'y' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_annotations := ( + Some ( + ( + read__region_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_physical_location := ( + Some ( + ( + read_physical_location + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relationships := ( + Some ( + ( + read__location_relationship_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + annotations = !field_annotations; + id = !field_id; + logical_locations = !field_logical_locations; + message = !field_message; + physical_location = !field_physical_location; + properties = !field_properties; + relationships = !field_relationships; + } + : location) + ) +) let location_of_string s = read_location (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__location_list = Atdgen_runtime.Oj_run.write_list write_location - +let write__location_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_location + ) +) let string_of__location_list ?(len = 1024) x = let ob = Buffer.create len in write__location_list ob x; Buffer.contents ob -;; - -let read__location_list = Atdgen_runtime.Oj_run.read_list read_location - +let read__location_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_location + ) +) let _location_list_of_string s = read__location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__location_list_option = - Atdgen_runtime.Oj_run.write_std_option write__location_list -;; - +let write__location_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__location_list + ) +) let string_of__location_list_option ?(len = 1024) x = let ob = Buffer.create len in write__location_list_option ob x; Buffer.contents ob -;; - -let read__location_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__location_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _location_list_option_of_string s = read__location_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__location_option = Atdgen_runtime.Oj_run.write_std_option write_location - +let write__location_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_location + ) +) let string_of__location_option ?(len = 1024) x = let ob = Buffer.create len in write__location_option ob x; Buffer.contents ob -;; - -let read__location_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_location p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__location_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_location + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _location_option_of_string s = read__location_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_replacement : _ -> replacement -> _ = +let write_replacement : _ -> replacement -> _ = ( fun ob (x : replacement) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"deletedRegion\":"; - write_region ob x.deleted_region; - (match x.inserted_content with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"insertedContent\":"; - write_artifact_content ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"deletedRegion\":"; + ( + write_region + ) + ob x.deleted_region; + (match x.inserted_content with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"insertedContent\":"; + ( + write_artifact_content + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_replacement ?(len = 1024) x = let ob = Buffer.create len in write_replacement ob x; Buffer.contents ob -;; - -let read_replacement p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_deleted_region = ref None in - let field_inserted_content = ref None in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_replacement = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 13 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 0 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'C' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 't' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_deleted_region := Some (read_region p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_inserted_content := Some (read_artifact_content p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_deleted_region = ref (None) in + let field_inserted_content = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 13 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 0 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'C' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 't' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'C' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_deleted_region := Some (read_region p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_inserted_content := Some (read_artifact_content p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ deleted_region = - (match !field_deleted_region with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "deleted_region") - ; inserted_content = !field_inserted_content - ; properties = !field_properties - } - : replacement) -;; - + ( + match i with + | 0 -> + field_deleted_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inserted_content := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'C' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_deleted_region := ( + Some ( + ( + read_region + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inserted_content := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + deleted_region = (match !field_deleted_region with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "deleted_region"); + inserted_content = !field_inserted_content; + properties = !field_properties; + } + : replacement) + ) +) let replacement_of_string s = read_replacement (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__replacement_list = Atdgen_runtime.Oj_run.write_list write_replacement - +let write__replacement_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_replacement + ) +) let string_of__replacement_list ?(len = 1024) x = let ob = Buffer.create len in write__replacement_list ob x; Buffer.contents ob -;; - -let read__replacement_list = Atdgen_runtime.Oj_run.read_list read_replacement - +let read__replacement_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_replacement + ) +) let _replacement_list_of_string s = read__replacement_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_artifact_change : _ -> artifact_change -> _ = +let write_artifact_change : _ -> artifact_change -> _ = ( fun ob (x : artifact_change) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifactLocation\":"; - write_artifact_location ob x.artifact_location; - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"replacements\":"; - write__replacement_list ob x.replacements; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifactLocation\":"; + ( + write_artifact_location + ) + ob x.artifact_location; + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"replacements\":"; + ( + write__replacement_list + ) + ob x.replacements; + Buffer.add_char ob '}'; +) let string_of_artifact_change ?(len = 1024) x = let ob = Buffer.create len in write_artifact_change ob x; Buffer.contents ob -;; - -let read_artifact_change p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_artifact_location = ref None in - let field_properties = ref None in - let field_replacements = ref None in - try +let read_artifact_change = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 12 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 's' - then 2 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_artifact_location := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_replacements := Some (read__replacement_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_artifact_location = ref (None) in + let field_properties = ref (None) in + let field_replacements = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 12 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 's' - then 2 - else -1 - | 16 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'L' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'c' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_artifact_location := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_replacements := Some (read__replacement_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ artifact_location = - (match !field_artifact_location with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_location") - ; properties = !field_properties - ; replacements = - (match !field_replacements with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "replacements") - } - : artifact_change) -;; - + ( + match i with + | 0 -> + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_replacements := ( + Some ( + ( + read__replacement_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'L' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'c' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_artifact_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_replacements := ( + Some ( + ( + read__replacement_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + artifact_location = (match !field_artifact_location with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_location"); + properties = !field_properties; + replacements = (match !field_replacements with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "replacements"); + } + : artifact_change) + ) +) let artifact_change_of_string s = read_artifact_change (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__artifact_change_list = Atdgen_runtime.Oj_run.write_list write_artifact_change - +let write__artifact_change_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_artifact_change + ) +) let string_of__artifact_change_list ?(len = 1024) x = let ob = Buffer.create len in write__artifact_change_list ob x; Buffer.contents ob -;; - -let read__artifact_change_list = Atdgen_runtime.Oj_run.read_list read_artifact_change - +let read__artifact_change_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_artifact_change + ) +) let _artifact_change_list_of_string s = read__artifact_change_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_fix : _ -> fix -> _ = +let write_fix : _ -> fix -> _ = ( fun ob (x : fix) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifactChanges\":"; - write__artifact_change_list ob x.artifact_changes; - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifactChanges\":"; + ( + write__artifact_change_list + ) + ob x.artifact_changes; + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_fix ?(len = 1024) x = let ob = Buffer.create len in write_fix ob x; Buffer.contents ob -;; - -let read_fix p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_artifact_changes = ref None in - let field_description = ref None in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_fix = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 15 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'C' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_artifact_changes := Some (read__artifact_change_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_artifact_changes = ref (None) in + let field_description = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 15 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'C' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'C' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_artifact_changes := Some (read__artifact_change_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ artifact_changes = - (match !field_artifact_changes with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_changes") - ; description = !field_description - ; properties = !field_properties - } - : fix) -;; - -let fix_of_string s = read_fix (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__fix_list = Atdgen_runtime.Oj_run.write_list write_fix - + ( + match i with + | 0 -> + field_artifact_changes := ( + Some ( + ( + read__artifact_change_list + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'C' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_artifact_changes := ( + Some ( + ( + read__artifact_change_list + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + artifact_changes = (match !field_artifact_changes with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "artifact_changes"); + description = !field_description; + properties = !field_properties; + } + : fix) + ) +) +let fix_of_string s = + read_fix (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__fix_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_fix + ) +) let string_of__fix_list ?(len = 1024) x = let ob = Buffer.create len in write__fix_list ob x; Buffer.contents ob -;; - -let read__fix_list = Atdgen_runtime.Oj_run.read_list read_fix - +let read__fix_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_fix + ) +) let _fix_list_of_string s = read__fix_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__fix_list_option = Atdgen_runtime.Oj_run.write_std_option write__fix_list - +let write__fix_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__fix_list + ) +) let string_of__fix_list_option ?(len = 1024) x = let ob = Buffer.create len in write__fix_list_option ob x; Buffer.contents ob -;; - -let read__fix_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__fix_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__fix_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__fix_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__fix_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__fix_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _fix_list_option_of_string s = read__fix_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_reporting_configuration_level ob x = - match x with - | `None -> Buffer.add_string ob "\"none\"" - | `Note -> Buffer.add_string ob "\"note\"" - | `Warning -> Buffer.add_string ob "\"warning\"" - | `Error -> Buffer.add_string ob "\"error\"" -;; - +let write_reporting_configuration_level = ( + fun ob x -> + match x with + | `None -> Buffer.add_string ob "\"none\"" + | `Note -> Buffer.add_string ob "\"note\"" + | `Warning -> Buffer.add_string ob "\"warning\"" + | `Error -> Buffer.add_string ob "\"error\"" +) let string_of_reporting_configuration_level ?(len = 1024) x = let ob = Buffer.create len in write_reporting_configuration_level ob x; Buffer.contents ob -;; - -let read_reporting_configuration_level p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "none" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `None - | "note" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Note - | "warning" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Warning - | "error" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "none" -> `None - | "note" -> `Note - | "warning" -> `Warning - | "error" -> `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_reporting_configuration_level = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "none" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `None + | "note" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Note + | "warning" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Warning + | "error" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "none" -> + `None + | "note" -> + `Note + | "warning" -> + `Warning + | "error" -> + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let reporting_configuration_level_of_string s = read_reporting_configuration_level (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_configuration_level_option = - Atdgen_runtime.Oj_run.write_std_option write_reporting_configuration_level -;; - +let write__reporting_configuration_level_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_reporting_configuration_level + ) +) let string_of__reporting_configuration_level_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_configuration_level_option ob x; Buffer.contents ob -;; - -let read__reporting_configuration_level_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_reporting_configuration_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_reporting_configuration_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_configuration_level_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_reporting_configuration_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_reporting_configuration_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_configuration_level_option_of_string s = - read__reporting_configuration_level_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_reporting_configuration : _ -> reporting_configuration -> _ = + read__reporting_configuration_level_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_reporting_configuration : _ -> reporting_configuration -> _ = ( fun ob (x : reporting_configuration) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if x.enabled <> true - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"enabled\":"; - Yojson.Safe.write_bool ob x.enabled); - (match x.level with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"level\":"; - write_reporting_configuration_level ob x); - (match x.parameters with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parameters\":"; - write_property_bag ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if x.rank <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rank\":"; - write_int64 ob x.rank); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if x.enabled <> true then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"enabled\":"; + ( + Yojson.Safe.write_bool + ) + ob x.enabled; + ); + (match x.level with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"level\":"; + ( + write_reporting_configuration_level + ) + ob x; + ); + (match x.parameters with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parameters\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if x.rank <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rank\":"; + ( + write_int64 + ) + ob x.rank; + ); + Buffer.add_char ob '}'; +) let string_of_reporting_configuration ?(len = 1024) x = let ob = Buffer.create len in write_reporting_configuration ob x; Buffer.contents ob -;; - -let read_reporting_configuration p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_enabled = ref true in - let field_level = ref None in - let field_parameters = ref None in - let field_properties = ref None in - let field_rank = ref (-1L) in - try +let read_reporting_configuration = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'k' - then 4 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 1 - else -1 - | 7 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'b' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_enabled := Atdgen_runtime.Oj_run.read_bool p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_reporting_configuration_level p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_rank := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_enabled = ref (true) in + let field_level = ref (None) in + let field_parameters = ref (None) in + let field_properties = ref (None) in + let field_rank = ref (-1L) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'k' - then 4 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 1 - else -1 - | 7 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'b' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'k' then ( + 4 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 1 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_enabled := Atdgen_runtime.Oj_run.read_bool p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_reporting_configuration_level p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read_property_bag p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_rank := read_int64 p lb - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ enabled = !field_enabled - ; level = !field_level - ; parameters = !field_parameters - ; properties = !field_properties - ; rank = !field_rank - } - : reporting_configuration) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_enabled := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_reporting_configuration_level + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rank := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'k' then ( + 4 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 1 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_enabled := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_reporting_configuration_level + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rank := ( + ( + read_int64 + ) p lb + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + enabled = !field_enabled; + level = !field_level; + parameters = !field_parameters; + properties = !field_properties; + rank = !field_rank; + } + : reporting_configuration) + ) +) let reporting_configuration_of_string s = read_reporting_configuration (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_configuration_option = - Atdgen_runtime.Oj_run.write_std_option write_reporting_configuration -;; - +let write__reporting_configuration_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_reporting_configuration + ) +) let string_of__reporting_configuration_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_configuration_option ob x; Buffer.contents ob -;; - -let read__reporting_configuration_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_reporting_configuration p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_reporting_configuration p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_configuration_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_reporting_configuration + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_reporting_configuration + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_configuration_option_of_string s = read__reporting_configuration_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_reporting_descriptor_deprecated_guids_item = Yojson.Safe.write_string - +let write_reporting_descriptor_deprecated_guids_item = ( + Yojson.Safe.write_string +) let string_of_reporting_descriptor_deprecated_guids_item ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor_deprecated_guids_item ob x; Buffer.contents ob -;; - -let read_reporting_descriptor_deprecated_guids_item = Atdgen_runtime.Oj_run.read_string - +let read_reporting_descriptor_deprecated_guids_item = ( + Atdgen_runtime.Oj_run.read_string +) let reporting_descriptor_deprecated_guids_item_of_string s = - read_reporting_descriptor_deprecated_guids_item - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__list_2041d89 = - Atdgen_runtime.Oj_run.write_list write_reporting_descriptor_deprecated_guids_item -;; - + read_reporting_descriptor_deprecated_guids_item (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__list_2041d89 = ( + Atdgen_runtime.Oj_run.write_list ( + write_reporting_descriptor_deprecated_guids_item + ) +) let string_of__list_2041d89 ?(len = 1024) x = let ob = Buffer.create len in write__list_2041d89 ob x; Buffer.contents ob -;; - -let read__list_2041d89 = - Atdgen_runtime.Oj_run.read_list read_reporting_descriptor_deprecated_guids_item -;; - +let read__list_2041d89 = ( + Atdgen_runtime.Oj_run.read_list ( + read_reporting_descriptor_deprecated_guids_item + ) +) let _list_2041d89_of_string s = read__list_2041d89 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__option_aa202c3 = Atdgen_runtime.Oj_run.write_std_option write__list_2041d89 - +let write__option_aa202c3 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__list_2041d89 + ) +) let string_of__option_aa202c3 ?(len = 1024) x = let ob = Buffer.create len in write__option_aa202c3 ob x; Buffer.contents ob -;; - -let read__option_aa202c3 p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__list_2041d89 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__list_2041d89 p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_aa202c3 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__list_2041d89 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__list_2041d89 + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_aa202c3_of_string s = read__option_aa202c3 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_reporting_descriptor_guid = Yojson.Safe.write_string - +let write_reporting_descriptor_guid = ( + Yojson.Safe.write_string +) let string_of_reporting_descriptor_guid ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor_guid ob x; Buffer.contents ob -;; - -let read_reporting_descriptor_guid = Atdgen_runtime.Oj_run.read_string - +let read_reporting_descriptor_guid = ( + Atdgen_runtime.Oj_run.read_string +) let reporting_descriptor_guid_of_string s = read_reporting_descriptor_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_descriptor_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_reporting_descriptor_guid -;; - +let write__reporting_descriptor_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_reporting_descriptor_guid + ) +) let string_of__reporting_descriptor_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_guid_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_reporting_descriptor_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_reporting_descriptor_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_reporting_descriptor_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_reporting_descriptor_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_guid_option_of_string s = - read__reporting_descriptor_guid_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_reporting_descriptor_reference_guid = Yojson.Safe.write_string - + read__reporting_descriptor_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_reporting_descriptor_reference_guid = ( + Yojson.Safe.write_string +) let string_of_reporting_descriptor_reference_guid ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor_reference_guid ob x; Buffer.contents ob -;; - -let read_reporting_descriptor_reference_guid = Atdgen_runtime.Oj_run.read_string - +let read_reporting_descriptor_reference_guid = ( + Atdgen_runtime.Oj_run.read_string +) let reporting_descriptor_reference_guid_of_string s = - read_reporting_descriptor_reference_guid - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__reporting_descriptor_reference_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_reporting_descriptor_reference_guid -;; - + read_reporting_descriptor_reference_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__reporting_descriptor_reference_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_reporting_descriptor_reference_guid + ) +) let string_of__reporting_descriptor_reference_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_reference_guid_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_reference_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_reporting_descriptor_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_reporting_descriptor_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_reference_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_reporting_descriptor_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_reporting_descriptor_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_reference_guid_option_of_string s = - read__reporting_descriptor_reference_guid_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_result_baseline_state ob x = - match x with - | `New -> Buffer.add_string ob "\"new\"" - | `Unchanged -> Buffer.add_string ob "\"unchanged\"" - | `Updated -> Buffer.add_string ob "\"updated\"" - | `Absent -> Buffer.add_string ob "\"absent\"" -;; - + read__reporting_descriptor_reference_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_result_baseline_state = ( + fun ob x -> + match x with + | `New -> Buffer.add_string ob "\"new\"" + | `Unchanged -> Buffer.add_string ob "\"unchanged\"" + | `Updated -> Buffer.add_string ob "\"updated\"" + | `Absent -> Buffer.add_string ob "\"absent\"" +) let string_of_result_baseline_state ?(len = 1024) x = let ob = Buffer.create len in write_result_baseline_state ob x; Buffer.contents ob -;; - -let read_result_baseline_state p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "new" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `New - | "unchanged" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Unchanged - | "updated" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Updated - | "absent" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Absent - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "new" -> `New - | "unchanged" -> `Unchanged - | "updated" -> `Updated - | "absent" -> `Absent - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_result_baseline_state = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "new" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `New + | "unchanged" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Unchanged + | "updated" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Updated + | "absent" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Absent + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "new" -> + `New + | "unchanged" -> + `Unchanged + | "updated" -> + `Updated + | "absent" -> + `Absent + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let result_baseline_state_of_string s = read_result_baseline_state (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_baseline_state_option = - Atdgen_runtime.Oj_run.write_std_option write_result_baseline_state -;; - +let write__result_baseline_state_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_baseline_state + ) +) let string_of__result_baseline_state_option ?(len = 1024) x = let ob = Buffer.create len in write__result_baseline_state_option ob x; Buffer.contents ob -;; - -let read__result_baseline_state_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_baseline_state p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_baseline_state p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_baseline_state_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_baseline_state + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_baseline_state + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_baseline_state_option_of_string s = read__result_baseline_state_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_correlation_guid = Yojson.Safe.write_string - +let write_result_correlation_guid = ( + Yojson.Safe.write_string +) let string_of_result_correlation_guid ?(len = 1024) x = let ob = Buffer.create len in write_result_correlation_guid ob x; Buffer.contents ob -;; - -let read_result_correlation_guid = Atdgen_runtime.Oj_run.read_string - +let read_result_correlation_guid = ( + Atdgen_runtime.Oj_run.read_string +) let result_correlation_guid_of_string s = read_result_correlation_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_correlation_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_result_correlation_guid -;; - +let write__result_correlation_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_correlation_guid + ) +) let string_of__result_correlation_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__result_correlation_guid_option ob x; Buffer.contents ob -;; - -let read__result_correlation_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_correlation_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_correlation_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_correlation_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_correlation_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_correlation_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_correlation_guid_option_of_string s = read__result_correlation_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_guid = Yojson.Safe.write_string - +let write_result_guid = ( + Yojson.Safe.write_string +) let string_of_result_guid ?(len = 1024) x = let ob = Buffer.create len in write_result_guid ob x; Buffer.contents ob -;; - -let read_result_guid = Atdgen_runtime.Oj_run.read_string - +let read_result_guid = ( + Atdgen_runtime.Oj_run.read_string +) let result_guid_of_string s = read_result_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_guid_option = Atdgen_runtime.Oj_run.write_std_option write_result_guid - +let write__result_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_guid + ) +) let string_of__result_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__result_guid_option ob x; Buffer.contents ob -;; - -let read__result_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_guid_option_of_string s = read__result_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_kind ob x = - match x with - | `NotApplicable -> Buffer.add_string ob "\"notApplicable\"" - | `Pass -> Buffer.add_string ob "\"pass\"" - | `Fail -> Buffer.add_string ob "\"fail\"" - | `Review -> Buffer.add_string ob "\"review\"" - | `Open -> Buffer.add_string ob "\"open\"" - | `Informational -> Buffer.add_string ob "\"informational\"" -;; - +let write_result_kind = ( + fun ob x -> + match x with + | `NotApplicable -> Buffer.add_string ob "\"notApplicable\"" + | `Pass -> Buffer.add_string ob "\"pass\"" + | `Fail -> Buffer.add_string ob "\"fail\"" + | `Review -> Buffer.add_string ob "\"review\"" + | `Open -> Buffer.add_string ob "\"open\"" + | `Informational -> Buffer.add_string ob "\"informational\"" +) let string_of_result_kind ?(len = 1024) x = let ob = Buffer.create len in write_result_kind ob x; Buffer.contents ob -;; - -let read_result_kind p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "notApplicable" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `NotApplicable - | "pass" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Pass - | "fail" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Fail - | "review" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Review - | "open" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Open - | "informational" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Informational - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "notApplicable" -> `NotApplicable - | "pass" -> `Pass - | "fail" -> `Fail - | "review" -> `Review - | "open" -> `Open - | "informational" -> `Informational - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_result_kind = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "notApplicable" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `NotApplicable + | "pass" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Pass + | "fail" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Fail + | "review" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Review + | "open" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Open + | "informational" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Informational + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "notApplicable" -> + `NotApplicable + | "pass" -> + `Pass + | "fail" -> + `Fail + | "review" -> + `Review + | "open" -> + `Open + | "informational" -> + `Informational + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let result_kind_of_string s = read_result_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_kind_option = Atdgen_runtime.Oj_run.write_std_option write_result_kind - +let write__result_kind_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_kind + ) +) let string_of__result_kind_option ?(len = 1024) x = let ob = Buffer.create len in write__result_kind_option ob x; Buffer.contents ob -;; - -let read__result_kind_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_kind p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_kind p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_kind_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_kind + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_kind + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_kind_option_of_string s = read__result_kind_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_level ob x = - match x with - | `None -> Buffer.add_string ob "\"none\"" - | `Note -> Buffer.add_string ob "\"note\"" - | `Warning -> Buffer.add_string ob "\"warning\"" - | `Error -> Buffer.add_string ob "\"error\"" -;; - +let write_result_level = ( + fun ob x -> + match x with + | `None -> Buffer.add_string ob "\"none\"" + | `Note -> Buffer.add_string ob "\"note\"" + | `Warning -> Buffer.add_string ob "\"warning\"" + | `Error -> Buffer.add_string ob "\"error\"" +) let string_of_result_level ?(len = 1024) x = let ob = Buffer.create len in write_result_level ob x; Buffer.contents ob -;; - -let read_result_level p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "none" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `None - | "note" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Note - | "warning" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Warning - | "error" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "none" -> `None - | "note" -> `Note - | "warning" -> `Warning - | "error" -> `Error - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_result_level = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "none" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `None + | "note" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Note + | "warning" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Warning + | "error" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "none" -> + `None + | "note" -> + `Note + | "warning" -> + `Warning + | "error" -> + `Error + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let result_level_of_string s = read_result_level (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_level_option = Atdgen_runtime.Oj_run.write_std_option write_result_level - +let write__result_level_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_level + ) +) let string_of__result_level_option ?(len = 1024) x = let ob = Buffer.create len in write__result_level_option ob x; Buffer.contents ob -;; - -let read__result_level_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_level p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_level_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_level + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_level_option_of_string s = read__result_level_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_provenance_first_detection_run_guid = Yojson.Safe.write_string - +let write_result_provenance_first_detection_run_guid = ( + Yojson.Safe.write_string +) let string_of_result_provenance_first_detection_run_guid ?(len = 1024) x = let ob = Buffer.create len in write_result_provenance_first_detection_run_guid ob x; Buffer.contents ob -;; - -let read_result_provenance_first_detection_run_guid = Atdgen_runtime.Oj_run.read_string - +let read_result_provenance_first_detection_run_guid = ( + Atdgen_runtime.Oj_run.read_string +) let result_provenance_first_detection_run_guid_of_string s = - read_result_provenance_first_detection_run_guid - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_60f83e5 = - Atdgen_runtime.Oj_run.write_std_option write_result_provenance_first_detection_run_guid -;; - + read_result_provenance_first_detection_run_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_60f83e5 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_provenance_first_detection_run_guid + ) +) let string_of__option_60f83e5 ?(len = 1024) x = let ob = Buffer.create len in write__option_60f83e5 ob x; Buffer.contents ob -;; - -let read__option_60f83e5 p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_provenance_first_detection_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_provenance_first_detection_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_60f83e5 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_provenance_first_detection_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_provenance_first_detection_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_60f83e5_of_string s = read__option_60f83e5 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_provenance_last_detection_run_guid = Yojson.Safe.write_string - +let write_result_provenance_last_detection_run_guid = ( + Yojson.Safe.write_string +) let string_of_result_provenance_last_detection_run_guid ?(len = 1024) x = let ob = Buffer.create len in write_result_provenance_last_detection_run_guid ob x; Buffer.contents ob -;; - -let read_result_provenance_last_detection_run_guid = Atdgen_runtime.Oj_run.read_string - +let read_result_provenance_last_detection_run_guid = ( + Atdgen_runtime.Oj_run.read_string +) let result_provenance_last_detection_run_guid_of_string s = - read_result_provenance_last_detection_run_guid - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_0fcda76 = - Atdgen_runtime.Oj_run.write_std_option write_result_provenance_last_detection_run_guid -;; - + read_result_provenance_last_detection_run_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_0fcda76 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_provenance_last_detection_run_guid + ) +) let string_of__option_0fcda76 ?(len = 1024) x = let ob = Buffer.create len in write__option_0fcda76 ob x; Buffer.contents ob -;; - -let read__option_0fcda76 p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_provenance_last_detection_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_provenance_last_detection_run_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_0fcda76 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_provenance_last_detection_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_provenance_last_detection_run_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_0fcda76_of_string s = read__option_0fcda76 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result_provenance : _ -> result_provenance -> _ = +let write_result_provenance : _ -> result_provenance -> _ = ( fun ob (x : result_provenance) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.conversion_sources with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"conversionSources\":"; - write__physical_location_list ob x); - (match x.first_detection_run_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"firstDetectionRunGuid\":"; - write_result_provenance_first_detection_run_guid ob x); - (match x.first_detection_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"firstDetectionTimeUtc\":"; - Yojson.Safe.write_string ob x); - if x.invocation_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"invocationIndex\":"; - write_int64 ob x.invocation_index); - (match x.last_detection_run_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"lastDetectionRunGuid\":"; - write_result_provenance_last_detection_run_guid ob x); - (match x.last_detection_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"lastDetectionTimeUtc\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.conversion_sources with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"conversionSources\":"; + ( + write__physical_location_list + ) + ob x; + ); + (match x.first_detection_run_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"firstDetectionRunGuid\":"; + ( + write_result_provenance_first_detection_run_guid + ) + ob x; + ); + (match x.first_detection_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"firstDetectionTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.invocation_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"invocationIndex\":"; + ( + write_int64 + ) + ob x.invocation_index; + ); + (match x.last_detection_run_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"lastDetectionRunGuid\":"; + ( + write_result_provenance_last_detection_run_guid + ) + ob x; + ); + (match x.last_detection_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"lastDetectionTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_result_provenance ?(len = 1024) x = let ob = Buffer.create len in write_result_provenance ob x; Buffer.contents ob -;; - -let read_result_provenance p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_conversion_sources = ref None in - let field_first_detection_run_guid = ref None in - let field_first_detection_time_utc = ref None in - let field_invocation_index = ref (-1L) in - let field_last_detection_run_guid = ref None in - let field_last_detection_time_utc = ref None in - let field_properties = ref None in - try +let read_result_provenance = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'd' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'x' - then 3 - else -1 - | 17 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'S' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'c' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 's' - then 0 - else -1 - | 20 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then ( - match String.unsafe_get s (pos + 13) with - | 'R' -> - if String.unsafe_get s (pos + 14) = 'u' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'G' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'd' - then 4 - else -1 - | 'T' -> - if String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'U' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'c' - then 5 - else -1 - | _ -> -1) - else -1 - | 21 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - then ( - match String.unsafe_get s (pos + 14) with - | 'R' -> - if String.unsafe_get s (pos + 15) = 'u' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'G' - && String.unsafe_get s (pos + 18) = 'u' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'd' - then 1 - else -1 - | 'T' -> - if String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - && String.unsafe_get s (pos + 18) = 'U' - && String.unsafe_get s (pos + 19) = 't' - && String.unsafe_get s (pos + 20) = 'c' - then 2 - else -1 - | _ -> -1) - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion_sources := Some (read__physical_location_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_first_detection_run_guid - := Some (read_result_provenance_first_detection_run_guid p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_first_detection_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocation_index := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_last_detection_run_guid - := Some (read_result_provenance_last_detection_run_guid p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_last_detection_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_conversion_sources = ref (None) in + let field_first_detection_run_guid = ref (None) in + let field_first_detection_time_utc = ref (None) in + let field_invocation_index = ref (-1L) in + let field_last_detection_run_guid = ref (None) in + let field_last_detection_time_utc = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'd' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'x' - then 3 - else -1 - | 17 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'S' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'c' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 's' - then 0 - else -1 - | 20 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then ( - match String.unsafe_get s (pos + 13) with - | 'R' -> - if String.unsafe_get s (pos + 14) = 'u' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'G' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'd' - then 4 - else -1 - | 'T' -> - if String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'U' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'c' - then 5 - else -1 - | _ -> -1) - else -1 - | 21 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - then ( - match String.unsafe_get s (pos + 14) with - | 'R' -> - if String.unsafe_get s (pos + 15) = 'u' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'G' - && String.unsafe_get s (pos + 18) = 'u' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'd' - then 1 - else -1 - | 'T' -> - if String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'm' - && String.unsafe_get s (pos + 17) = 'e' - && String.unsafe_get s (pos + 18) = 'U' - && String.unsafe_get s (pos + 19) = 't' - && String.unsafe_get s (pos + 20) = 'c' - then 2 - else -1 - | _ -> -1) - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'd' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'x' then ( + 3 + ) + else ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'S' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'c' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + match String.unsafe_get s (pos+13) with + | 'R' -> ( + if String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'G' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'T' -> ( + if String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'U' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'c' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' then ( + match String.unsafe_get s (pos+14) with + | 'R' -> ( + if String.unsafe_get s (pos+15) = 'u' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'G' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 'T' -> ( + if String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' && String.unsafe_get s (pos+18) = 'U' && String.unsafe_get s (pos+19) = 't' && String.unsafe_get s (pos+20) = 'c' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion_sources := Some (read__physical_location_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_first_detection_run_guid - := Some (read_result_provenance_first_detection_run_guid p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_first_detection_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocation_index := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_last_detection_run_guid - := Some (read_result_provenance_last_detection_run_guid p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_last_detection_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ conversion_sources = !field_conversion_sources - ; first_detection_run_guid = !field_first_detection_run_guid - ; first_detection_time_utc = !field_first_detection_time_utc - ; invocation_index = !field_invocation_index - ; last_detection_run_guid = !field_last_detection_run_guid - ; last_detection_time_utc = !field_last_detection_time_utc - ; properties = !field_properties - } - : result_provenance) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion_sources := ( + Some ( + ( + read__physical_location_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_first_detection_run_guid := ( + Some ( + ( + read_result_provenance_first_detection_run_guid + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_first_detection_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocation_index := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_detection_run_guid := ( + Some ( + ( + read_result_provenance_last_detection_run_guid + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_detection_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'd' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'x' then ( + 3 + ) + else ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'S' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'c' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + match String.unsafe_get s (pos+13) with + | 'R' -> ( + if String.unsafe_get s (pos+14) = 'u' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'G' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'T' -> ( + if String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'U' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'c' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' then ( + match String.unsafe_get s (pos+14) with + | 'R' -> ( + if String.unsafe_get s (pos+15) = 'u' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'G' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 'T' -> ( + if String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'm' && String.unsafe_get s (pos+17) = 'e' && String.unsafe_get s (pos+18) = 'U' && String.unsafe_get s (pos+19) = 't' && String.unsafe_get s (pos+20) = 'c' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion_sources := ( + Some ( + ( + read__physical_location_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_first_detection_run_guid := ( + Some ( + ( + read_result_provenance_first_detection_run_guid + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_first_detection_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocation_index := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_detection_run_guid := ( + Some ( + ( + read_result_provenance_last_detection_run_guid + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_detection_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + conversion_sources = !field_conversion_sources; + first_detection_run_guid = !field_first_detection_run_guid; + first_detection_time_utc = !field_first_detection_time_utc; + invocation_index = !field_invocation_index; + last_detection_run_guid = !field_last_detection_run_guid; + last_detection_time_utc = !field_last_detection_time_utc; + properties = !field_properties; + } + : result_provenance) + ) +) let result_provenance_of_string s = read_result_provenance (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_provenance_option = - Atdgen_runtime.Oj_run.write_std_option write_result_provenance -;; - +let write__result_provenance_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result_provenance + ) +) let string_of__result_provenance_option ?(len = 1024) x = let ob = Buffer.create len in write__result_provenance_option ob x; Buffer.contents ob -;; - -let read__result_provenance_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result_provenance p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result_provenance p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_provenance_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result_provenance + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result_provenance + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_provenance_option_of_string s = read__result_provenance_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_stack_frame : _ -> stack_frame -> _ = +let write_stack_frame : _ -> stack_frame -> _ = ( fun ob (x : stack_frame) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_location ob x); - (match x.module_ with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"module\":"; - Yojson.Safe.write_string ob x); - (match x.parameters with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parameters\":"; - write__string_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.thread_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadId\":"; - write_int64 ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_location + ) + ob x; + ); + (match x.module_ with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"module\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.parameters with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parameters\":"; + ( + write__string_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.thread_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadId\":"; + ( + write_int64 + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_stack_frame ?(len = 1024) x = let ob = Buffer.create len in write_stack_frame ob x; Buffer.contents ob -;; - -let read_stack_frame p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_location = ref None in - let field_module_ = ref None in - let field_parameters = ref None in - let field_properties = ref None in - let field_thread_id = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_stack_frame = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - then 1 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'd' - then 4 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_module_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read__string_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_id := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_location = ref (None) in + let field_module_ = ref (None) in + let field_parameters = ref (None) in + let field_properties = ref (None) in + let field_thread_id = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - then 1 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'd' - then 4 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_module_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read__string_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_id := Some (read_int64 p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ location = !field_location - ; module_ = !field_module_ - ; parameters = !field_parameters - ; properties = !field_properties - ; thread_id = !field_thread_id - } - : stack_frame) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_module_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_module_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + location = !field_location; + module_ = !field_module_; + parameters = !field_parameters; + properties = !field_properties; + thread_id = !field_thread_id; + } + : stack_frame) + ) +) let stack_frame_of_string s = read_stack_frame (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__stack_frame_list = Atdgen_runtime.Oj_run.write_list write_stack_frame - +let write__stack_frame_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_stack_frame + ) +) let string_of__stack_frame_list ?(len = 1024) x = let ob = Buffer.create len in write__stack_frame_list ob x; Buffer.contents ob -;; - -let read__stack_frame_list = Atdgen_runtime.Oj_run.read_list read_stack_frame - +let read__stack_frame_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_stack_frame + ) +) let _stack_frame_list_of_string s = read__stack_frame_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_stack : _ -> stack -> _ = +let write_stack : _ -> stack -> _ = ( fun ob (x : stack) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"frames\":"; - write__stack_frame_list ob x.frames; - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"frames\":"; + ( + write__stack_frame_list + ) + ob x.frames; + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_stack ?(len = 1024) x = let ob = Buffer.create len in write_stack ob x; Buffer.contents ob -;; - -let read_stack p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_frames = ref None in - let field_message = ref None in - let field_properties = ref None in - try +let read_stack = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_frames := Some (read__stack_frame_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_frames = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_frames := Some (read__stack_frame_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ frames = - (match !field_frames with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "frames") - ; message = !field_message - ; properties = !field_properties - } - : stack) -;; - -let stack_of_string s = read_stack (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__stack_list = Atdgen_runtime.Oj_run.write_list write_stack - + ( + match i with + | 0 -> + field_frames := ( + Some ( + ( + read__stack_frame_list + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_frames := ( + Some ( + ( + read__stack_frame_list + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + frames = (match !field_frames with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "frames"); + message = !field_message; + properties = !field_properties; + } + : stack) + ) +) +let stack_of_string s = + read_stack (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__stack_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_stack + ) +) let string_of__stack_list ?(len = 1024) x = let ob = Buffer.create len in write__stack_list ob x; Buffer.contents ob -;; - -let read__stack_list = Atdgen_runtime.Oj_run.read_list read_stack - +let read__stack_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_stack + ) +) let _stack_list_of_string s = read__stack_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__stack_list_option = Atdgen_runtime.Oj_run.write_std_option write__stack_list - +let write__stack_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__stack_list + ) +) let string_of__stack_list_option ?(len = 1024) x = let ob = Buffer.create len in write__stack_list_option ob x; Buffer.contents ob -;; - -let read__stack_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__stack_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__stack_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__stack_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__stack_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__stack_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _stack_list_option_of_string s = read__stack_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__stack_option = Atdgen_runtime.Oj_run.write_std_option write_stack - +let write__stack_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_stack + ) +) let string_of__stack_option ?(len = 1024) x = let ob = Buffer.create len in write__stack_option ob x; Buffer.contents ob -;; - -let read__stack_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_stack p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_stack p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__stack_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_stack + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_stack + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _stack_option_of_string s = read__stack_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_suppression_guid = Yojson.Safe.write_string - +let write_suppression_guid = ( + Yojson.Safe.write_string +) let string_of_suppression_guid ?(len = 1024) x = let ob = Buffer.create len in write_suppression_guid ob x; Buffer.contents ob -;; - -let read_suppression_guid = Atdgen_runtime.Oj_run.read_string - +let read_suppression_guid = ( + Atdgen_runtime.Oj_run.read_string +) let suppression_guid_of_string s = read_suppression_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__suppression_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_suppression_guid -;; - +let write__suppression_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_suppression_guid + ) +) let string_of__suppression_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__suppression_guid_option ob x; Buffer.contents ob -;; - -let read__suppression_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_suppression_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_suppression_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__suppression_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_suppression_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_suppression_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _suppression_guid_option_of_string s = read__suppression_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_suppression_kind ob x = - match x with - | `InSource -> Buffer.add_string ob "\"inSource\"" - | `External -> Buffer.add_string ob "\"external\"" -;; - +let write_suppression_kind = ( + fun ob x -> + match x with + | `InSource -> Buffer.add_string ob "\"inSource\"" + | `External -> Buffer.add_string ob "\"external\"" +) let string_of_suppression_kind ?(len = 1024) x = let ob = Buffer.create len in write_suppression_kind ob x; Buffer.contents ob -;; - -let read_suppression_kind p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "inSource" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `InSource - | "external" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `External - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "inSource" -> `InSource - | "external" -> `External - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_suppression_kind = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "inSource" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `InSource + | "external" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `External + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "inSource" -> + `InSource + | "external" -> + `External + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let suppression_kind_of_string s = read_suppression_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_suppression_status ob x = - match x with - | `Accepted -> Buffer.add_string ob "\"accepted\"" - | `UnderReview -> Buffer.add_string ob "\"underReview\"" - | `Rejected -> Buffer.add_string ob "\"rejected\"" -;; - +let write_suppression_status = ( + fun ob x -> + match x with + | `Accepted -> Buffer.add_string ob "\"accepted\"" + | `UnderReview -> Buffer.add_string ob "\"underReview\"" + | `Rejected -> Buffer.add_string ob "\"rejected\"" +) let string_of_suppression_status ?(len = 1024) x = let ob = Buffer.create len in write_suppression_status ob x; Buffer.contents ob -;; - -let read_suppression_status p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "accepted" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Accepted - | "underReview" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `UnderReview - | "rejected" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Rejected - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "accepted" -> `Accepted - | "underReview" -> `UnderReview - | "rejected" -> `Rejected - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_suppression_status = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "accepted" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Accepted + | "underReview" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `UnderReview + | "rejected" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Rejected + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "accepted" -> + `Accepted + | "underReview" -> + `UnderReview + | "rejected" -> + `Rejected + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let suppression_status_of_string s = read_suppression_status (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__suppression_status_option = - Atdgen_runtime.Oj_run.write_std_option write_suppression_status -;; - +let write__suppression_status_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_suppression_status + ) +) let string_of__suppression_status_option ?(len = 1024) x = let ob = Buffer.create len in write__suppression_status_option ob x; Buffer.contents ob -;; - -let read__suppression_status_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_suppression_status p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_suppression_status p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__suppression_status_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_suppression_status + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_suppression_status + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _suppression_status_option_of_string s = read__suppression_status_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_suppression : _ -> suppression -> _ = +let write_suppression : _ -> suppression -> _ = ( fun ob (x : suppression) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_suppression_guid ob x); - (match x.justification with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"justification\":"; - Yojson.Safe.write_string ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kind\":"; - write_suppression_kind ob x.kind; - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.status with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"status\":"; - write_suppression_status ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_suppression_guid + ) + ob x; + ); + (match x.justification with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"justification\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kind\":"; + ( + write_suppression_kind + ) + ob x.kind; + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.status with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"status\":"; + ( + write_suppression_status + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_suppression ?(len = 1024) x = let ob = Buffer.create len in write_suppression ob x; Buffer.contents ob -;; - -let read_suppression p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_guid = ref None in - let field_justification = ref None in - let field_kind = ref None in - let field_location = ref None in - let field_properties = ref None in - let field_status = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_suppression = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 2 - else -1 - | _ -> -1) - | 6 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 's' - then 5 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 13 -> - if String.unsafe_get s pos = 'j' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_suppression_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_justification := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> field_kind := Some (read_suppression_kind p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_status := Some (read_suppression_status p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_guid = ref (None) in + let field_justification = ref (None) in + let field_kind = ref (None) in + let field_location = ref (None) in + let field_properties = ref (None) in + let field_status = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 2 - else -1 - | _ -> -1) - | 6 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 's' - then 5 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 13 -> - if String.unsafe_get s pos = 'j' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'f' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'j' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_suppression_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_justification := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> field_kind := Some (read_suppression_kind p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_status := Some (read_suppression_status p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ guid = !field_guid - ; justification = !field_justification - ; kind = - (match !field_kind with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "kind") - ; location = !field_location - ; properties = !field_properties - ; status = !field_status - } - : suppression) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_suppression_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_justification := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + field_kind := ( + Some ( + ( + read_suppression_kind + ) p lb + ) + ); + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_status := ( + Some ( + ( + read_suppression_status + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'j' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'f' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_suppression_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_justification := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + field_kind := ( + Some ( + ( + read_suppression_kind + ) p lb + ) + ); + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_status := ( + Some ( + ( + read_suppression_status + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + guid = !field_guid; + justification = !field_justification; + kind = (match !field_kind with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "kind"); + location = !field_location; + properties = !field_properties; + status = !field_status; + } + : suppression) + ) +) let suppression_of_string s = read_suppression (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__suppression_list = Atdgen_runtime.Oj_run.write_list write_suppression - +let write__suppression_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_suppression + ) +) let string_of__suppression_list ?(len = 1024) x = let ob = Buffer.create len in write__suppression_list ob x; Buffer.contents ob -;; - -let read__suppression_list = Atdgen_runtime.Oj_run.read_list read_suppression - +let read__suppression_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_suppression + ) +) let _suppression_list_of_string s = read__suppression_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__suppression_list_option = - Atdgen_runtime.Oj_run.write_std_option write__suppression_list -;; - +let write__suppression_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__suppression_list + ) +) let string_of__suppression_list_option ?(len = 1024) x = let ob = Buffer.create len in write__suppression_list_option ob x; Buffer.contents ob -;; - -let read__suppression_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__suppression_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__suppression_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__suppression_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__suppression_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__suppression_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _suppression_list_option_of_string s = read__suppression_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_thread_flow_location_importance ob x = - match x with - | `Important -> Buffer.add_string ob "\"important\"" - | `Essential -> Buffer.add_string ob "\"essential\"" - | `Unimportant -> Buffer.add_string ob "\"unimportant\"" -;; - +let write_thread_flow_location_importance = ( + fun ob x -> + match x with + | `Important -> Buffer.add_string ob "\"important\"" + | `Essential -> Buffer.add_string ob "\"essential\"" + | `Unimportant -> Buffer.add_string ob "\"unimportant\"" +) let string_of_thread_flow_location_importance ?(len = 1024) x = let ob = Buffer.create len in write_thread_flow_location_importance ob x; Buffer.contents ob -;; - -let read_thread_flow_location_importance p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "important" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Important - | "essential" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Essential - | "unimportant" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Unimportant - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "important" -> `Important - | "essential" -> `Essential - | "unimportant" -> `Unimportant - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_thread_flow_location_importance = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "important" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Important + | "essential" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Essential + | "unimportant" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Unimportant + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "important" -> + `Important + | "essential" -> + `Essential + | "unimportant" -> + `Unimportant + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let thread_flow_location_importance_of_string s = read_thread_flow_location_importance (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__thread_flow_location_importance_option = - Atdgen_runtime.Oj_run.write_std_option write_thread_flow_location_importance -;; - +let write__thread_flow_location_importance_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_thread_flow_location_importance + ) +) let string_of__thread_flow_location_importance_option ?(len = 1024) x = let ob = Buffer.create len in write__thread_flow_location_importance_option ob x; Buffer.contents ob -;; - -let read__thread_flow_location_importance_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_thread_flow_location_importance p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_thread_flow_location_importance p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__thread_flow_location_importance_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_thread_flow_location_importance + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_thread_flow_location_importance + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _thread_flow_location_importance_option_of_string s = - read__thread_flow_location_importance_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_tool_component_contents_item ob x = - match x with - | `LocalizedData -> Buffer.add_string ob "\"localizedData\"" - | `NonLocalizedData -> Buffer.add_string ob "\"nonLocalizedData\"" -;; - + read__thread_flow_location_importance_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_tool_component_contents_item = ( + fun ob x -> + match x with + | `LocalizedData -> Buffer.add_string ob "\"localizedData\"" + | `NonLocalizedData -> Buffer.add_string ob "\"nonLocalizedData\"" +) let string_of_tool_component_contents_item ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_contents_item ob x; Buffer.contents ob -;; - -let read_tool_component_contents_item p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "localizedData" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `LocalizedData - | "nonLocalizedData" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `NonLocalizedData - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "localizedData" -> `LocalizedData - | "nonLocalizedData" -> `NonLocalizedData - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_tool_component_contents_item = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "localizedData" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `LocalizedData + | "nonLocalizedData" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `NonLocalizedData + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "localizedData" -> + `LocalizedData + | "nonLocalizedData" -> + `NonLocalizedData + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let tool_component_contents_item_of_string s = read_tool_component_contents_item (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_contents_item_list = - Atdgen_runtime.Oj_run.write_list write_tool_component_contents_item -;; - +let write__tool_component_contents_item_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_tool_component_contents_item + ) +) let string_of__tool_component_contents_item_list ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_contents_item_list ob x; Buffer.contents ob -;; - -let read__tool_component_contents_item_list = - Atdgen_runtime.Oj_run.read_list read_tool_component_contents_item -;; - +let read__tool_component_contents_item_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_tool_component_contents_item + ) +) let _tool_component_contents_item_list_of_string s = - read__tool_component_contents_item_list - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_0ba29ed = - Atdgen_runtime.Oj_run.write_std_option write__tool_component_contents_item_list -;; - + read__tool_component_contents_item_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_0ba29ed = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__tool_component_contents_item_list + ) +) let string_of__option_0ba29ed ?(len = 1024) x = let ob = Buffer.create len in write__option_0ba29ed ob x; Buffer.contents ob -;; - -let read__option_0ba29ed p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__tool_component_contents_item_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__tool_component_contents_item_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_0ba29ed = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__tool_component_contents_item_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__tool_component_contents_item_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_0ba29ed_of_string s = read__option_0ba29ed (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool_component_dotted_quad_file_version = Yojson.Safe.write_string - +let write_tool_component_dotted_quad_file_version = ( + Yojson.Safe.write_string +) let string_of_tool_component_dotted_quad_file_version ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_dotted_quad_file_version ob x; Buffer.contents ob -;; - -let read_tool_component_dotted_quad_file_version = Atdgen_runtime.Oj_run.read_string - +let read_tool_component_dotted_quad_file_version = ( + Atdgen_runtime.Oj_run.read_string +) let tool_component_dotted_quad_file_version_of_string s = - read_tool_component_dotted_quad_file_version - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_d07cfb1 = - Atdgen_runtime.Oj_run.write_std_option write_tool_component_dotted_quad_file_version -;; - + read_tool_component_dotted_quad_file_version (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_d07cfb1 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component_dotted_quad_file_version + ) +) let string_of__option_d07cfb1 ?(len = 1024) x = let ob = Buffer.create len in write__option_d07cfb1 ob x; Buffer.contents ob -;; - -let read__option_d07cfb1 p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component_dotted_quad_file_version p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component_dotted_quad_file_version p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_d07cfb1 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component_dotted_quad_file_version + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component_dotted_quad_file_version + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_d07cfb1_of_string s = read__option_d07cfb1 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool_component_guid = Yojson.Safe.write_string - +let write_tool_component_guid = ( + Yojson.Safe.write_string +) let string_of_tool_component_guid ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_guid ob x; Buffer.contents ob -;; - -let read_tool_component_guid = Atdgen_runtime.Oj_run.read_string - +let read_tool_component_guid = ( + Atdgen_runtime.Oj_run.read_string +) let tool_component_guid_of_string s = read_tool_component_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_tool_component_guid -;; - +let write__tool_component_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component_guid + ) +) let string_of__tool_component_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_guid_option ob x; Buffer.contents ob -;; - -let read__tool_component_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_guid_option_of_string s = read__tool_component_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool_component_language = Yojson.Safe.write_string - +let write_tool_component_language = ( + Yojson.Safe.write_string +) let string_of_tool_component_language ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_language ob x; Buffer.contents ob -;; - -let read_tool_component_language = Atdgen_runtime.Oj_run.read_string - +let read_tool_component_language = ( + Atdgen_runtime.Oj_run.read_string +) let tool_component_language_of_string s = read_tool_component_language (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_language_option = - Atdgen_runtime.Oj_run.write_std_option write_tool_component_language -;; - +let write__tool_component_language_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component_language + ) +) let string_of__tool_component_language_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_language_option ob x; Buffer.contents ob -;; - -let read__tool_component_language_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component_language p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component_language p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_language_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component_language + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component_language + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_language_option_of_string s = read__tool_component_language_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool_component_reference_guid = Yojson.Safe.write_string - +let write_tool_component_reference_guid = ( + Yojson.Safe.write_string +) let string_of_tool_component_reference_guid ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_reference_guid ob x; Buffer.contents ob -;; - -let read_tool_component_reference_guid = Atdgen_runtime.Oj_run.read_string - +let read_tool_component_reference_guid = ( + Atdgen_runtime.Oj_run.read_string +) let tool_component_reference_guid_of_string s = read_tool_component_reference_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_reference_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_tool_component_reference_guid -;; - +let write__tool_component_reference_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component_reference_guid + ) +) let string_of__tool_component_reference_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_reference_guid_option ob x; Buffer.contents ob -;; - -let read__tool_component_reference_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_reference_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_reference_guid_option_of_string s = - read__tool_component_reference_guid_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_tool_component_reference : _ -> tool_component_reference -> _ = + read__tool_component_reference_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_tool_component_reference : _ -> tool_component_reference -> _ = ( fun ob (x : tool_component_reference) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_tool_component_reference_guid ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_tool_component_reference_guid + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_tool_component_reference ?(len = 1024) x = let ob = Buffer.create len in write_tool_component_reference ob x; Buffer.contents ob -;; - -let read_tool_component_reference p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_guid = ref None in - let field_index = ref (-1L) in - let field_name = ref None in - let field_properties = ref None in - try +let read_tool_component_reference = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 2 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_tool_component_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_guid = ref (None) in + let field_index = ref (-1L) in + let field_name = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 2 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_tool_component_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ guid = !field_guid - ; index = !field_index - ; name = !field_name - ; properties = !field_properties - } - : tool_component_reference) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_tool_component_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_tool_component_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + guid = !field_guid; + index = !field_index; + name = !field_name; + properties = !field_properties; + } + : tool_component_reference) + ) +) let tool_component_reference_of_string s = read_tool_component_reference (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_reference_list = - Atdgen_runtime.Oj_run.write_list write_tool_component_reference -;; - +let write__tool_component_reference_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_tool_component_reference + ) +) let string_of__tool_component_reference_list ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_reference_list ob x; Buffer.contents ob -;; - -let read__tool_component_reference_list = - Atdgen_runtime.Oj_run.read_list read_tool_component_reference -;; - +let read__tool_component_reference_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_tool_component_reference + ) +) let _tool_component_reference_list_of_string s = read__tool_component_reference_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_reference_list_option = - Atdgen_runtime.Oj_run.write_std_option write__tool_component_reference_list -;; - +let write__tool_component_reference_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__tool_component_reference_list + ) +) let string_of__tool_component_reference_list_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_reference_list_option ob x; Buffer.contents ob -;; - -let read__tool_component_reference_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__tool_component_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__tool_component_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_reference_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__tool_component_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__tool_component_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_reference_list_option_of_string s = - read__tool_component_reference_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__tool_component_reference_option = - Atdgen_runtime.Oj_run.write_std_option write_tool_component_reference -;; - + read__tool_component_reference_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__tool_component_reference_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component_reference + ) +) let string_of__tool_component_reference_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_reference_option ob x; Buffer.contents ob -;; - -let read__tool_component_reference_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_reference_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_reference_option_of_string s = read__tool_component_reference_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_reporting_descriptor_reference : _ -> reporting_descriptor_reference -> _ = +let write_reporting_descriptor_reference : _ -> reporting_descriptor_reference -> _ = ( fun ob (x : reporting_descriptor_reference) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_reporting_descriptor_reference_guid ob x); - (match x.id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.tool_component with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"toolComponent\":"; - write_tool_component_reference ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_reporting_descriptor_reference_guid + ) + ob x; + ); + (match x.id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.tool_component with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"toolComponent\":"; + ( + write_tool_component_reference + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_reporting_descriptor_reference ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor_reference ob x; Buffer.contents ob -;; - -let read_reporting_descriptor_reference p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_guid = ref None in - let field_id = ref None in - let field_index = ref (-1L) in - let field_properties = ref None in - let field_tool_component = ref None in - try +let read_reporting_descriptor_reference = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'p' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 't' - then 4 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_reporting_descriptor_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_component := Some (read_tool_component_reference p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_guid = ref (None) in + let field_id = ref (None) in + let field_index = ref (-1L) in + let field_properties = ref (None) in + let field_tool_component = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 13 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'p' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 't' - then 4 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'p' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_reporting_descriptor_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_component := Some (read_tool_component_reference p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ guid = !field_guid - ; id = !field_id - ; index = !field_index - ; properties = !field_properties - ; tool_component = !field_tool_component - } - : reporting_descriptor_reference) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_reporting_descriptor_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_component := ( + Some ( + ( + read_tool_component_reference + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'p' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 't' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_reporting_descriptor_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_component := ( + Some ( + ( + read_tool_component_reference + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + guid = !field_guid; + id = !field_id; + index = !field_index; + properties = !field_properties; + tool_component = !field_tool_component; + } + : reporting_descriptor_reference) + ) +) let reporting_descriptor_reference_of_string s = read_reporting_descriptor_reference (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_descriptor_reference_list = - Atdgen_runtime.Oj_run.write_list write_reporting_descriptor_reference -;; - +let write__reporting_descriptor_reference_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_reporting_descriptor_reference + ) +) let string_of__reporting_descriptor_reference_list ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_reference_list ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_reference_list = - Atdgen_runtime.Oj_run.read_list read_reporting_descriptor_reference -;; - +let read__reporting_descriptor_reference_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_reporting_descriptor_reference + ) +) let _reporting_descriptor_reference_list_of_string s = - read__reporting_descriptor_reference_list - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__reporting_descriptor_reference_list_option = - Atdgen_runtime.Oj_run.write_std_option write__reporting_descriptor_reference_list -;; - + read__reporting_descriptor_reference_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__reporting_descriptor_reference_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__reporting_descriptor_reference_list + ) +) let string_of__reporting_descriptor_reference_list_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_reference_list_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_reference_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__reporting_descriptor_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__reporting_descriptor_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_reference_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__reporting_descriptor_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__reporting_descriptor_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_reference_list_option_of_string s = - read__reporting_descriptor_reference_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__reporting_descriptor_reference_option = - Atdgen_runtime.Oj_run.write_std_option write_reporting_descriptor_reference -;; - + read__reporting_descriptor_reference_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__reporting_descriptor_reference_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_reporting_descriptor_reference + ) +) let string_of__reporting_descriptor_reference_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_reference_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_reference_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_reporting_descriptor_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_reporting_descriptor_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_reference_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_reporting_descriptor_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_reporting_descriptor_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_reference_option_of_string s = - read__reporting_descriptor_reference_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_configuration_override : _ -> configuration_override -> _ = + read__reporting_descriptor_reference_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_configuration_override : _ -> configuration_override -> _ = ( fun ob (x : configuration_override) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"configuration\":"; - write_reporting_configuration ob x.configuration; - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"descriptor\":"; - write_reporting_descriptor_reference ob x.descriptor; - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"configuration\":"; + ( + write_reporting_configuration + ) + ob x.configuration; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"descriptor\":"; + ( + write_reporting_descriptor_reference + ) + ob x.descriptor; + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_configuration_override ?(len = 1024) x = let ob = Buffer.create len in write_configuration_override ob x; Buffer.contents ob -;; - -let read_configuration_override p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_configuration = ref None in - let field_descriptor = ref None in - let field_properties = ref None in - try +let read_configuration_override = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'r' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'f' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_configuration := Some (read_reporting_configuration p lb) - | 1 -> field_descriptor := Some (read_reporting_descriptor_reference p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_configuration = ref (None) in + let field_descriptor = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'r' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'f' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'r' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'f' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_configuration := Some (read_reporting_configuration p lb) - | 1 -> field_descriptor := Some (read_reporting_descriptor_reference p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ configuration = - (match !field_configuration with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "configuration") - ; descriptor = - (match !field_descriptor with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "descriptor") - ; properties = !field_properties - } - : configuration_override) -;; - + ( + match i with + | 0 -> + field_configuration := ( + Some ( + ( + read_reporting_configuration + ) p lb + ) + ); + | 1 -> + field_descriptor := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'r' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'f' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_configuration := ( + Some ( + ( + read_reporting_configuration + ) p lb + ) + ); + | 1 -> + field_descriptor := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + configuration = (match !field_configuration with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "configuration"); + descriptor = (match !field_descriptor with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "descriptor"); + properties = !field_properties; + } + : configuration_override) + ) +) let configuration_override_of_string s = read_configuration_override (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__configuration_override_list = - Atdgen_runtime.Oj_run.write_list write_configuration_override -;; - +let write__configuration_override_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_configuration_override + ) +) let string_of__configuration_override_list ?(len = 1024) x = let ob = Buffer.create len in write__configuration_override_list ob x; Buffer.contents ob -;; - -let read__configuration_override_list = - Atdgen_runtime.Oj_run.read_list read_configuration_override -;; - +let read__configuration_override_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_configuration_override + ) +) let _configuration_override_list_of_string s = read__configuration_override_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__configuration_override_list_option = - Atdgen_runtime.Oj_run.write_std_option write__configuration_override_list -;; - +let write__configuration_override_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__configuration_override_list + ) +) let string_of__configuration_override_list_option ?(len = 1024) x = let ob = Buffer.create len in write__configuration_override_list_option ob x; Buffer.contents ob -;; - -let read__configuration_override_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__configuration_override_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__configuration_override_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__configuration_override_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__configuration_override_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__configuration_override_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _configuration_override_list_option_of_string s = - read__configuration_override_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_reporting_descriptor_relationship : _ -> reporting_descriptor_relationship -> _ = + read__configuration_override_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_reporting_descriptor_relationship : _ -> reporting_descriptor_relationship -> _ = ( fun ob (x : reporting_descriptor_relationship) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.kinds with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kinds\":"; - write__string_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"target\":"; - write_reporting_descriptor_reference ob x.target; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.kinds with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kinds\":"; + ( + write__string_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"target\":"; + ( + write_reporting_descriptor_reference + ) + ob x.target; + Buffer.add_char ob '}'; +) let string_of_reporting_descriptor_relationship ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor_relationship ob x; Buffer.contents ob -;; - -let read_reporting_descriptor_relationship p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_kinds = ref None in - let field_properties = ref None in - let field_target = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_reporting_descriptor_relationship = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 6 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_target := Some (read_reporting_descriptor_reference p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_kinds = ref (None) in + let field_properties = ref (None) in + let field_target = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 6 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_target := Some (read_reporting_descriptor_reference p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; kinds = !field_kinds - ; properties = !field_properties - ; target = - (match !field_target with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "target") - } - : reporting_descriptor_relationship) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_target := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_target := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + kinds = !field_kinds; + properties = !field_properties; + target = (match !field_target with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "target"); + } + : reporting_descriptor_relationship) + ) +) let reporting_descriptor_relationship_of_string s = - read_reporting_descriptor_relationship - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__reporting_descriptor_relationship_list = - Atdgen_runtime.Oj_run.write_list write_reporting_descriptor_relationship -;; - + read_reporting_descriptor_relationship (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__reporting_descriptor_relationship_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_reporting_descriptor_relationship + ) +) let string_of__reporting_descriptor_relationship_list ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_relationship_list ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_relationship_list = - Atdgen_runtime.Oj_run.read_list read_reporting_descriptor_relationship -;; - +let read__reporting_descriptor_relationship_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_reporting_descriptor_relationship + ) +) let _reporting_descriptor_relationship_list_of_string s = - read__reporting_descriptor_relationship_list - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__reporting_descriptor_relationship_list_option = - Atdgen_runtime.Oj_run.write_std_option write__reporting_descriptor_relationship_list -;; - + read__reporting_descriptor_relationship_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__reporting_descriptor_relationship_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__reporting_descriptor_relationship_list + ) +) let string_of__reporting_descriptor_relationship_list_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_relationship_list_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_relationship_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__reporting_descriptor_relationship_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__reporting_descriptor_relationship_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_relationship_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__reporting_descriptor_relationship_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__reporting_descriptor_relationship_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_relationship_list_option_of_string s = - read__reporting_descriptor_relationship_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_reporting_descriptor : _ -> reporting_descriptor -> _ = + read__reporting_descriptor_relationship_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_reporting_descriptor : _ -> reporting_descriptor -> _ = ( fun ob (x : reporting_descriptor) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.default_configuration with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"defaultConfiguration\":"; - write_reporting_configuration ob x); - (match x.deprecated_guids with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"deprecatedGuids\":"; - write__list_2041d89 ob x); - (match x.deprecated_ids with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"deprecatedIds\":"; - write__string_list ob x); - (match x.deprecated_names with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"deprecatedNames\":"; - write__string_list ob x); - (match x.full_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullDescription\":"; - write_multiformat_message_string ob x); - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_reporting_descriptor_guid ob x); - (match x.help with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"help\":"; - write_multiformat_message_string ob x); - (match x.help_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"helpUri\":"; - Yojson.Safe.write_string ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x.id; - (match x.message_strings with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"messageStrings\":"; - write_hm_str_mms ob x); - (match x.name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.relationships with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"relationships\":"; - write__reporting_descriptor_relationship_list ob x); - (match x.short_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"shortDescription\":"; - write_multiformat_message_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.default_configuration with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"defaultConfiguration\":"; + ( + write_reporting_configuration + ) + ob x; + ); + (match x.deprecated_guids with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"deprecatedGuids\":"; + ( + write__list_2041d89 + ) + ob x; + ); + (match x.deprecated_ids with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"deprecatedIds\":"; + ( + write__string_list + ) + ob x; + ); + (match x.deprecated_names with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"deprecatedNames\":"; + ( + write__string_list + ) + ob x; + ); + (match x.full_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_reporting_descriptor_guid + ) + ob x; + ); + (match x.help with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"help\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.help_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"helpUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x.id; + (match x.message_strings with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"messageStrings\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.relationships with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"relationships\":"; + ( + write__reporting_descriptor_relationship_list + ) + ob x; + ); + (match x.short_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"shortDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_reporting_descriptor ?(len = 1024) x = let ob = Buffer.create len in write_reporting_descriptor ob x; Buffer.contents ob -;; - -let read_reporting_descriptor p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_default_configuration = ref None in - let field_deprecated_guids = ref None in - let field_deprecated_ids = ref None in - let field_deprecated_names = ref None in - let field_full_description = ref None in - let field_guid = ref None in - let field_help = ref None in - let field_help_uri = ref None in - let field_id = ref None in - let field_message_strings = ref None in - let field_name = ref None in - let field_properties = ref None in - let field_relationships = ref None in - let field_short_description = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_reporting_descriptor = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 8 - else -1 - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 5 - else -1 - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'p' - then 6 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 10 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'h' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'U' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'i' - then 7 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 11 - else -1 - | 13 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 's' - then 12 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 's' - then 9 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - then ( - match String.unsafe_get s (pos + 10) with - | 'G' -> - if String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 's' - then 1 - else -1 - | 'N' -> - if String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 4 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 13 - else -1 - | 20 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'C' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'u' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 't' - && String.unsafe_get s (pos + 17) = 'i' - && String.unsafe_get s (pos + 18) = 'o' - && String.unsafe_get s (pos + 19) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_default_configuration := Some (read_reporting_configuration p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_guids := Some (read__list_2041d89 p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_ids := Some (read__string_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_names := Some (read__string_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_reporting_descriptor_guid p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_help := Some (read_multiformat_message_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_help_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message_strings := Some (read_hm_str_mms p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_relationships := Some (read__reporting_descriptor_relationship_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_default_configuration = ref (None) in + let field_deprecated_guids = ref (None) in + let field_deprecated_ids = ref (None) in + let field_deprecated_names = ref (None) in + let field_full_description = ref (None) in + let field_guid = ref (None) in + let field_help = ref (None) in + let field_help_uri = ref (None) in + let field_id = ref (None) in + let field_message_strings = ref (None) in + let field_name = ref (None) in + let field_properties = ref (None) in + let field_relationships = ref (None) in + let field_short_description = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 8 - else -1 - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 5 - else -1 - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'p' - then 6 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 10 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'h' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'U' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'i' - then 7 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 11 - else -1 - | 13 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'I' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 's' - then 2 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'h' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 's' - then 12 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 's' - then 9 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - then ( - match String.unsafe_get s (pos + 10) with - | 'G' -> - if String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'd' - && String.unsafe_get s (pos + 14) = 's' - then 1 - else -1 - | 'N' -> - if String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - then 3 - else -1 - | _ -> -1) - else -1 - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 4 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 13 - else -1 - | 20 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'C' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'f' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'u' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 't' - && String.unsafe_get s (pos + 17) = 'i' - && String.unsafe_get s (pos + 18) = 'o' - && String.unsafe_get s (pos + 19) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 8 + ) + else ( + -1 + ) + ) + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 5 + ) + else ( + -1 + ) + ) + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'p' then ( + 6 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'U' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' then ( + 7 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 13 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' then ( + match String.unsafe_get s (pos+10) with + | 'G' -> ( + if String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'N' -> ( + if String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 13 + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'C' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'u' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 't' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'o' && String.unsafe_get s (pos+19) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_default_configuration := Some (read_reporting_configuration p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_guids := Some (read__list_2041d89 p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_ids := Some (read__string_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_deprecated_names := Some (read__string_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_reporting_descriptor_guid p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_help := Some (read_multiformat_message_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_help_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message_strings := Some (read_hm_str_mms p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_relationships := Some (read__reporting_descriptor_relationship_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ default_configuration = !field_default_configuration - ; deprecated_guids = !field_deprecated_guids - ; deprecated_ids = !field_deprecated_ids - ; deprecated_names = !field_deprecated_names - ; full_description = !field_full_description - ; guid = !field_guid - ; help = !field_help - ; help_uri = !field_help_uri - ; id = - (match !field_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "id") - ; message_strings = !field_message_strings - ; name = !field_name - ; properties = !field_properties - ; relationships = !field_relationships - ; short_description = !field_short_description - } - : reporting_descriptor) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_configuration := ( + Some ( + ( + read_reporting_configuration + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_guids := ( + Some ( + ( + read__list_2041d89 + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_ids := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_names := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_reporting_descriptor_guid + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_help := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_help_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message_strings := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relationships := ( + Some ( + ( + read__reporting_descriptor_relationship_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 8 + ) + else ( + -1 + ) + ) + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 5 + ) + else ( + -1 + ) + ) + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'p' then ( + 6 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'h' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'U' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'i' then ( + 7 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 13 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'I' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'h' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' then ( + match String.unsafe_get s (pos+10) with + | 'G' -> ( + if String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'd' && String.unsafe_get s (pos+14) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'N' -> ( + if String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 13 + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'C' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'f' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'u' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 't' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'o' && String.unsafe_get s (pos+19) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_configuration := ( + Some ( + ( + read_reporting_configuration + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_guids := ( + Some ( + ( + read__list_2041d89 + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_ids := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_deprecated_names := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_reporting_descriptor_guid + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_help := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_help_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message_strings := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_relationships := ( + Some ( + ( + read__reporting_descriptor_relationship_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + default_configuration = !field_default_configuration; + deprecated_guids = !field_deprecated_guids; + deprecated_ids = !field_deprecated_ids; + deprecated_names = !field_deprecated_names; + full_description = !field_full_description; + guid = !field_guid; + help = !field_help; + help_uri = !field_help_uri; + id = (match !field_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "id"); + message_strings = !field_message_strings; + name = !field_name; + properties = !field_properties; + relationships = !field_relationships; + short_description = !field_short_description; + } + : reporting_descriptor) + ) +) let reporting_descriptor_of_string s = read_reporting_descriptor (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_descriptor_list = - Atdgen_runtime.Oj_run.write_list write_reporting_descriptor -;; - +let write__reporting_descriptor_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_reporting_descriptor + ) +) let string_of__reporting_descriptor_list ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_list ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_list = - Atdgen_runtime.Oj_run.read_list read_reporting_descriptor -;; - +let read__reporting_descriptor_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_reporting_descriptor + ) +) let _reporting_descriptor_list_of_string s = read__reporting_descriptor_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__reporting_descriptor_list_option = - Atdgen_runtime.Oj_run.write_std_option write__reporting_descriptor_list -;; - +let write__reporting_descriptor_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__reporting_descriptor_list + ) +) let string_of__reporting_descriptor_list_option ?(len = 1024) x = let ob = Buffer.create len in write__reporting_descriptor_list_option ob x; Buffer.contents ob -;; - -let read__reporting_descriptor_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__reporting_descriptor_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__reporting_descriptor_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__reporting_descriptor_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__reporting_descriptor_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__reporting_descriptor_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _reporting_descriptor_list_option_of_string s = - read__reporting_descriptor_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_translation_metadata : _ -> translation_metadata -> _ = + read__reporting_descriptor_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_translation_metadata : _ -> translation_metadata -> _ = ( fun ob (x : translation_metadata) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.download_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"downloadUri\":"; - Yojson.Safe.write_string ob x); - (match x.full_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullDescription\":"; - write_multiformat_message_string ob x); - (match x.full_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullName\":"; - Yojson.Safe.write_string ob x); - (match x.information_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"informationUri\":"; - Yojson.Safe.write_string ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x.name; - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.short_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"shortDescription\":"; - write_multiformat_message_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.download_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"downloadUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.full_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.full_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.information_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"informationUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x.name; + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.short_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"shortDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_translation_metadata ?(len = 1024) x = let ob = Buffer.create len in write_translation_metadata ob x; Buffer.contents ob -;; - -let read_translation_metadata p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_download_uri = ref None in - let field_full_description = ref None in - let field_full_name = ref None in - let field_information_uri = ref None in - let field_name = ref None in - let field_properties = ref None in - let field_short_description = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_translation_metadata = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 4 - else -1 - | 8 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'N' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - then 0 - else -1 - | 14 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - then 3 - else -1 - | 15 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 1 - else -1 - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 6 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_download_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_information_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_download_uri = ref (None) in + let field_full_description = ref (None) in + let field_full_name = ref (None) in + let field_information_uri = ref (None) in + let field_name = ref (None) in + let field_properties = ref (None) in + let field_short_description = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 4 - else -1 - | 8 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'N' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - then 0 - else -1 - | 14 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - then 3 - else -1 - | 15 -> - if String.unsafe_get s pos = 'f' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 1 - else -1 - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 6 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'N' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' then ( + 0 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_download_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_information_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ download_uri = !field_download_uri - ; full_description = !field_full_description - ; full_name = !field_full_name - ; information_uri = !field_information_uri - ; name = - (match !field_name with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "name") - ; properties = !field_properties - ; short_description = !field_short_description - } - : translation_metadata) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_download_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_information_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'N' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' then ( + 0 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_download_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_information_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + download_uri = !field_download_uri; + full_description = !field_full_description; + full_name = !field_full_name; + information_uri = !field_information_uri; + name = (match !field_name with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "name"); + properties = !field_properties; + short_description = !field_short_description; + } + : translation_metadata) + ) +) let translation_metadata_of_string s = read_translation_metadata (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__translation_metadata_option = - Atdgen_runtime.Oj_run.write_std_option write_translation_metadata -;; - +let write__translation_metadata_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_translation_metadata + ) +) let string_of__translation_metadata_option ?(len = 1024) x = let ob = Buffer.create len in write__translation_metadata_option ob x; Buffer.contents ob -;; - -let read__translation_metadata_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_translation_metadata p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_translation_metadata p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__translation_metadata_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_translation_metadata + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_translation_metadata + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _translation_metadata_option_of_string s = read__translation_metadata_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool_component : _ -> tool_component -> _ = +let write_tool_component : _ -> tool_component -> _ = ( fun ob (x : tool_component) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.associated_component with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"associatedComponent\":"; - write_tool_component_reference ob x); - (match x.contents with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"contents\":"; - write__tool_component_contents_item_list ob x); - (match x.dotted_quad_file_version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"dottedQuadFileVersion\":"; - write_tool_component_dotted_quad_file_version ob x); - (match x.download_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"downloadUri\":"; - Yojson.Safe.write_string ob x); - (match x.full_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullDescription\":"; - write_multiformat_message_string ob x); - (match x.full_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fullName\":"; - Yojson.Safe.write_string ob x); - (match x.global_message_strings with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"globalMessageStrings\":"; - write_hm_str_mms ob x); - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_tool_component_guid ob x); - (match x.information_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"informationUri\":"; - Yojson.Safe.write_string ob x); - if x.is_comprehensive <> false - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"isComprehensive\":"; - Yojson.Safe.write_bool ob x.is_comprehensive); - (match x.language with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"language\":"; - write_tool_component_language ob x); - (match x.localized_data_semantic_version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"localizedDataSemanticVersion\":"; - Yojson.Safe.write_string ob x); - (match x.locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"locations\":"; - write__artifact_location_list ob x); - (match x.minimum_required_localized_data_semantic_version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"minimumRequiredLocalizedDataSemanticVersion\":"; - Yojson.Safe.write_string ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"name\":"; - Yojson.Safe.write_string ob x.name; - (match x.notifications with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"notifications\":"; - write__reporting_descriptor_list ob x); - (match x.organization with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"organization\":"; - Yojson.Safe.write_string ob x); - (match x.product with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"product\":"; - Yojson.Safe.write_string ob x); - (match x.product_suite with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"productSuite\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.release_date_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"releaseDateUtc\":"; - Yojson.Safe.write_string ob x); - (match x.rules with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rules\":"; - write__reporting_descriptor_list ob x); - (match x.semantic_version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"semanticVersion\":"; - Yojson.Safe.write_string ob x); - (match x.short_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"shortDescription\":"; - write_multiformat_message_string ob x); - (match x.supported_taxonomies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"supportedTaxonomies\":"; - write__tool_component_reference_list ob x); - (match x.taxa with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxa\":"; - write__reporting_descriptor_list ob x); - (match x.translation_metadata with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"translationMetadata\":"; - write_translation_metadata ob x); - (match x.version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"version\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.associated_component with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"associatedComponent\":"; + ( + write_tool_component_reference + ) + ob x; + ); + (match x.contents with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"contents\":"; + ( + write__tool_component_contents_item_list + ) + ob x; + ); + (match x.dotted_quad_file_version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"dottedQuadFileVersion\":"; + ( + write_tool_component_dotted_quad_file_version + ) + ob x; + ); + (match x.download_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"downloadUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.full_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.full_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fullName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.global_message_strings with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"globalMessageStrings\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_tool_component_guid + ) + ob x; + ); + (match x.information_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"informationUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.is_comprehensive <> false then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"isComprehensive\":"; + ( + Yojson.Safe.write_bool + ) + ob x.is_comprehensive; + ); + (match x.language with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"language\":"; + ( + write_tool_component_language + ) + ob x; + ); + (match x.localized_data_semantic_version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"localizedDataSemanticVersion\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"locations\":"; + ( + write__artifact_location_list + ) + ob x; + ); + (match x.minimum_required_localized_data_semantic_version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"minimumRequiredLocalizedDataSemanticVersion\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"name\":"; + ( + Yojson.Safe.write_string + ) + ob x.name; + (match x.notifications with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"notifications\":"; + ( + write__reporting_descriptor_list + ) + ob x; + ); + (match x.organization with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"organization\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.product with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"product\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.product_suite with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"productSuite\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.release_date_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"releaseDateUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.rules with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rules\":"; + ( + write__reporting_descriptor_list + ) + ob x; + ); + (match x.semantic_version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"semanticVersion\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.short_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"shortDescription\":"; + ( + write_multiformat_message_string + ) + ob x; + ); + (match x.supported_taxonomies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"supportedTaxonomies\":"; + ( + write__tool_component_reference_list + ) + ob x; + ); + (match x.taxa with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxa\":"; + ( + write__reporting_descriptor_list + ) + ob x; + ); + (match x.translation_metadata with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"translationMetadata\":"; + ( + write_translation_metadata + ) + ob x; + ); + (match x.version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"version\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_tool_component ?(len = 1024) x = let ob = Buffer.create len in write_tool_component ob x; Buffer.contents ob -;; - -let read_tool_component p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_associated_component = ref None in - let field_contents = ref None in - let field_dotted_quad_file_version = ref None in - let field_download_uri = ref None in - let field_full_description = ref None in - let field_full_name = ref None in - let field_global_message_strings = ref None in - let field_guid = ref None in - let field_information_uri = ref None in - let field_is_comprehensive = ref false in - let field_language = ref None in - let field_localized_data_semantic_version = ref None in - let field_locations = ref None in - let field_minimum_required_localized_data_semantic_version = ref None in - let field_name = ref None in - let field_notifications = ref None in - let field_organization = ref None in - let field_product = ref None in - let field_product_suite = ref None in - let field_properties = ref None in - let field_release_date_utc = ref None in - let field_rules = ref None in - let field_semantic_version = ref None in - let field_short_description = ref None in - let field_supported_taxonomies = ref None in - let field_taxa = ref None in - let field_translation_metadata = ref None in - let field_version = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_tool_component = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 7 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 14 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 25 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 21 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 't' - then 17 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 27 - else -1 - | _ -> -1) - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 's' - then 1 - else -1 - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'N' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - then 5 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'e' - then 10 - else -1 - | _ -> -1) - | 9 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 12 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 19 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - then 3 - else -1 - | 12 -> - (match String.unsafe_get s pos with - | 'o' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'z' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - then 16 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 18 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 's' - then 15 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - then 8 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'D' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'c' - then 20 - else -1 - | _ -> -1) - | 15 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 4 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'C' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'p' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'h' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'v' - && String.unsafe_get s (pos + 14) = 'e' - then 9 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'V' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 22 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 23 - else -1 - | 19 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'C' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'p' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 't' - then 0 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'x' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'e' - && String.unsafe_get s (pos + 18) = 's' - then 24 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'M' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'a' - && String.unsafe_get s (pos + 15) = 'd' - && String.unsafe_get s (pos + 16) = 'a' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 'a' - then 26 - else -1 - | _ -> -1) - | 20 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'l' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'b' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'M' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'g' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'S' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 'g' - && String.unsafe_get s (pos + 19) = 's' - then 6 - else -1 - | 21 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'Q' - && String.unsafe_get s (pos + 7) = 'u' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'F' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'V' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 'r' - && String.unsafe_get s (pos + 17) = 's' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'o' - && String.unsafe_get s (pos + 20) = 'n' - then 2 - else -1 - | 28 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'z' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'D' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'S' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'a' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'c' - && String.unsafe_get s (pos + 21) = 'V' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 'r' - && String.unsafe_get s (pos + 24) = 's' - && String.unsafe_get s (pos + 25) = 'i' - && String.unsafe_get s (pos + 26) = 'o' - && String.unsafe_get s (pos + 27) = 'n' - then 11 - else -1 - | 43 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'u' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'q' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'd' - && String.unsafe_get s (pos + 15) = 'L' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'c' - && String.unsafe_get s (pos + 18) = 'a' - && String.unsafe_get s (pos + 19) = 'l' - && String.unsafe_get s (pos + 20) = 'i' - && String.unsafe_get s (pos + 21) = 'z' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 'd' - && String.unsafe_get s (pos + 24) = 'D' - && String.unsafe_get s (pos + 25) = 'a' - && String.unsafe_get s (pos + 26) = 't' - && String.unsafe_get s (pos + 27) = 'a' - && String.unsafe_get s (pos + 28) = 'S' - && String.unsafe_get s (pos + 29) = 'e' - && String.unsafe_get s (pos + 30) = 'm' - && String.unsafe_get s (pos + 31) = 'a' - && String.unsafe_get s (pos + 32) = 'n' - && String.unsafe_get s (pos + 33) = 't' - && String.unsafe_get s (pos + 34) = 'i' - && String.unsafe_get s (pos + 35) = 'c' - && String.unsafe_get s (pos + 36) = 'V' - && String.unsafe_get s (pos + 37) = 'e' - && String.unsafe_get s (pos + 38) = 'r' - && String.unsafe_get s (pos + 39) = 's' - && String.unsafe_get s (pos + 40) = 'i' - && String.unsafe_get s (pos + 41) = 'o' - && String.unsafe_get s (pos + 42) = 'n' - then 13 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_associated_component := Some (read_tool_component_reference p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_contents := Some (read__tool_component_contents_item_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_dotted_quad_file_version - := Some (read_tool_component_dotted_quad_file_version p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_download_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_global_message_strings := Some (read_hm_str_mms p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_tool_component_guid p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_information_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_is_comprehensive := Atdgen_runtime.Oj_run.read_bool p lb - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_language := Some (read_tool_component_language p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_localized_data_semantic_version - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__artifact_location_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_minimum_required_localized_data_semantic_version - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 14 -> field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_notifications := Some (read__reporting_descriptor_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_organization := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_product := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_product_suite := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_release_date_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rules := Some (read__reporting_descriptor_list p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_semantic_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_supported_taxonomies := Some (read__tool_component_reference_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translation_metadata := Some (read_translation_metadata p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_associated_component = ref (None) in + let field_contents = ref (None) in + let field_dotted_quad_file_version = ref (None) in + let field_download_uri = ref (None) in + let field_full_description = ref (None) in + let field_full_name = ref (None) in + let field_global_message_strings = ref (None) in + let field_guid = ref (None) in + let field_information_uri = ref (None) in + let field_is_comprehensive = ref (false) in + let field_language = ref (None) in + let field_localized_data_semantic_version = ref (None) in + let field_locations = ref (None) in + let field_minimum_required_localized_data_semantic_version = ref (None) in + let field_name = ref (None) in + let field_notifications = ref (None) in + let field_organization = ref (None) in + let field_product = ref (None) in + let field_product_suite = ref (None) in + let field_properties = ref (None) in + let field_release_date_utc = ref (None) in + let field_rules = ref (None) in + let field_semantic_version = ref (None) in + let field_short_description = ref (None) in + let field_supported_taxonomies = ref (None) in + let field_taxa = ref (None) in + let field_translation_metadata = ref (None) in + let field_version = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 7 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - then 14 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 25 - else -1 - | _ -> -1) - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 21 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 't' - then 17 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 27 - else -1 - | _ -> -1) - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 's' - then 1 - else -1 - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'N' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - then 5 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'e' - then 10 - else -1 - | _ -> -1) - | 9 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 12 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 19 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'd' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - then 3 - else -1 - | 12 -> - (match String.unsafe_get s pos with - | 'o' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'z' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - then 16 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 18 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 's' - then 15 - else -1 - | 14 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - then 8 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'D' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'U' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'c' - then 20 - else -1 - | _ -> -1) - | 15 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'D' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'p' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 4 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'C' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'p' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'h' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'v' - && String.unsafe_get s (pos + 14) = 'e' - then 9 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'V' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - then 22 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'D' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - then 23 - else -1 - | 19 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'C' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'p' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 't' - then 0 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'x' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'e' - && String.unsafe_get s (pos + 18) = 's' - then 24 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'M' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'a' - && String.unsafe_get s (pos + 15) = 'd' - && String.unsafe_get s (pos + 16) = 'a' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 'a' - then 26 - else -1 - | _ -> -1) - | 20 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'l' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'b' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'M' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 'g' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'S' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 'g' - && String.unsafe_get s (pos + 19) = 's' - then 6 - else -1 - | 21 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'Q' - && String.unsafe_get s (pos + 7) = 'u' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'F' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'V' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 'r' - && String.unsafe_get s (pos + 17) = 's' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'o' - && String.unsafe_get s (pos + 20) = 'n' - then 2 - else -1 - | 28 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'z' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'D' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'S' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'm' - && String.unsafe_get s (pos + 16) = 'a' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'c' - && String.unsafe_get s (pos + 21) = 'V' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 'r' - && String.unsafe_get s (pos + 24) = 's' - && String.unsafe_get s (pos + 25) = 'i' - && String.unsafe_get s (pos + 26) = 'o' - && String.unsafe_get s (pos + 27) = 'n' - then 11 - else -1 - | 43 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'u' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'R' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'q' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'd' - && String.unsafe_get s (pos + 15) = 'L' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'c' - && String.unsafe_get s (pos + 18) = 'a' - && String.unsafe_get s (pos + 19) = 'l' - && String.unsafe_get s (pos + 20) = 'i' - && String.unsafe_get s (pos + 21) = 'z' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 'd' - && String.unsafe_get s (pos + 24) = 'D' - && String.unsafe_get s (pos + 25) = 'a' - && String.unsafe_get s (pos + 26) = 't' - && String.unsafe_get s (pos + 27) = 'a' - && String.unsafe_get s (pos + 28) = 'S' - && String.unsafe_get s (pos + 29) = 'e' - && String.unsafe_get s (pos + 30) = 'm' - && String.unsafe_get s (pos + 31) = 'a' - && String.unsafe_get s (pos + 32) = 'n' - && String.unsafe_get s (pos + 33) = 't' - && String.unsafe_get s (pos + 34) = 'i' - && String.unsafe_get s (pos + 35) = 'c' - && String.unsafe_get s (pos + 36) = 'V' - && String.unsafe_get s (pos + 37) = 'e' - && String.unsafe_get s (pos + 38) = 'r' - && String.unsafe_get s (pos + 39) = 's' - && String.unsafe_get s (pos + 40) = 'i' - && String.unsafe_get s (pos + 41) = 'o' - && String.unsafe_get s (pos + 42) = 'n' - then 13 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 14 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 25 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 21 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' then ( + 17 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'N' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'z' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' then ( + 16 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' then ( + 8 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'D' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'c' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'C' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'p' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'h' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'v' && String.unsafe_get s (pos+14) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'V' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 22 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 23 + ) + else ( + -1 + ) + ) + | 19 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'C' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'p' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'x' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'e' && String.unsafe_get s (pos+18) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'M' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'd' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'a' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'M' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'S' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 'g' && String.unsafe_get s (pos+19) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'Q' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'F' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'V' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 'r' && String.unsafe_get s (pos+17) = 's' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 28 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'z' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'D' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'S' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 'V' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 's' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'o' && String.unsafe_get s (pos+27) = 'n' then ( + 11 + ) + else ( + -1 + ) + ) + | 43 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'q' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = 'L' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'c' && String.unsafe_get s (pos+18) = 'a' && String.unsafe_get s (pos+19) = 'l' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'z' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'd' && String.unsafe_get s (pos+24) = 'D' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 't' && String.unsafe_get s (pos+27) = 'a' && String.unsafe_get s (pos+28) = 'S' && String.unsafe_get s (pos+29) = 'e' && String.unsafe_get s (pos+30) = 'm' && String.unsafe_get s (pos+31) = 'a' && String.unsafe_get s (pos+32) = 'n' && String.unsafe_get s (pos+33) = 't' && String.unsafe_get s (pos+34) = 'i' && String.unsafe_get s (pos+35) = 'c' && String.unsafe_get s (pos+36) = 'V' && String.unsafe_get s (pos+37) = 'e' && String.unsafe_get s (pos+38) = 'r' && String.unsafe_get s (pos+39) = 's' && String.unsafe_get s (pos+40) = 'i' && String.unsafe_get s (pos+41) = 'o' && String.unsafe_get s (pos+42) = 'n' then ( + 13 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_associated_component := Some (read_tool_component_reference p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_contents := Some (read__tool_component_contents_item_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_dotted_quad_file_version - := Some (read_tool_component_dotted_quad_file_version p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_download_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_description := Some (read_multiformat_message_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_full_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_global_message_strings := Some (read_hm_str_mms p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_tool_component_guid p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_information_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_is_comprehensive := Atdgen_runtime.Oj_run.read_bool p lb - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_language := Some (read_tool_component_language p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_localized_data_semantic_version - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__artifact_location_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_minimum_required_localized_data_semantic_version - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 14 -> field_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_notifications := Some (read__reporting_descriptor_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_organization := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_product := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_product_suite := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_release_date_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rules := Some (read__reporting_descriptor_list p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_semantic_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_short_description := Some (read_multiformat_message_string p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_supported_taxonomies := Some (read__tool_component_reference_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translation_metadata := Some (read_translation_metadata p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ associated_component = !field_associated_component - ; contents = !field_contents - ; dotted_quad_file_version = !field_dotted_quad_file_version - ; download_uri = !field_download_uri - ; full_description = !field_full_description - ; full_name = !field_full_name - ; global_message_strings = !field_global_message_strings - ; guid = !field_guid - ; information_uri = !field_information_uri - ; is_comprehensive = !field_is_comprehensive - ; language = !field_language - ; localized_data_semantic_version = !field_localized_data_semantic_version - ; locations = !field_locations - ; minimum_required_localized_data_semantic_version = - !field_minimum_required_localized_data_semantic_version - ; name = - (match !field_name with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "name") - ; notifications = !field_notifications - ; organization = !field_organization - ; product = !field_product - ; product_suite = !field_product_suite - ; properties = !field_properties - ; release_date_utc = !field_release_date_utc - ; rules = !field_rules - ; semantic_version = !field_semantic_version - ; short_description = !field_short_description - ; supported_taxonomies = !field_supported_taxonomies - ; taxa = !field_taxa - ; translation_metadata = !field_translation_metadata - ; version = !field_version - } - : tool_component) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_associated_component := ( + Some ( + ( + read_tool_component_reference + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_contents := ( + Some ( + ( + read__tool_component_contents_item_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_dotted_quad_file_version := ( + Some ( + ( + read_tool_component_dotted_quad_file_version + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_download_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_global_message_strings := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_tool_component_guid + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_information_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_is_comprehensive := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_language := ( + Some ( + ( + read_tool_component_language + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_localized_data_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_minimum_required_localized_data_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 14 -> + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_notifications := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_organization := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_product := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_product_suite := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_release_date_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rules := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_supported_taxonomies := ( + Some ( + ( + read__tool_component_reference_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translation_metadata := ( + Some ( + ( + read_translation_metadata + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' then ( + 14 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 25 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 21 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' then ( + 17 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'N' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'd' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' then ( + 3 + ) + else ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'z' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' then ( + 16 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | 14 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' then ( + 8 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'D' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'U' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'c' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'D' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'p' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 4 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'C' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'p' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'h' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'v' && String.unsafe_get s (pos+14) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'V' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' then ( + 22 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'D' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' then ( + 23 + ) + else ( + -1 + ) + ) + | 19 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'C' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'p' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'x' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'e' && String.unsafe_get s (pos+18) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'M' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'd' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'a' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'l' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'M' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'S' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 'g' && String.unsafe_get s (pos+19) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'Q' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'F' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'V' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 'r' && String.unsafe_get s (pos+17) = 's' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'o' && String.unsafe_get s (pos+20) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 28 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'z' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'D' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'S' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'm' && String.unsafe_get s (pos+16) = 'a' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'c' && String.unsafe_get s (pos+21) = 'V' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'r' && String.unsafe_get s (pos+24) = 's' && String.unsafe_get s (pos+25) = 'i' && String.unsafe_get s (pos+26) = 'o' && String.unsafe_get s (pos+27) = 'n' then ( + 11 + ) + else ( + -1 + ) + ) + | 43 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'R' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'q' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'd' && String.unsafe_get s (pos+15) = 'L' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'c' && String.unsafe_get s (pos+18) = 'a' && String.unsafe_get s (pos+19) = 'l' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'z' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 'd' && String.unsafe_get s (pos+24) = 'D' && String.unsafe_get s (pos+25) = 'a' && String.unsafe_get s (pos+26) = 't' && String.unsafe_get s (pos+27) = 'a' && String.unsafe_get s (pos+28) = 'S' && String.unsafe_get s (pos+29) = 'e' && String.unsafe_get s (pos+30) = 'm' && String.unsafe_get s (pos+31) = 'a' && String.unsafe_get s (pos+32) = 'n' && String.unsafe_get s (pos+33) = 't' && String.unsafe_get s (pos+34) = 'i' && String.unsafe_get s (pos+35) = 'c' && String.unsafe_get s (pos+36) = 'V' && String.unsafe_get s (pos+37) = 'e' && String.unsafe_get s (pos+38) = 'r' && String.unsafe_get s (pos+39) = 's' && String.unsafe_get s (pos+40) = 'i' && String.unsafe_get s (pos+41) = 'o' && String.unsafe_get s (pos+42) = 'n' then ( + 13 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_associated_component := ( + Some ( + ( + read_tool_component_reference + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_contents := ( + Some ( + ( + read__tool_component_contents_item_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_dotted_quad_file_version := ( + Some ( + ( + read_tool_component_dotted_quad_file_version + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_download_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_full_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_global_message_strings := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_tool_component_guid + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_information_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_is_comprehensive := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_language := ( + Some ( + ( + read_tool_component_language + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_localized_data_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_minimum_required_localized_data_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 14 -> + field_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_notifications := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_organization := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_product := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_product_suite := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_release_date_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rules := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_semantic_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_short_description := ( + Some ( + ( + read_multiformat_message_string + ) p lb + ) + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_supported_taxonomies := ( + Some ( + ( + read__tool_component_reference_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translation_metadata := ( + Some ( + ( + read_translation_metadata + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + associated_component = !field_associated_component; + contents = !field_contents; + dotted_quad_file_version = !field_dotted_quad_file_version; + download_uri = !field_download_uri; + full_description = !field_full_description; + full_name = !field_full_name; + global_message_strings = !field_global_message_strings; + guid = !field_guid; + information_uri = !field_information_uri; + is_comprehensive = !field_is_comprehensive; + language = !field_language; + localized_data_semantic_version = !field_localized_data_semantic_version; + locations = !field_locations; + minimum_required_localized_data_semantic_version = !field_minimum_required_localized_data_semantic_version; + name = (match !field_name with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "name"); + notifications = !field_notifications; + organization = !field_organization; + product = !field_product; + product_suite = !field_product_suite; + properties = !field_properties; + release_date_utc = !field_release_date_utc; + rules = !field_rules; + semantic_version = !field_semantic_version; + short_description = !field_short_description; + supported_taxonomies = !field_supported_taxonomies; + taxa = !field_taxa; + translation_metadata = !field_translation_metadata; + version = !field_version; + } + : tool_component) + ) +) let tool_component_of_string s = read_tool_component (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_list = Atdgen_runtime.Oj_run.write_list write_tool_component - +let write__tool_component_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_tool_component + ) +) let string_of__tool_component_list ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_list ob x; Buffer.contents ob -;; - -let read__tool_component_list = Atdgen_runtime.Oj_run.read_list read_tool_component - +let read__tool_component_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_tool_component + ) +) let _tool_component_list_of_string s = read__tool_component_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_list_option = - Atdgen_runtime.Oj_run.write_std_option write__tool_component_list -;; - +let write__tool_component_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__tool_component_list + ) +) let string_of__tool_component_list_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_list_option ob x; Buffer.contents ob -;; - -let read__tool_component_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__tool_component_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__tool_component_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__tool_component_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__tool_component_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_list_option_of_string s = read__tool_component_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__tool_component_option = - Atdgen_runtime.Oj_run.write_std_option write_tool_component -;; - +let write__tool_component_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_tool_component + ) +) let string_of__tool_component_option ?(len = 1024) x = let ob = Buffer.create len in write__tool_component_option ob x; Buffer.contents ob -;; - -let read__tool_component_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_tool_component p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_tool_component p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__tool_component_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_tool_component + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_tool_component + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _tool_component_option_of_string s = read__tool_component_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_tool : _ -> tool -> _ = +let write_tool : _ -> tool -> _ = ( fun ob (x : tool) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"driver\":"; - write_tool_component ob x.driver; - (match x.extensions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"extensions\":"; - write__tool_component_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"driver\":"; + ( + write_tool_component + ) + ob x.driver; + (match x.extensions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"extensions\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_tool ?(len = 1024) x = let ob = Buffer.create len in write_tool ob x; Buffer.contents ob -;; - -let read_tool p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_driver = ref None in - let field_extensions = ref None in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_tool = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 0 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_driver := Some (read_tool_component p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__tool_component_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_driver = ref (None) in + let field_extensions = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 0 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_driver := Some (read_tool_component p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__tool_component_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ driver = - (match !field_driver with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "driver") - ; extensions = !field_extensions - ; properties = !field_properties - } - : tool) -;; - -let tool_of_string s = read_tool (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -let write_web_request : _ -> web_request -> _ = + ( + match i with + | 0 -> + field_driver := ( + Some ( + ( + read_tool_component + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_driver := ( + Some ( + ( + read_tool_component + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + driver = (match !field_driver with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "driver"); + extensions = !field_extensions; + properties = !field_properties; + } + : tool) + ) +) +let tool_of_string s = + read_tool (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_web_request : _ -> web_request -> _ = ( fun ob (x : web_request) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.body with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"body\":"; - write_artifact_content ob x); - (match x.headers with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"headers\":"; - write_hm_str_str ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.method_ with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"method\":"; - Yojson.Safe.write_string ob x); - (match x.parameters with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parameters\":"; - write_hm_str_str ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.protocol with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"protocol\":"; - Yojson.Safe.write_string ob x); - (match x.target with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"target\":"; - Yojson.Safe.write_string ob x); - (match x.version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"version\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.body with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"body\":"; + ( + write_artifact_content + ) + ob x; + ); + (match x.headers with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"headers\":"; + ( + write_hm_str_str + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.method_ with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"method\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.parameters with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parameters\":"; + ( + write_hm_str_str + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.protocol with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"protocol\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.target with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"target\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"version\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_web_request ?(len = 1024) x = let ob = Buffer.create len in write_web_request ob x; Buffer.contents ob -;; - -let read_web_request p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_body = ref None in - let field_headers = ref None in - let field_index = ref (-1L) in - let field_method_ = ref None in - let field_parameters = ref None in - let field_properties = ref None in - let field_protocol = ref None in - let field_target = ref None in - let field_version = ref None in - try +let read_web_request = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'y' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 7 - else -1 - | _ -> -1) - | 7 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - then 1 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - then 6 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | _ -> -1) - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_body := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_headers := Some (read_hm_str_str p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_method_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read_hm_str_str p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_protocol := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_target := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_body = ref (None) in + let field_headers = ref (None) in + let field_index = ref (-1L) in + let field_method_ = ref (None) in + let field_parameters = ref (None) in + let field_properties = ref (None) in + let field_protocol = ref (None) in + let field_target = ref (None) in + let field_version = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'y' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 7 - else -1 - | _ -> -1) - | 7 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - then 1 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - then 6 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - then ( - match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | _ -> -1) - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' then ( + 6 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_body := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_headers := Some (read_hm_str_str p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_method_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parameters := Some (read_hm_str_str p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_protocol := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_target := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ body = !field_body - ; headers = !field_headers - ; index = !field_index - ; method_ = !field_method_ - ; parameters = !field_parameters - ; properties = !field_properties - ; protocol = !field_protocol - ; target = !field_target - ; version = !field_version - } - : web_request) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_body := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_headers := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_method_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocol := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_target := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' then ( + 6 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' then ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_body := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_headers := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_method_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parameters := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocol := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_target := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + body = !field_body; + headers = !field_headers; + index = !field_index; + method_ = !field_method_; + parameters = !field_parameters; + properties = !field_properties; + protocol = !field_protocol; + target = !field_target; + version = !field_version; + } + : web_request) + ) +) let web_request_of_string s = read_web_request (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_request_list = Atdgen_runtime.Oj_run.write_list write_web_request - +let write__web_request_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_web_request + ) +) let string_of__web_request_list ?(len = 1024) x = let ob = Buffer.create len in write__web_request_list ob x; Buffer.contents ob -;; - -let read__web_request_list = Atdgen_runtime.Oj_run.read_list read_web_request - +let read__web_request_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_web_request + ) +) let _web_request_list_of_string s = read__web_request_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_request_list_option = - Atdgen_runtime.Oj_run.write_std_option write__web_request_list -;; - +let write__web_request_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__web_request_list + ) +) let string_of__web_request_list_option ?(len = 1024) x = let ob = Buffer.create len in write__web_request_list_option ob x; Buffer.contents ob -;; - -let read__web_request_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__web_request_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__web_request_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__web_request_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__web_request_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__web_request_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _web_request_list_option_of_string s = read__web_request_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_request_option = Atdgen_runtime.Oj_run.write_std_option write_web_request - +let write__web_request_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_web_request + ) +) let string_of__web_request_option ?(len = 1024) x = let ob = Buffer.create len in write__web_request_option ob x; Buffer.contents ob -;; - -let read__web_request_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_web_request p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_web_request p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__web_request_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_web_request + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_web_request + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _web_request_option_of_string s = read__web_request_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_web_response : _ -> web_response -> _ = +let write_web_response : _ -> web_response -> _ = ( fun ob (x : web_response) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.body with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"body\":"; - write_artifact_content ob x); - (match x.headers with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"headers\":"; - write_hm_str_str ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - if x.no_response_received <> false - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"noResponseReceived\":"; - Yojson.Safe.write_bool ob x.no_response_received); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.protocol with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"protocol\":"; - Yojson.Safe.write_string ob x); - (match x.reason_phrase with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"reasonPhrase\":"; - Yojson.Safe.write_string ob x); - (match x.status_code with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"statusCode\":"; - Yojson.Safe.write_string ob x); - (match x.version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"version\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.body with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"body\":"; + ( + write_artifact_content + ) + ob x; + ); + (match x.headers with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"headers\":"; + ( + write_hm_str_str + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + if x.no_response_received <> false then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"noResponseReceived\":"; + ( + Yojson.Safe.write_bool + ) + ob x.no_response_received; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.protocol with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"protocol\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.reason_phrase with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"reasonPhrase\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.status_code with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"statusCode\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"version\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_web_response ?(len = 1024) x = let ob = Buffer.create len in write_web_response ob x; Buffer.contents ob -;; - -let read_web_response p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_body = ref None in - let field_headers = ref None in - let field_index = ref (-1L) in - let field_no_response_received = ref false in - let field_properties = ref None in - let field_protocol = ref None in - let field_reason_phrase = ref None in - let field_status_code = ref None in - let field_version = ref None in - try +let read_web_response = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'y' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - then 1 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - then 5 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'C' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - then 7 - else -1 - | _ -> -1) - | 12 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'P' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'e' - then 6 - else -1 - | 18 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'R' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'p' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'R' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'v' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'd' - then 3 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_body := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_headers := Some (read_hm_str_str p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_no_response_received := Atdgen_runtime.Oj_run.read_bool p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_protocol := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_reason_phrase := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_status_code := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_body = ref (None) in + let field_headers = ref (None) in + let field_index = ref (-1L) in + let field_no_response_received = ref (false) in + let field_properties = ref (None) in + let field_protocol = ref (None) in + let field_reason_phrase = ref (None) in + let field_status_code = ref (None) in + let field_version = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'y' - then 0 - else -1 - | 5 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 2 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - then 1 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'c' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'l' - then 5 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'C' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - then 7 - else -1 - | _ -> -1) - | 12 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'P' - && String.unsafe_get s (pos + 7) = 'h' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'e' - then 6 - else -1 - | 18 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'R' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'p' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'R' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'v' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'd' - then 3 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' then ( + 5 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'C' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'P' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'R' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'p' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'R' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'v' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_body := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_headers := Some (read_hm_str_str p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_no_response_received := Atdgen_runtime.Oj_run.read_bool p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_protocol := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_reason_phrase := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_status_code := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ body = !field_body - ; headers = !field_headers - ; index = !field_index - ; no_response_received = !field_no_response_received - ; properties = !field_properties - ; protocol = !field_protocol - ; reason_phrase = !field_reason_phrase - ; status_code = !field_status_code - ; version = !field_version - } - : web_response) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_body := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_headers := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_no_response_received := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocol := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_reason_phrase := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_status_code := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'y' then ( + 0 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 2 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'c' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'l' then ( + 5 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'C' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'P' && String.unsafe_get s (pos+7) = 'h' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'R' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'p' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'R' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'v' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_body := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_headers := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_no_response_received := ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_protocol := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_reason_phrase := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_status_code := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + body = !field_body; + headers = !field_headers; + index = !field_index; + no_response_received = !field_no_response_received; + properties = !field_properties; + protocol = !field_protocol; + reason_phrase = !field_reason_phrase; + status_code = !field_status_code; + version = !field_version; + } + : web_response) + ) +) let web_response_of_string s = read_web_response (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_response_list = Atdgen_runtime.Oj_run.write_list write_web_response - +let write__web_response_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_web_response + ) +) let string_of__web_response_list ?(len = 1024) x = let ob = Buffer.create len in write__web_response_list ob x; Buffer.contents ob -;; - -let read__web_response_list = Atdgen_runtime.Oj_run.read_list read_web_response - +let read__web_response_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_web_response + ) +) let _web_response_list_of_string s = read__web_response_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_response_list_option = - Atdgen_runtime.Oj_run.write_std_option write__web_response_list -;; - +let write__web_response_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__web_response_list + ) +) let string_of__web_response_list_option ?(len = 1024) x = let ob = Buffer.create len in write__web_response_list_option ob x; Buffer.contents ob -;; - -let read__web_response_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__web_response_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__web_response_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__web_response_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__web_response_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__web_response_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _web_response_list_option_of_string s = read__web_response_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__web_response_option = Atdgen_runtime.Oj_run.write_std_option write_web_response - +let write__web_response_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_web_response + ) +) let string_of__web_response_option ?(len = 1024) x = let ob = Buffer.create len in write__web_response_option ob x; Buffer.contents ob -;; - -let read__web_response_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_web_response p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_web_response p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__web_response_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_web_response + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_web_response + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _web_response_option_of_string s = read__web_response_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_thread_flow_location : _ -> thread_flow_location -> _ = +let write_thread_flow_location : _ -> thread_flow_location -> _ = ( fun ob (x : thread_flow_location) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if x.execution_order <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"executionOrder\":"; - write_int64 ob x.execution_order); - (match x.execution_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"executionTimeUtc\":"; - Yojson.Safe.write_string ob x); - (match x.importance with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"importance\":"; - write_thread_flow_location_importance ob x); - if x.index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"index\":"; - write_int64 ob x.index); - (match x.kinds with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kinds\":"; - write__string_list ob x); - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_location ob x); - (match x.module_ with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"module\":"; - Yojson.Safe.write_string ob x); - (match x.nesting_level with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"nestingLevel\":"; - write_int64 ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.stack with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stack\":"; - write_stack ob x); - (match x.state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"state\":"; - write_hm_str_mms ob x); - (match x.taxa with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxa\":"; - write__reporting_descriptor_reference_list ob x); - (match x.web_request with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webRequest\":"; - write_web_request ob x); - (match x.web_response with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webResponse\":"; - write_web_response ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if x.execution_order <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"executionOrder\":"; + ( + write_int64 + ) + ob x.execution_order; + ); + (match x.execution_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"executionTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.importance with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"importance\":"; + ( + write_thread_flow_location_importance + ) + ob x; + ); + if x.index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"index\":"; + ( + write_int64 + ) + ob x.index; + ); + (match x.kinds with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kinds\":"; + ( + write__string_list + ) + ob x; + ); + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_location + ) + ob x; + ); + (match x.module_ with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"module\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.nesting_level with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"nestingLevel\":"; + ( + write_int64 + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.stack with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stack\":"; + ( + write_stack + ) + ob x; + ); + (match x.state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"state\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.taxa with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxa\":"; + ( + write__reporting_descriptor_reference_list + ) + ob x; + ); + (match x.web_request with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webRequest\":"; + ( + write_web_request + ) + ob x; + ); + (match x.web_response with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webResponse\":"; + ( + write_web_response + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_thread_flow_location ?(len = 1024) x = let ob = Buffer.create len in write_thread_flow_location ob x; Buffer.contents ob -;; - -let read_thread_flow_location p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_execution_order = ref (-1L) in - let field_execution_time_utc = ref None in - let field_importance = ref None in - let field_index = ref (-1L) in - let field_kinds = ref None in - let field_location = ref None in - let field_module_ = ref None in - let field_nesting_level = ref None in - let field_properties = ref None in - let field_stack = ref None in - let field_state = ref None in - let field_taxa = ref None in - let field_web_request = ref None in - let field_web_response = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_thread_flow_location = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 11 - else -1 - | 5 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 3 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' && String.unsafe_get s (pos + 2) = 'a' - then ( - match String.unsafe_get s (pos + 3) with - | 'c' -> if String.unsafe_get s (pos + 4) = 'k' then 9 else -1 - | 't' -> if String.unsafe_get s (pos + 4) = 'e' then 10 else -1 - | _ -> -1) - else -1 - | _ -> -1) - | 6 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - then 6 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 5 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - then 2 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 8 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - then 12 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'w' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 13 - else -1 - | 12 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'v' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'l' - then 7 - else -1 - | 14 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'O' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'r' - then 0 - else -1 - | 16 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'm' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'U' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'c' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_execution_order := read_int64 p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_execution_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_importance := Some (read_thread_flow_location_importance p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_index := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_module_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_nesting_level := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stack := Some (read_stack p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_state := Some (read_hm_str_mms p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_reference_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_request := Some (read_web_request p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_response := Some (read_web_response p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_execution_order = ref (-1L) in + let field_execution_time_utc = ref (None) in + let field_importance = ref (None) in + let field_index = ref (-1L) in + let field_kinds = ref (None) in + let field_location = ref (None) in + let field_module_ = ref (None) in + let field_nesting_level = ref (None) in + let field_properties = ref (None) in + let field_stack = ref (None) in + let field_state = ref (None) in + let field_taxa = ref (None) in + let field_web_request = ref (None) in + let field_web_response = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 11 - else -1 - | 5 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'x' - then 3 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - && String.unsafe_get s (pos + 4) = 's' - then 4 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' && String.unsafe_get s (pos + 2) = 'a' - then ( - match String.unsafe_get s (pos + 3) with - | 'c' -> if String.unsafe_get s (pos + 4) = 'k' then 9 else -1 - | 't' -> if String.unsafe_get s (pos + 4) = 'e' then 10 else -1 - | _ -> -1) - else -1 - | _ -> -1) - | 6 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'e' - then 6 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 5 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - then 2 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 8 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - then 12 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'w' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 13 - else -1 - | 12 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'v' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'l' - then 7 - else -1 - | 14 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'O' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'r' - then 0 - else -1 - | 16 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'm' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'U' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'c' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 11 + ) + else ( + -1 + ) + ) + | 5 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 3 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' then ( + match String.unsafe_get s (pos+3) with + | 'c' -> ( + if String.unsafe_get s (pos+4) = 'k' then ( + 9 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+4) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'w' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 13 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'v' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'l' then ( + 7 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'O' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'r' then ( + 0 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'U' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'c' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_execution_order := read_int64 p lb - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_execution_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_importance := Some (read_thread_flow_location_importance p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_index := read_int64 p lb - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kinds := Some (read__string_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_module_ := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_nesting_level := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stack := Some (read_stack p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_state := Some (read_hm_str_mms p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_reference_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_request := Some (read_web_request p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_response := Some (read_web_response p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ execution_order = !field_execution_order - ; execution_time_utc = !field_execution_time_utc - ; importance = !field_importance - ; index = !field_index - ; kinds = !field_kinds - ; location = !field_location - ; module_ = !field_module_ - ; nesting_level = !field_nesting_level - ; properties = !field_properties - ; stack = !field_stack - ; state = !field_state - ; taxa = !field_taxa - ; web_request = !field_web_request - ; web_response = !field_web_response - } - : thread_flow_location) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_execution_order := ( + ( + read_int64 + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_execution_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_importance := ( + Some ( + ( + read_thread_flow_location_importance + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_module_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_nesting_level := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stack := ( + Some ( + ( + read_stack + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_reference_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_request := ( + Some ( + ( + read_web_request + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_response := ( + Some ( + ( + read_web_response + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 11 + ) + else ( + -1 + ) + ) + | 5 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'x' then ( + 3 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' && String.unsafe_get s (pos+4) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' then ( + match String.unsafe_get s (pos+3) with + | 'c' -> ( + if String.unsafe_get s (pos+4) = 'k' then ( + 9 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+4) = 'e' then ( + 10 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'e' then ( + 6 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'w' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 13 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'v' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'l' then ( + 7 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'O' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'r' then ( + 0 + ) + else ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'm' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'U' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'c' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_execution_order := ( + ( + read_int64 + ) p lb + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_execution_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_importance := ( + Some ( + ( + read_thread_flow_location_importance + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_index := ( + ( + read_int64 + ) p lb + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kinds := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_module_ := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_nesting_level := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stack := ( + Some ( + ( + read_stack + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_reference_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_request := ( + Some ( + ( + read_web_request + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_response := ( + Some ( + ( + read_web_response + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + execution_order = !field_execution_order; + execution_time_utc = !field_execution_time_utc; + importance = !field_importance; + index = !field_index; + kinds = !field_kinds; + location = !field_location; + module_ = !field_module_; + nesting_level = !field_nesting_level; + properties = !field_properties; + stack = !field_stack; + state = !field_state; + taxa = !field_taxa; + web_request = !field_web_request; + web_response = !field_web_response; + } + : thread_flow_location) + ) +) let thread_flow_location_of_string s = read_thread_flow_location (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__thread_flow_location_list = - Atdgen_runtime.Oj_run.write_list write_thread_flow_location -;; - +let write__thread_flow_location_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_thread_flow_location + ) +) let string_of__thread_flow_location_list ?(len = 1024) x = let ob = Buffer.create len in write__thread_flow_location_list ob x; Buffer.contents ob -;; - -let read__thread_flow_location_list = - Atdgen_runtime.Oj_run.read_list read_thread_flow_location -;; - +let read__thread_flow_location_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_thread_flow_location + ) +) let _thread_flow_location_list_of_string s = read__thread_flow_location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__thread_flow_location_list_option = - Atdgen_runtime.Oj_run.write_std_option write__thread_flow_location_list -;; - +let write__thread_flow_location_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__thread_flow_location_list + ) +) let string_of__thread_flow_location_list_option ?(len = 1024) x = let ob = Buffer.create len in write__thread_flow_location_list_option ob x; Buffer.contents ob -;; - -let read__thread_flow_location_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__thread_flow_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__thread_flow_location_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__thread_flow_location_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__thread_flow_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__thread_flow_location_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _thread_flow_location_list_option_of_string s = - read__thread_flow_location_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_thread_flow : _ -> thread_flow -> _ = + read__thread_flow_location_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_thread_flow : _ -> thread_flow -> _ = ( fun ob (x : thread_flow) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x); - (match x.immutable_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"immutableState\":"; - write_hm_str_mms ob x); - (match x.initial_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"initialState\":"; - write_hm_str_mms ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"locations\":"; - write__thread_flow_location_list ob x.locations; - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.immutable_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"immutableState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + (match x.initial_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"initialState\":"; + ( + write_hm_str_mms + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"locations\":"; + ( + write__thread_flow_location_list + ) + ob x.locations; + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_thread_flow ?(len = 1024) x = let ob = Buffer.create len in write_thread_flow ob x; Buffer.contents ob -;; - -let read_thread_flow p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_id = ref None in - let field_immutable_state = ref None in - let field_initial_state = ref None in - let field_locations = ref None in - let field_message = ref None in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_thread_flow = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 4 - else -1 - | 9 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 2 - else -1 - | 14 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 3 -> field_locations := Some (read__thread_flow_location_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_id = ref (None) in + let field_immutable_state = ref (None) in + let field_initial_state = ref (None) in + let field_locations = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 0 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 4 - else -1 - | 9 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 3 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 5 - else -1 - | 12 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - then 2 - else -1 - | 14 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'm' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'b' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'e' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_immutable_state := Some (read_hm_str_mms p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_initial_state := Some (read_hm_str_mms p lb) - | 3 -> field_locations := Some (read__thread_flow_location_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ id = !field_id - ; immutable_state = !field_immutable_state - ; initial_state = !field_initial_state - ; locations = - (match !field_locations with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "locations") - ; message = !field_message - ; properties = !field_properties - } - : thread_flow) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + field_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 4 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'm' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'e' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_immutable_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_initial_state := ( + Some ( + ( + read_hm_str_mms + ) p lb + ) + ); + ) + | 3 -> + field_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + id = !field_id; + immutable_state = !field_immutable_state; + initial_state = !field_initial_state; + locations = (match !field_locations with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "locations"); + message = !field_message; + properties = !field_properties; + } + : thread_flow) + ) +) let thread_flow_of_string s = read_thread_flow (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__thread_flow_list = Atdgen_runtime.Oj_run.write_list write_thread_flow - +let write__thread_flow_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_thread_flow + ) +) let string_of__thread_flow_list ?(len = 1024) x = let ob = Buffer.create len in write__thread_flow_list ob x; Buffer.contents ob -;; - -let read__thread_flow_list = Atdgen_runtime.Oj_run.read_list read_thread_flow - +let read__thread_flow_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_thread_flow + ) +) let _thread_flow_list_of_string s = read__thread_flow_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_code_flow : _ -> code_flow -> _ = +let write_code_flow : _ -> code_flow -> _ = ( fun ob (x : code_flow) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadFlows\":"; - write__thread_flow_list ob x.thread_flows; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadFlows\":"; + ( + write__thread_flow_list + ) + ob x.thread_flows; + Buffer.add_char ob '}'; +) let string_of_code_flow ?(len = 1024) x = let ob = Buffer.create len in write_code_flow ob x; Buffer.contents ob -;; - -let read_code_flow p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_message = ref None in - let field_properties = ref None in - let field_thread_flows = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_code_flow = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 11 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 's' - then 2 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_thread_flows := Some (read__thread_flow_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_message = ref (None) in + let field_properties = ref (None) in + let field_thread_flows = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 0 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 11 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 's' - then 2 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 2 -> field_thread_flows := Some (read__thread_flow_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ message = !field_message - ; properties = !field_properties - ; thread_flows = - (match !field_thread_flows with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "thread_flows") - } - : code_flow) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_thread_flows := ( + Some ( + ( + read__thread_flow_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 2 -> + field_thread_flows := ( + Some ( + ( + read__thread_flow_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + message = !field_message; + properties = !field_properties; + thread_flows = (match !field_thread_flows with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "thread_flows"); + } + : code_flow) + ) +) let code_flow_of_string s = read_code_flow (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__code_flow_list = Atdgen_runtime.Oj_run.write_list write_code_flow - +let write__code_flow_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_code_flow + ) +) let string_of__code_flow_list ?(len = 1024) x = let ob = Buffer.create len in write__code_flow_list ob x; Buffer.contents ob -;; - -let read__code_flow_list = Atdgen_runtime.Oj_run.read_list read_code_flow - +let read__code_flow_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_code_flow + ) +) let _code_flow_list_of_string s = read__code_flow_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__code_flow_list_option = - Atdgen_runtime.Oj_run.write_std_option write__code_flow_list -;; - +let write__code_flow_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__code_flow_list + ) +) let string_of__code_flow_list_option ?(len = 1024) x = let ob = Buffer.create len in write__code_flow_list_option ob x; Buffer.contents ob -;; - -let read__code_flow_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__code_flow_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__code_flow_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__code_flow_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__code_flow_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__code_flow_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _code_flow_list_option_of_string s = read__code_flow_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let rec write__node_list ob x = (Atdgen_runtime.Oj_run.write_list write_node) ob x - +let rec write__node_list ob x = ( + Atdgen_runtime.Oj_run.write_list ( + write_node + ) +) ob x and string_of__node_list ?(len = 1024) x = let ob = Buffer.create len in write__node_list ob x; Buffer.contents ob - -and write__node_list_option ob x = - (Atdgen_runtime.Oj_run.write_std_option write__node_list) ob x - +and write__node_list_option ob x = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__node_list + ) +) ob x and string_of__node_list_option ?(len = 1024) x = let ob = Buffer.create len in write__node_list_option ob x; Buffer.contents ob - -and write_node : _ -> node -> _ = +and write_node : _ -> node -> _ = ( fun ob (x : node) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.children with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"children\":"; - write__node_list ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x.id; - (match x.label with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"label\":"; - write_message ob x); - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.children with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"children\":"; + ( + write__node_list + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x.id; + (match x.label with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"label\":"; + ( + write_message + ) + ob x; + ); + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) and string_of_node ?(len = 1024) x = let ob = Buffer.create len in write_node ob x; Buffer.contents ob -;; - -let rec read__node_list p lb = (Atdgen_runtime.Oj_run.read_list read_node) p lb - +let rec read__node_list p lb = ( + Atdgen_runtime.Oj_run.read_list ( + read_node + ) +) p lb and _node_list_of_string s = read__node_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read__node_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__node_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__node_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - +and read__node_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__node_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__node_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) and _node_list_option_of_string s = read__node_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read_node p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_children = ref None in - let field_id = ref None in - let field_label = ref None in - let field_location = ref None in - let field_properties = ref None in - try +and read_node = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 2 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 3 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_children := Some (read__node_list p lb) - | 1 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_label := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_children = ref (None) in + let field_id = ref (None) in + let field_label = ref (None) in + let field_location = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 2 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'n' - then 0 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 3 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 2 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_children := Some (read__node_list p lb) - | 1 -> field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_label := Some (read_message p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_location p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ children = !field_children - ; id = - (match !field_id with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "id") - ; label = !field_label - ; location = !field_location - ; properties = !field_properties - } - : node) - -and node_of_string s = read_node (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -let rec write__exception_list ob x = - (Atdgen_runtime.Oj_run.write_list write_exception_) ob x - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_children := ( + Some ( + ( + read__node_list + ) p lb + ) + ); + ) + | 1 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_label := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 2 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_children := ( + Some ( + ( + read__node_list + ) p lb + ) + ); + ) + | 1 -> + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_label := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_location + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + children = !field_children; + id = (match !field_id with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "id"); + label = !field_label; + location = !field_location; + properties = !field_properties; + } + : node) + ) +) +and node_of_string s = + read_node (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let rec write__exception_list ob x = ( + Atdgen_runtime.Oj_run.write_list ( + write_exception_ + ) +) ob x and string_of__exception_list ?(len = 1024) x = let ob = Buffer.create len in write__exception_list ob x; Buffer.contents ob - -and write__exception_list_option ob x = - (Atdgen_runtime.Oj_run.write_std_option write__exception_list) ob x - +and write__exception_list_option ob x = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__exception_list + ) +) ob x and string_of__exception_list_option ?(len = 1024) x = let ob = Buffer.create len in write__exception_list_option ob x; Buffer.contents ob - -and write_exception_ : _ -> exception_ -> _ = +and write_exception_ : _ -> exception_ -> _ = ( fun ob (x : exception_) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.inner_exceptions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"innerExceptions\":"; - write__exception_list ob x); - (match x.kind with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kind\":"; - Yojson.Safe.write_string ob x); - (match x.message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.stack with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stack\":"; - write_stack ob x); - Buffer.add_char ob '}' - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.inner_exceptions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"innerExceptions\":"; + ( + write__exception_list + ) + ob x; + ); + (match x.kind with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kind\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.stack with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stack\":"; + ( + write_stack + ) + ob x; + ); + Buffer.add_char ob '}'; +) and string_of_exception_ ?(len = 1024) x = let ob = Buffer.create len in write_exception_ ob x; Buffer.contents ob -;; - -let rec read__exception_list p lb = (Atdgen_runtime.Oj_run.read_list read_exception_) p lb - +let rec read__exception_list p lb = ( + Atdgen_runtime.Oj_run.read_list ( + read_exception_ + ) +) p lb and _exception_list_of_string s = read__exception_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read__exception_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__exception_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__exception_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - +and read__exception_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__exception_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__exception_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) and _exception_list_option_of_string s = read__exception_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read_exception_ p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_inner_exceptions = ref None in - let field_kind = ref None in - let field_message = ref None in - let field_properties = ref None in - let field_stack = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +and read_exception_ = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'k' - then 4 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'E' - && String.unsafe_get s (pos + 6) = 'x' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_inner_exceptions := Some (read__exception_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stack := Some (read_stack p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_inner_exceptions = ref (None) in + let field_kind = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + let field_stack = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'k' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 1 - else -1 - | 5 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'k' - then 4 - else -1 - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 15 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'E' - && String.unsafe_get s (pos + 6) = 'x' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'p' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'i' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 's' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'k' then ( + 4 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'E' && String.unsafe_get s (pos+6) = 'x' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_inner_exceptions := Some (read__exception_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_message := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stack := Some (read_stack p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ inner_exceptions = !field_inner_exceptions - ; kind = !field_kind - ; message = !field_message - ; properties = !field_properties - ; stack = !field_stack - } - : exception_) - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inner_exceptions := ( + Some ( + ( + read__exception_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stack := ( + Some ( + ( + read_stack + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'k' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 1 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'k' then ( + 4 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'E' && String.unsafe_get s (pos+6) = 'x' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'p' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'i' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inner_exceptions := ( + Some ( + ( + read__exception_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_message := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stack := ( + Some ( + ( + read_stack + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + inner_exceptions = !field_inner_exceptions; + kind = !field_kind; + message = !field_message; + properties = !field_properties; + stack = !field_stack; + } + : exception_) + ) +) and exception__of_string s = read_exception_ (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_graph : _ -> graph -> _ = +let write_graph : _ -> graph -> _ = ( fun ob (x : graph) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.edges with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"edges\":"; - write__edge_list ob x); - (match x.nodes with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"nodes\":"; - write__node_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.edges with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"edges\":"; + ( + write__edge_list + ) + ob x; + ); + (match x.nodes with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"nodes\":"; + ( + write__node_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_graph ?(len = 1024) x = let ob = Buffer.create len in write_graph ob x; Buffer.contents ob -;; - -let read_graph p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_description = ref None in - let field_edges = ref None in - let field_nodes = ref None in - let field_properties = ref None in - try +let read_graph = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 2 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edges := Some (read__edge_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_nodes := Some (read__node_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_description = ref (None) in + let field_edges = ref (None) in + let field_nodes = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'd' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 1 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 2 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_edges := Some (read__edge_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_nodes := Some (read__node_list p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ description = !field_description - ; edges = !field_edges - ; nodes = !field_nodes - ; properties = !field_properties - } - : graph) -;; - -let graph_of_string s = read_graph (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__graph_list = Atdgen_runtime.Oj_run.write_list write_graph - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edges := ( + Some ( + ( + read__edge_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_nodes := ( + Some ( + ( + read__node_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'd' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_edges := ( + Some ( + ( + read__edge_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_nodes := ( + Some ( + ( + read__node_list + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + description = !field_description; + edges = !field_edges; + nodes = !field_nodes; + properties = !field_properties; + } + : graph) + ) +) +let graph_of_string s = + read_graph (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__graph_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_graph + ) +) let string_of__graph_list ?(len = 1024) x = let ob = Buffer.create len in write__graph_list ob x; Buffer.contents ob -;; - -let read__graph_list = Atdgen_runtime.Oj_run.read_list read_graph - +let read__graph_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_graph + ) +) let _graph_list_of_string s = read__graph_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__graph_list_option = Atdgen_runtime.Oj_run.write_std_option write__graph_list - +let write__graph_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__graph_list + ) +) let string_of__graph_list_option ?(len = 1024) x = let ob = Buffer.create len in write__graph_list_option ob x; Buffer.contents ob -;; - -let read__graph_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__graph_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__graph_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__graph_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__graph_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__graph_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _graph_list_option_of_string s = read__graph_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_result : _ -> result -> _ = +let write_result : _ -> result -> _ = ( fun ob (x : result) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.analysis_target with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"analysisTarget\":"; - write_artifact_location ob x); - (match x.attachments with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"attachments\":"; - write__attachment_list ob x); - (match x.baseline_state with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"baselineState\":"; - write_result_baseline_state ob x); - (match x.code_flows with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"codeFlows\":"; - write__code_flow_list ob x); - (match x.correlation_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"correlationGuid\":"; - write_result_correlation_guid ob x); - (match x.fingerprints with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fingerprints\":"; - write_hm_str_str ob x); - (match x.fixes with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"fixes\":"; - write__fix_list ob x); - (match x.graph_traversals with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"graphTraversals\":"; - write__graph_traversal_list ob x); - (match x.graphs with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"graphs\":"; - write__graph_list ob x); - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_result_guid ob x); - (match x.hosted_viewer_uri with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"hostedViewerUri\":"; - Yojson.Safe.write_string ob x); - (match x.kind with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"kind\":"; - write_result_kind ob x); - (match x.level with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"level\":"; - write_result_level ob x); - (match x.locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"locations\":"; - write__location_list ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x.message; - (match x.occurrence_count with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"occurrenceCount\":"; - write_int64 ob x); - (match x.partial_fingerprints with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"partialFingerprints\":"; - write_hm_str_str ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.provenance with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"provenance\":"; - write_result_provenance ob x); - if x.rank <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rank\":"; - write_int64 ob x.rank); - (match x.related_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"relatedLocations\":"; - write__location_list ob x); - (match x.rule with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"rule\":"; - write_reporting_descriptor_reference ob x); - (match x.rule_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"ruleId\":"; - Yojson.Safe.write_string ob x); - if x.rule_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"ruleIndex\":"; - write_int64 ob x.rule_index); - (match x.stacks with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stacks\":"; - write__stack_list ob x); - (match x.suppressions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"suppressions\":"; - write__suppression_list ob x); - (match x.taxa with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxa\":"; - write__reporting_descriptor_reference_list ob x); - (match x.web_request with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webRequest\":"; - write_web_request ob x); - (match x.web_response with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webResponse\":"; - write_web_response ob x); - (match x.work_item_uris with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"workItemUris\":"; - write__string_list ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.analysis_target with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"analysisTarget\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.attachments with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"attachments\":"; + ( + write__attachment_list + ) + ob x; + ); + (match x.baseline_state with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"baselineState\":"; + ( + write_result_baseline_state + ) + ob x; + ); + (match x.code_flows with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"codeFlows\":"; + ( + write__code_flow_list + ) + ob x; + ); + (match x.correlation_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"correlationGuid\":"; + ( + write_result_correlation_guid + ) + ob x; + ); + (match x.fingerprints with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fingerprints\":"; + ( + write_hm_str_str + ) + ob x; + ); + (match x.fixes with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"fixes\":"; + ( + write__fix_list + ) + ob x; + ); + (match x.graph_traversals with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"graphTraversals\":"; + ( + write__graph_traversal_list + ) + ob x; + ); + (match x.graphs with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"graphs\":"; + ( + write__graph_list + ) + ob x; + ); + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_result_guid + ) + ob x; + ); + (match x.hosted_viewer_uri with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"hostedViewerUri\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.kind with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"kind\":"; + ( + write_result_kind + ) + ob x; + ); + (match x.level with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"level\":"; + ( + write_result_level + ) + ob x; + ); + (match x.locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"locations\":"; + ( + write__location_list + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x.message; + (match x.occurrence_count with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"occurrenceCount\":"; + ( + write_int64 + ) + ob x; + ); + (match x.partial_fingerprints with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"partialFingerprints\":"; + ( + write_hm_str_str + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.provenance with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"provenance\":"; + ( + write_result_provenance + ) + ob x; + ); + if x.rank <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rank\":"; + ( + write_int64 + ) + ob x.rank; + ); + (match x.related_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"relatedLocations\":"; + ( + write__location_list + ) + ob x; + ); + (match x.rule with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"rule\":"; + ( + write_reporting_descriptor_reference + ) + ob x; + ); + (match x.rule_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"ruleId\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.rule_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"ruleIndex\":"; + ( + write_int64 + ) + ob x.rule_index; + ); + (match x.stacks with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stacks\":"; + ( + write__stack_list + ) + ob x; + ); + (match x.suppressions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"suppressions\":"; + ( + write__suppression_list + ) + ob x; + ); + (match x.taxa with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxa\":"; + ( + write__reporting_descriptor_reference_list + ) + ob x; + ); + (match x.web_request with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webRequest\":"; + ( + write_web_request + ) + ob x; + ); + (match x.web_response with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webResponse\":"; + ( + write_web_response + ) + ob x; + ); + (match x.work_item_uris with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"workItemUris\":"; + ( + write__string_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_result ?(len = 1024) x = let ob = Buffer.create len in write_result ob x; Buffer.contents ob -;; - -let read_result p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_analysis_target = ref None in - let field_attachments = ref None in - let field_baseline_state = ref None in - let field_code_flows = ref None in - let field_correlation_guid = ref None in - let field_fingerprints = ref None in - let field_fixes = ref None in - let field_graph_traversals = ref None in - let field_graphs = ref None in - let field_guid = ref None in - let field_hosted_viewer_uri = ref None in - let field_kind = ref None in - let field_level = ref None in - let field_locations = ref None in - let field_message = ref None in - let field_occurrence_count = ref None in - let field_partial_fingerprints = ref None in - let field_properties = ref None in - let field_provenance = ref None in - let field_rank = ref (-1L) in - let field_related_locations = ref None in - let field_rule = ref None in - let field_rule_id = ref None in - let field_rule_index = ref (-1L) in - let field_stacks = ref None in - let field_suppressions = ref None in - let field_taxa = ref None in - let field_web_request = ref None in - let field_web_response = ref None in - let field_work_item_uris = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_result = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 9 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 11 - else -1 - | 'r' -> - (match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'k' - then 19 - else -1 - | 'u' -> - if String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - then 21 - else -1 - | _ -> -1) - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 26 - else -1 - | _ -> -1) - | 5 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 6 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 12 - else -1 - | _ -> -1) - | 6 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 8 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'd' - then 22 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'k' - && String.unsafe_get s (pos + 5) = 's' - then 24 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 14 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'F' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'w' - && String.unsafe_get s (pos + 8) = 's' - then 3 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 13 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'x' - then 23 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' && String.unsafe_get s (pos + 2) = 'o' - then ( - match String.unsafe_get s (pos + 3) with - | 'p' -> - if String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 17 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - then 18 - else -1 - | _ -> -1) - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - then 27 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'h' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 1 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 28 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 's' - then 5 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 25 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 's' - then 29 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'S' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'e' - then 2 - else -1 - | 14 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'g' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 't' - then 0 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'G' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'd' - then 4 - else -1 - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 'T' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'v' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 's' - then 7 - else -1 - | 'h' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'V' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'U' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'i' - then 10 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'C' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 't' - then 15 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 20 - else -1 - | 19 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'F' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'g' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'p' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 's' - then 16 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_analysis_target := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_attachments := Some (read__attachment_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_baseline_state := Some (read_result_baseline_state p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_code_flows := Some (read__code_flow_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_correlation_guid := Some (read_result_correlation_guid p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fingerprints := Some (read_hm_str_str p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fixes := Some (read__fix_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graph_traversals := Some (read__graph_traversal_list p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__graph_list p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_result_guid p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_hosted_viewer_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (read_result_kind p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_result_level p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__location_list p lb) - | 14 -> field_message := Some (read_message p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_occurrence_count := Some (read_int64 p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_partial_fingerprints := Some (read_hm_str_str p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_provenance := Some (read_result_provenance p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_rank := read_int64 p lb - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_related_locations := Some (read__location_list p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule := Some (read_reporting_descriptor_reference p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule_index := read_int64 p lb - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stacks := Some (read__stack_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_suppressions := Some (read__suppression_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_reference_list p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_request := Some (read_web_request p lb) - | 28 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_response := Some (read_web_response p lb) - | 29 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_work_item_uris := Some (read__string_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_analysis_target = ref (None) in + let field_attachments = ref (None) in + let field_baseline_state = ref (None) in + let field_code_flows = ref (None) in + let field_correlation_guid = ref (None) in + let field_fingerprints = ref (None) in + let field_fixes = ref (None) in + let field_graph_traversals = ref (None) in + let field_graphs = ref (None) in + let field_guid = ref (None) in + let field_hosted_viewer_uri = ref (None) in + let field_kind = ref (None) in + let field_level = ref (None) in + let field_locations = ref (None) in + let field_message = ref (None) in + let field_occurrence_count = ref (None) in + let field_partial_fingerprints = ref (None) in + let field_properties = ref (None) in + let field_provenance = ref (None) in + let field_rank = ref (-1L) in + let field_related_locations = ref (None) in + let field_rule = ref (None) in + let field_rule_id = ref (None) in + let field_rule_index = ref (-1L) in + let field_stacks = ref (None) in + let field_suppressions = ref (None) in + let field_taxa = ref (None) in + let field_web_request = ref (None) in + let field_web_response = ref (None) in + let field_work_item_uris = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 9 - else -1 - | 'k' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'd' - then 11 - else -1 - | 'r' -> - (match String.unsafe_get s (pos + 1) with - | 'a' -> - if String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'k' - then 19 - else -1 - | 'u' -> - if String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - then 21 - else -1 - | _ -> -1) - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'a' - then 26 - else -1 - | _ -> -1) - | 5 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 6 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 12 - else -1 - | _ -> -1) - | 6 -> - (match String.unsafe_get s pos with - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 8 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'd' - then 22 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'k' - && String.unsafe_get s (pos + 5) = 's' - then 24 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 14 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'F' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'w' - && String.unsafe_get s (pos + 8) = 's' - then 3 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 13 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'x' - then 23 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' && String.unsafe_get s (pos + 2) = 'o' - then ( - match String.unsafe_get s (pos + 3) with - | 'p' -> - if String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 17 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - then 18 - else -1 - | _ -> -1) - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - then 27 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'h' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 1 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 28 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 'f' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'r' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 's' - then 5 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 25 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'I' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 's' - then 29 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'S' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'e' - then 2 - else -1 - | 14 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'g' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 't' - then 0 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'G' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'd' - then 4 - else -1 - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 'T' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'v' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 's' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 's' - then 7 - else -1 - | 'h' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'V' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'U' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'i' - then 10 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'c' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'C' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 't' - then 15 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 20 - else -1 - | 19 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'F' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'g' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'p' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 's' - then 16 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 9 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 11 + ) + else ( + -1 + ) + ) + | 'r' -> ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'k' then ( + 19 + ) + else ( + -1 + ) + ) + | 'u' -> ( + if String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'd' then ( + 22 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'k' && String.unsafe_get s (pos+5) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 14 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'F' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'w' && String.unsafe_get s (pos+8) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'x' then ( + 23 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' then ( + match String.unsafe_get s (pos+3) with + | 'p' -> ( + if String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 28 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 25 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 's' then ( + 29 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'S' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'G' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 'T' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'V' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'U' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'i' then ( + 10 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'C' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 't' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'F' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'g' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'p' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_analysis_target := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_attachments := Some (read__attachment_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_baseline_state := Some (read_result_baseline_state p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_code_flows := Some (read__code_flow_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_correlation_guid := Some (read_result_correlation_guid p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fingerprints := Some (read_hm_str_str p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_fixes := Some (read__fix_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graph_traversals := Some (read__graph_traversal_list p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__graph_list p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_result_guid p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_hosted_viewer_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_kind := Some (read_result_kind p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_result_level p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__location_list p lb) - | 14 -> field_message := Some (read_message p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_occurrence_count := Some (read_int64 p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_partial_fingerprints := Some (read_hm_str_str p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_provenance := Some (read_result_provenance p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) then field_rank := read_int64 p lb - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_related_locations := Some (read__location_list p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule := Some (read_reporting_descriptor_reference p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_rule_index := read_int64 p lb - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stacks := Some (read__stack_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_suppressions := Some (read__suppression_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxa := Some (read__reporting_descriptor_reference_list p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_request := Some (read_web_request p lb) - | 28 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_response := Some (read_web_response p lb) - | 29 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_work_item_uris := Some (read__string_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ analysis_target = !field_analysis_target - ; attachments = !field_attachments - ; baseline_state = !field_baseline_state - ; code_flows = !field_code_flows - ; correlation_guid = !field_correlation_guid - ; fingerprints = !field_fingerprints - ; fixes = !field_fixes - ; graph_traversals = !field_graph_traversals - ; graphs = !field_graphs - ; guid = !field_guid - ; hosted_viewer_uri = !field_hosted_viewer_uri - ; kind = !field_kind - ; level = !field_level - ; locations = !field_locations - ; message = - (match !field_message with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "message") - ; occurrence_count = !field_occurrence_count - ; partial_fingerprints = !field_partial_fingerprints - ; properties = !field_properties - ; provenance = !field_provenance - ; rank = !field_rank - ; related_locations = !field_related_locations - ; rule = !field_rule - ; rule_id = !field_rule_id - ; rule_index = !field_rule_index - ; stacks = !field_stacks - ; suppressions = !field_suppressions - ; taxa = !field_taxa - ; web_request = !field_web_request - ; web_response = !field_web_response - ; work_item_uris = !field_work_item_uris - } - : result) -;; - -let result_of_string s = read_result (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__exception_option = Atdgen_runtime.Oj_run.write_std_option write_exception_ - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_analysis_target := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_attachments := ( + Some ( + ( + read__attachment_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_baseline_state := ( + Some ( + ( + read_result_baseline_state + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_code_flows := ( + Some ( + ( + read__code_flow_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_correlation_guid := ( + Some ( + ( + read_result_correlation_guid + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fingerprints := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fixes := ( + Some ( + ( + read__fix_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graph_traversals := ( + Some ( + ( + read__graph_traversal_list + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_result_guid + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hosted_viewer_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + read_result_kind + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_result_level + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 14 -> + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_occurrence_count := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_partial_fingerprints := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_provenance := ( + Some ( + ( + read_result_provenance + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rank := ( + ( + read_int64 + ) p lb + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_related_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_index := ( + ( + read_int64 + ) p lb + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stacks := ( + Some ( + ( + read__stack_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_suppressions := ( + Some ( + ( + read__suppression_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_reference_list + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_request := ( + Some ( + ( + read_web_request + ) p lb + ) + ); + ) + | 28 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_response := ( + Some ( + ( + read_web_response + ) p lb + ) + ); + ) + | 29 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_work_item_uris := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 9 + ) + else ( + -1 + ) + ) + | 'k' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'd' then ( + 11 + ) + else ( + -1 + ) + ) + | 'r' -> ( + match String.unsafe_get s (pos+1) with + | 'a' -> ( + if String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'k' then ( + 19 + ) + else ( + -1 + ) + ) + | 'u' -> ( + if String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'a' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 5 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'd' then ( + 22 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'k' && String.unsafe_get s (pos+5) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 14 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'F' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'w' && String.unsafe_get s (pos+8) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'x' then ( + 23 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' then ( + match String.unsafe_get s (pos+3) with + | 'p' -> ( + if String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 28 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'f' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'r' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 25 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'I' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 's' then ( + 29 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'S' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'G' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 'T' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'v' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 's' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'V' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'U' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'i' then ( + 10 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'c' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'C' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 't' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'F' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'g' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'p' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_analysis_target := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_attachments := ( + Some ( + ( + read__attachment_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_baseline_state := ( + Some ( + ( + read_result_baseline_state + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_code_flows := ( + Some ( + ( + read__code_flow_list + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_correlation_guid := ( + Some ( + ( + read_result_correlation_guid + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fingerprints := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_fixes := ( + Some ( + ( + read__fix_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graph_traversals := ( + Some ( + ( + read__graph_traversal_list + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_result_guid + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hosted_viewer_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_kind := ( + Some ( + ( + read_result_kind + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_result_level + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 14 -> + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_occurrence_count := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_partial_fingerprints := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_provenance := ( + Some ( + ( + read_result_provenance + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rank := ( + ( + read_int64 + ) p lb + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_related_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_index := ( + ( + read_int64 + ) p lb + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stacks := ( + Some ( + ( + read__stack_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_suppressions := ( + Some ( + ( + read__suppression_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxa := ( + Some ( + ( + read__reporting_descriptor_reference_list + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_request := ( + Some ( + ( + read_web_request + ) p lb + ) + ); + ) + | 28 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_response := ( + Some ( + ( + read_web_response + ) p lb + ) + ); + ) + | 29 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_work_item_uris := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + analysis_target = !field_analysis_target; + attachments = !field_attachments; + baseline_state = !field_baseline_state; + code_flows = !field_code_flows; + correlation_guid = !field_correlation_guid; + fingerprints = !field_fingerprints; + fixes = !field_fixes; + graph_traversals = !field_graph_traversals; + graphs = !field_graphs; + guid = !field_guid; + hosted_viewer_uri = !field_hosted_viewer_uri; + kind = !field_kind; + level = !field_level; + locations = !field_locations; + message = (match !field_message with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "message"); + occurrence_count = !field_occurrence_count; + partial_fingerprints = !field_partial_fingerprints; + properties = !field_properties; + provenance = !field_provenance; + rank = !field_rank; + related_locations = !field_related_locations; + rule = !field_rule; + rule_id = !field_rule_id; + rule_index = !field_rule_index; + stacks = !field_stacks; + suppressions = !field_suppressions; + taxa = !field_taxa; + web_request = !field_web_request; + web_response = !field_web_response; + work_item_uris = !field_work_item_uris; + } + : result) + ) +) +let result_of_string s = + read_result (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__exception_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_exception_ + ) +) let string_of__exception_option ?(len = 1024) x = let ob = Buffer.create len in write__exception_option ob x; Buffer.contents ob -;; - -let read__exception_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_exception_ p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_exception_ p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__exception_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_exception_ + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_exception_ + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _exception_option_of_string s = read__exception_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_notification : _ -> notification -> _ = +let write_notification : _ -> notification -> _ = ( fun ob (x : notification) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.associated_rule with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"associatedRule\":"; - write_reporting_descriptor_reference ob x); - (match x.descriptor with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"descriptor\":"; - write_reporting_descriptor_reference ob x); - (match x.exception_ with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"exception\":"; - write_exception_ ob x); - (match x.level with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"level\":"; - write_notification_level ob x); - (match x.locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"locations\":"; - write__location_list ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"message\":"; - write_message ob x.message; - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.thread_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadId\":"; - write_int64 ob x); - (match x.time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"timeUtc\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.associated_rule with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"associatedRule\":"; + ( + write_reporting_descriptor_reference + ) + ob x; + ); + (match x.descriptor with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"descriptor\":"; + ( + write_reporting_descriptor_reference + ) + ob x; + ); + (match x.exception_ with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"exception\":"; + ( + write_exception_ + ) + ob x; + ); + (match x.level with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"level\":"; + ( + write_notification_level + ) + ob x; + ); + (match x.locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"locations\":"; + ( + write__location_list + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"message\":"; + ( + write_message + ) + ob x.message; + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.thread_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadId\":"; + ( + write_int64 + ) + ob x; + ); + (match x.time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"timeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_notification ?(len = 1024) x = let ob = Buffer.create len in write_notification ob x; Buffer.contents ob -;; - -let read_notification p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_associated_rule = ref None in - let field_descriptor = ref None in - let field_exception_ = ref None in - let field_level = ref None in - let field_locations = ref None in - let field_message = ref None in - let field_properties = ref None in - let field_thread_id = ref None in - let field_time_utc = ref None in - try +let read_notification = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 3 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 5 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'U' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'c' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'd' - then 7 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'p' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - then 2 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 4 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'r' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'R' - && String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 'e' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_associated_rule := Some (read_reporting_descriptor_reference p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_descriptor := Some (read_reporting_descriptor_reference p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exception_ := Some (read_exception_ p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_notification_level p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__location_list p lb) - | 5 -> field_message := Some (read_message p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_id := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_associated_rule = ref (None) in + let field_descriptor = ref (None) in + let field_exception_ = ref (None) in + let field_level = ref (None) in + let field_locations = ref (None) in + let field_message = ref (None) in + let field_properties = ref (None) in + let field_thread_id = ref (None) in + let field_time_utc = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - then 3 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | 'm' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'e' - then 5 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'U' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'c' - then 8 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'd' - then 7 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'p' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - then 2 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 's' - then 4 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'r' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 6 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'd' - && String.unsafe_get s (pos + 10) = 'R' - && String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'l' - && String.unsafe_get s (pos + 13) = 'e' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 3 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'U' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'c' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'p' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'r' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'R' && String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_associated_rule := Some (read_reporting_descriptor_reference p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_descriptor := Some (read_reporting_descriptor_reference p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exception_ := Some (read_exception_ p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_level := Some (read_notification_level p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_locations := Some (read__location_list p lb) - | 5 -> field_message := Some (read_message p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_id := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ associated_rule = !field_associated_rule - ; descriptor = !field_descriptor - ; exception_ = !field_exception_ - ; level = !field_level - ; locations = !field_locations - ; message = - (match !field_message with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "message") - ; properties = !field_properties - ; thread_id = !field_thread_id - ; time_utc = !field_time_utc - } - : notification) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_associated_rule := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_descriptor := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exception_ := ( + Some ( + ( + read_exception_ + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_notification_level + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 5 -> + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' then ( + 3 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'e' then ( + 5 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'U' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'c' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'p' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'r' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'd' && String.unsafe_get s (pos+10) = 'R' && String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'l' && String.unsafe_get s (pos+13) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_associated_rule := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_descriptor := ( + Some ( + ( + read_reporting_descriptor_reference + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exception_ := ( + Some ( + ( + read_exception_ + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_level := ( + Some ( + ( + read_notification_level + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_locations := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + ) + | 5 -> + field_message := ( + Some ( + ( + read_message + ) p lb + ) + ); + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + associated_rule = !field_associated_rule; + descriptor = !field_descriptor; + exception_ = !field_exception_; + level = !field_level; + locations = !field_locations; + message = (match !field_message with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "message"); + properties = !field_properties; + thread_id = !field_thread_id; + time_utc = !field_time_utc; + } + : notification) + ) +) let notification_of_string s = read_notification (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__notification_list = Atdgen_runtime.Oj_run.write_list write_notification - +let write__notification_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_notification + ) +) let string_of__notification_list ?(len = 1024) x = let ob = Buffer.create len in write__notification_list ob x; Buffer.contents ob -;; - -let read__notification_list = Atdgen_runtime.Oj_run.read_list read_notification - +let read__notification_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_notification + ) +) let _notification_list_of_string s = read__notification_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__notification_list_option = - Atdgen_runtime.Oj_run.write_std_option write__notification_list -;; - +let write__notification_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__notification_list + ) +) let string_of__notification_list_option ?(len = 1024) x = let ob = Buffer.create len in write__notification_list_option ob x; Buffer.contents ob -;; - -let read__notification_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__notification_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__notification_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__notification_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__notification_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__notification_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _notification_list_option_of_string s = read__notification_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_invocation : _ -> invocation -> _ = +let write_invocation : _ -> invocation -> _ = ( fun ob (x : invocation) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.account with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"account\":"; - Yojson.Safe.write_string ob x); - (match x.arguments with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"arguments\":"; - Yojson.Safe.write_string ob x); - (match x.command_line with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"commandLine\":"; - Yojson.Safe.write_string ob x); - (match x.end_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"endTimeUtc\":"; - Yojson.Safe.write_string ob x); - (match x.environment_variables with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"environmentVariables\":"; - write_hm_str_str ob x); - (match x.executable_location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"executableLocation\":"; - write_artifact_location ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"executionSuccessful\":"; - Yojson.Safe.write_bool ob x.execution_successful; - (match x.exit_code with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"exitCode\":"; - write_int64 ob x); - (match x.exit_code_description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"exitCodeDescription\":"; - Yojson.Safe.write_string ob x); - (match x.exit_signal_name with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"exitSignalName\":"; - Yojson.Safe.write_string ob x); - (match x.exit_signal_number with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"exitSignalNumber\":"; - write_int64 ob x); - (match x.notification_configuration_overrides with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"notificationConfigurationOverrides\":"; - write__configuration_override_list ob x); - (match x.process_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"processId\":"; - write_int64 ob x); - (match x.process_start_failure_message with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"processStartFailureMessage\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.response_files with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"responseFiles\":"; - write__artifact_location_list ob x); - (match x.rule_configuration_overrides with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"ruleConfigurationOverrides\":"; - write__configuration_override_list ob x); - (match x.start_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"startTimeUtc\":"; - Yojson.Safe.write_string ob x); - (match x.stderr with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stderr\":"; - write_artifact_location ob x); - (match x.stdin with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stdin\":"; - write_artifact_location ob x); - (match x.stdout with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stdout\":"; - write_artifact_location ob x); - (match x.stdout_stderr with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"stdoutStderr\":"; - write_artifact_location ob x); - (match x.tool_configuration_notifications with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"toolConfigurationNotifications\":"; - write__notification_list ob x); - (match x.tool_execution_notifications with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"toolExecutionNotifications\":"; - write__notification_list ob x); - (match x.working_directory with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"workingDirectory\":"; - write_artifact_location ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.account with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"account\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.arguments with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"arguments\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.command_line with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"commandLine\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.end_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"endTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.environment_variables with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"environmentVariables\":"; + ( + write_hm_str_str + ) + ob x; + ); + (match x.executable_location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"executableLocation\":"; + ( + write_artifact_location + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"executionSuccessful\":"; + ( + Yojson.Safe.write_bool + ) + ob x.execution_successful; + (match x.exit_code with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"exitCode\":"; + ( + write_int64 + ) + ob x; + ); + (match x.exit_code_description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"exitCodeDescription\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.exit_signal_name with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"exitSignalName\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.exit_signal_number with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"exitSignalNumber\":"; + ( + write_int64 + ) + ob x; + ); + (match x.notification_configuration_overrides with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"notificationConfigurationOverrides\":"; + ( + write__configuration_override_list + ) + ob x; + ); + (match x.process_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"processId\":"; + ( + write_int64 + ) + ob x; + ); + (match x.process_start_failure_message with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"processStartFailureMessage\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.response_files with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"responseFiles\":"; + ( + write__artifact_location_list + ) + ob x; + ); + (match x.rule_configuration_overrides with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"ruleConfigurationOverrides\":"; + ( + write__configuration_override_list + ) + ob x; + ); + (match x.start_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"startTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.stderr with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stderr\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.stdin with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stdin\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.stdout with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stdout\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.stdout_stderr with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"stdoutStderr\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.tool_configuration_notifications with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"toolConfigurationNotifications\":"; + ( + write__notification_list + ) + ob x; + ); + (match x.tool_execution_notifications with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"toolExecutionNotifications\":"; + ( + write__notification_list + ) + ob x; + ); + (match x.working_directory with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"workingDirectory\":"; + ( + write_artifact_location + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_invocation ?(len = 1024) x = let ob = Buffer.create len in write_invocation ob x; Buffer.contents ob -;; - -let read_invocation p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_account = ref None in - let field_arguments = ref None in - let field_command_line = ref None in - let field_end_time_utc = ref None in - let field_environment_variables = ref None in - let field_executable_location = ref None in - let field_execution_successful = ref None in - let field_exit_code = ref None in - let field_exit_code_description = ref None in - let field_exit_signal_name = ref None in - let field_exit_signal_number = ref None in - let field_notification_configuration_overrides = ref None in - let field_process_id = ref None in - let field_process_start_failure_message = ref None in - let field_properties = ref None in - let field_response_files = ref None in - let field_rule_configuration_overrides = ref None in - let field_start_time_utc = ref None in - let field_stderr = ref None in - let field_stdin = ref None in - let field_stdout = ref None in - let field_stdout_stderr = ref None in - let field_tool_configuration_notifications = ref None in - let field_tool_execution_notifications = ref None in - let field_working_directory = ref None in - try +let read_invocation = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'n' - then 19 - else -1 - | 6 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'd' - then ( - match String.unsafe_get s (pos + 3) with - | 'e' -> - if String.unsafe_get s (pos + 4) = 'r' && String.unsafe_get s (pos + 5) = 'r' - then 18 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 4) = 'u' && String.unsafe_get s (pos + 5) = 't' - then 20 - else -1 - | _ -> -1) - else -1 - | 7 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - then 7 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'I' - && String.unsafe_get s (pos + 8) = 'd' - then 12 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'T' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'U' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'c' - then 3 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 14 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'e' - then 2 - else -1 - | 12 -> - if String.unsafe_get s pos = 's' && String.unsafe_get s (pos + 1) = 't' - then ( - match String.unsafe_get s (pos + 2) with - | 'a' -> - if String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'T' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'U' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'c' - then 17 - else -1 - | 'd' -> - if String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'S' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'r' - then 21 - else -1 - | _ -> -1) - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'F' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'l' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 's' - then 15 - else -1 - | 14 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'S' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'l' - && String.unsafe_get s (pos + 10) = 'N' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'e' - then 9 - else -1 - | 16 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'S' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'l' - && String.unsafe_get s (pos + 10) = 'N' - && String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'b' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'r' - then 10 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'D' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'y' - then 24 - else -1 - | _ -> -1) - | 18 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'b' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - then 5 - else -1 - | 19 -> - if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos + 1) = 'x' - then ( - match String.unsafe_get s (pos + 2) with - | 'e' -> - if String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - && String.unsafe_get s (pos + 15) = 's' - && String.unsafe_get s (pos + 16) = 'f' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'l' - then 6 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'D' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'p' - && String.unsafe_get s (pos + 15) = 't' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'o' - && String.unsafe_get s (pos + 18) = 'n' - then 8 - else -1 - | _ -> -1) - else -1 - | 20 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'V' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'b' - && String.unsafe_get s (pos + 17) = 'l' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 's' - then 4 - else -1 - | 26 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'F' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'l' - && String.unsafe_get s (pos + 16) = 'u' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'M' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - && String.unsafe_get s (pos + 22) = 's' - && String.unsafe_get s (pos + 23) = 'a' - && String.unsafe_get s (pos + 24) = 'g' - && String.unsafe_get s (pos + 25) = 'e' - then 13 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'f' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'o' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'O' - && String.unsafe_get s (pos + 18) = 'v' - && String.unsafe_get s (pos + 19) = 'e' - && String.unsafe_get s (pos + 20) = 'r' - && String.unsafe_get s (pos + 21) = 'r' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'd' - && String.unsafe_get s (pos + 24) = 'e' - && String.unsafe_get s (pos + 25) = 's' - then 16 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'E' - && String.unsafe_get s (pos + 5) = 'x' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'N' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 't' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'f' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'c' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 't' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'o' - && String.unsafe_get s (pos + 24) = 'n' - && String.unsafe_get s (pos + 25) = 's' - then 23 - else -1 - | _ -> -1) - | 30 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'f' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'o' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'N' - && String.unsafe_get s (pos + 18) = 'o' - && String.unsafe_get s (pos + 19) = 't' - && String.unsafe_get s (pos + 20) = 'i' - && String.unsafe_get s (pos + 21) = 'f' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'c' - && String.unsafe_get s (pos + 24) = 'a' - && String.unsafe_get s (pos + 25) = 't' - && String.unsafe_get s (pos + 26) = 'i' - && String.unsafe_get s (pos + 27) = 'o' - && String.unsafe_get s (pos + 28) = 'n' - && String.unsafe_get s (pos + 29) = 's' - then 22 - else -1 - | 34 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'C' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 'f' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'g' - && String.unsafe_get s (pos + 18) = 'u' - && String.unsafe_get s (pos + 19) = 'r' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 't' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'o' - && String.unsafe_get s (pos + 24) = 'n' - && String.unsafe_get s (pos + 25) = 'O' - && String.unsafe_get s (pos + 26) = 'v' - && String.unsafe_get s (pos + 27) = 'e' - && String.unsafe_get s (pos + 28) = 'r' - && String.unsafe_get s (pos + 29) = 'r' - && String.unsafe_get s (pos + 30) = 'i' - && String.unsafe_get s (pos + 31) = 'd' - && String.unsafe_get s (pos + 32) = 'e' - && String.unsafe_get s (pos + 33) = 's' - then 11 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_account := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_arguments := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_command_line := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_environment_variables := Some (read_hm_str_str p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_executable_location := Some (read_artifact_location p lb) - | 6 -> field_execution_successful := Some (Atdgen_runtime.Oj_run.read_bool p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_code := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_code_description := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_signal_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_signal_number := Some (read_int64 p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_notification_configuration_overrides - := Some (read__configuration_override_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_process_id := Some (read_int64 p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_process_start_failure_message - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_response_files := Some (read__artifact_location_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_rule_configuration_overrides - := Some (read__configuration_override_list p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stderr := Some (read_artifact_location p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdin := Some (read_artifact_location p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdout := Some (read_artifact_location p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdout_stderr := Some (read_artifact_location p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_configuration_notifications := Some (read__notification_list p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_execution_notifications := Some (read__notification_list p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_working_directory := Some (read_artifact_location p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_account = ref (None) in + let field_arguments = ref (None) in + let field_command_line = ref (None) in + let field_end_time_utc = ref (None) in + let field_environment_variables = ref (None) in + let field_executable_location = ref (None) in + let field_execution_successful = ref (None) in + let field_exit_code = ref (None) in + let field_exit_code_description = ref (None) in + let field_exit_signal_name = ref (None) in + let field_exit_signal_number = ref (None) in + let field_notification_configuration_overrides = ref (None) in + let field_process_id = ref (None) in + let field_process_start_failure_message = ref (None) in + let field_properties = ref (None) in + let field_response_files = ref (None) in + let field_rule_configuration_overrides = ref (None) in + let field_start_time_utc = ref (None) in + let field_stderr = ref (None) in + let field_stdin = ref (None) in + let field_stdout = ref (None) in + let field_stdout_stderr = ref (None) in + let field_tool_configuration_notifications = ref (None) in + let field_tool_execution_notifications = ref (None) in + let field_working_directory = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'n' - then 19 - else -1 - | 6 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'd' - then ( - match String.unsafe_get s (pos + 3) with - | 'e' -> - if String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'r' - then 18 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - then 20 - else -1 - | _ -> -1) - else -1 - | 7 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - then 7 - else -1 - | 9 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'I' - && String.unsafe_get s (pos + 8) = 'd' - then 12 - else -1 - | _ -> -1) - | 10 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'T' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'U' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'c' - then 3 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 14 - else -1 - | _ -> -1) - | 11 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'e' - then 2 - else -1 - | 12 -> - if String.unsafe_get s pos = 's' && String.unsafe_get s (pos + 1) = 't' - then ( - match String.unsafe_get s (pos + 2) with - | 'a' -> - if String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'T' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'U' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'c' - then 17 - else -1 - | 'd' -> - if String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'S' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'r' - then 21 - else -1 - | _ -> -1) - else -1 - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'o' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'F' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'l' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 's' - then 15 - else -1 - | 14 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'S' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'l' - && String.unsafe_get s (pos + 10) = 'N' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'e' - then 9 - else -1 - | 16 -> - (match String.unsafe_get s pos with - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'S' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 'l' - && String.unsafe_get s (pos + 10) = 'N' - && String.unsafe_get s (pos + 11) = 'u' - && String.unsafe_get s (pos + 12) = 'm' - && String.unsafe_get s (pos + 13) = 'b' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'r' - then 10 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'k' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'D' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'r' - && String.unsafe_get s (pos + 15) = 'y' - then 24 - else -1 - | _ -> -1) - | 18 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'b' - && String.unsafe_get s (pos + 8) = 'l' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - then 5 - else -1 - | 19 -> - if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos + 1) = 'x' - then ( - match String.unsafe_get s (pos + 2) with - | 'e' -> - if String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'S' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'e' - && String.unsafe_get s (pos + 14) = 's' - && String.unsafe_get s (pos + 15) = 's' - && String.unsafe_get s (pos + 16) = 'f' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'l' - then 6 - else -1 - | 'i' -> - if String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'D' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 's' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'r' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'p' - && String.unsafe_get s (pos + 15) = 't' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'o' - && String.unsafe_get s (pos + 18) = 'n' - then 8 - else -1 - | _ -> -1) - else -1 - | 20 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'm' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'V' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'a' - && String.unsafe_get s (pos + 16) = 'b' - && String.unsafe_get s (pos + 17) = 'l' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 's' - then 4 - else -1 - | 26 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'F' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'l' - && String.unsafe_get s (pos + 16) = 'u' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'M' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - && String.unsafe_get s (pos + 22) = 's' - && String.unsafe_get s (pos + 23) = 'a' - && String.unsafe_get s (pos + 24) = 'g' - && String.unsafe_get s (pos + 25) = 'e' - then 13 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'f' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'o' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'O' - && String.unsafe_get s (pos + 18) = 'v' - && String.unsafe_get s (pos + 19) = 'e' - && String.unsafe_get s (pos + 20) = 'r' - && String.unsafe_get s (pos + 21) = 'r' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'd' - && String.unsafe_get s (pos + 24) = 'e' - && String.unsafe_get s (pos + 25) = 's' - then 16 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'E' - && String.unsafe_get s (pos + 5) = 'x' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'c' - && String.unsafe_get s (pos + 8) = 'u' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'N' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 't' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'f' - && String.unsafe_get s (pos + 18) = 'i' - && String.unsafe_get s (pos + 19) = 'c' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 't' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'o' - && String.unsafe_get s (pos + 24) = 'n' - && String.unsafe_get s (pos + 25) = 's' - then 23 - else -1 - | _ -> -1) - | 30 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'f' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 't' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'o' - && String.unsafe_get s (pos + 16) = 'n' - && String.unsafe_get s (pos + 17) = 'N' - && String.unsafe_get s (pos + 18) = 'o' - && String.unsafe_get s (pos + 19) = 't' - && String.unsafe_get s (pos + 20) = 'i' - && String.unsafe_get s (pos + 21) = 'f' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'c' - && String.unsafe_get s (pos + 24) = 'a' - && String.unsafe_get s (pos + 25) = 't' - && String.unsafe_get s (pos + 26) = 'i' - && String.unsafe_get s (pos + 27) = 'o' - && String.unsafe_get s (pos + 28) = 'n' - && String.unsafe_get s (pos + 29) = 's' - then 22 - else -1 - | 34 -> - if String.unsafe_get s pos = 'n' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'C' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 'f' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'g' - && String.unsafe_get s (pos + 18) = 'u' - && String.unsafe_get s (pos + 19) = 'r' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 't' - && String.unsafe_get s (pos + 22) = 'i' - && String.unsafe_get s (pos + 23) = 'o' - && String.unsafe_get s (pos + 24) = 'n' - && String.unsafe_get s (pos + 25) = 'O' - && String.unsafe_get s (pos + 26) = 'v' - && String.unsafe_get s (pos + 27) = 'e' - && String.unsafe_get s (pos + 28) = 'r' - && String.unsafe_get s (pos + 29) = 'r' - && String.unsafe_get s (pos + 30) = 'i' - && String.unsafe_get s (pos + 31) = 'd' - && String.unsafe_get s (pos + 32) = 'e' - && String.unsafe_get s (pos + 33) = 's' - then 11 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' then ( + 19 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'd' then ( + match String.unsafe_get s (pos+3) with + | 'e' -> ( + if String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'r' then ( + 18 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'I' && String.unsafe_get s (pos+8) = 'd' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'T' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'U' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'c' then ( + 3 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' then ( + match String.unsafe_get s (pos+2) with + | 'a' -> ( + if String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'T' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'U' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'c' then ( + 17 + ) + else ( + -1 + ) + ) + | 'd' -> ( + if String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'S' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'r' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'F' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'S' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'N' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'S' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'N' && String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'r' then ( + 10 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'D' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'y' then ( + 24 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'b' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' then ( + match String.unsafe_get s (pos+2) with + | 'e' -> ( + if String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'l' then ( + 6 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'D' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'p' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'V' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'b' && String.unsafe_get s (pos+17) = 'l' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 26 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'F' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'u' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'M' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'a' && String.unsafe_get s (pos+24) = 'g' && String.unsafe_get s (pos+25) = 'e' then ( + 13 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'f' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'o' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'O' && String.unsafe_get s (pos+18) = 'v' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'd' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'E' && String.unsafe_get s (pos+5) = 'x' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'N' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'f' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'c' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'o' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 's' then ( + 23 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 30 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'f' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'o' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'N' && String.unsafe_get s (pos+18) = 'o' && String.unsafe_get s (pos+19) = 't' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'f' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 't' && String.unsafe_get s (pos+26) = 'i' && String.unsafe_get s (pos+27) = 'o' && String.unsafe_get s (pos+28) = 'n' && String.unsafe_get s (pos+29) = 's' then ( + 22 + ) + else ( + -1 + ) + ) + | 34 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'C' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'f' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'r' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'o' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'O' && String.unsafe_get s (pos+26) = 'v' && String.unsafe_get s (pos+27) = 'e' && String.unsafe_get s (pos+28) = 'r' && String.unsafe_get s (pos+29) = 'r' && String.unsafe_get s (pos+30) = 'i' && String.unsafe_get s (pos+31) = 'd' && String.unsafe_get s (pos+32) = 'e' && String.unsafe_get s (pos+33) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_account := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_arguments := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_command_line := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_end_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_environment_variables := Some (read_hm_str_str p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_executable_location := Some (read_artifact_location p lb) - | 6 -> field_execution_successful := Some (Atdgen_runtime.Oj_run.read_bool p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_code := Some (read_int64 p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_code_description := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_signal_name := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_exit_signal_number := Some (read_int64 p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_notification_configuration_overrides - := Some (read__configuration_override_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_process_id := Some (read_int64 p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_process_start_failure_message - := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_response_files := Some (read__artifact_location_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_rule_configuration_overrides - := Some (read__configuration_override_list p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_start_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stderr := Some (read_artifact_location p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdin := Some (read_artifact_location p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdout := Some (read_artifact_location p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_stdout_stderr := Some (read_artifact_location p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_configuration_notifications := Some (read__notification_list p lb) - | 23 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_tool_execution_notifications := Some (read__notification_list p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_working_directory := Some (read_artifact_location p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ account = !field_account - ; arguments = !field_arguments - ; command_line = !field_command_line - ; end_time_utc = !field_end_time_utc - ; environment_variables = !field_environment_variables - ; executable_location = !field_executable_location - ; execution_successful = - (match !field_execution_successful with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "execution_successful") - ; exit_code = !field_exit_code - ; exit_code_description = !field_exit_code_description - ; exit_signal_name = !field_exit_signal_name - ; exit_signal_number = !field_exit_signal_number - ; notification_configuration_overrides = !field_notification_configuration_overrides - ; process_id = !field_process_id - ; process_start_failure_message = !field_process_start_failure_message - ; properties = !field_properties - ; response_files = !field_response_files - ; rule_configuration_overrides = !field_rule_configuration_overrides - ; start_time_utc = !field_start_time_utc - ; stderr = !field_stderr - ; stdin = !field_stdin - ; stdout = !field_stdout - ; stdout_stderr = !field_stdout_stderr - ; tool_configuration_notifications = !field_tool_configuration_notifications - ; tool_execution_notifications = !field_tool_execution_notifications - ; working_directory = !field_working_directory - } - : invocation) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_account := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_arguments := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_command_line := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_environment_variables := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_executable_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 6 -> + field_execution_successful := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ) + ); + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_code := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_code_description := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_signal_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_signal_number := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_notification_configuration_overrides := ( + Some ( + ( + read__configuration_override_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_process_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_process_start_failure_message := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_response_files := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_configuration_overrides := ( + Some ( + ( + read__configuration_override_list + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stderr := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdin := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdout := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdout_stderr := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_configuration_notifications := ( + Some ( + ( + read__notification_list + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_execution_notifications := ( + Some ( + ( + read__notification_list + ) p lb + ) + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_working_directory := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' then ( + 19 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'd' then ( + match String.unsafe_get s (pos+3) with + | 'e' -> ( + if String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'r' then ( + 18 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | 9 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'I' && String.unsafe_get s (pos+8) = 'd' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'T' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'U' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'c' then ( + 3 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'e' then ( + 2 + ) + else ( + -1 + ) + ) + | 12 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 't' then ( + match String.unsafe_get s (pos+2) with + | 'a' -> ( + if String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'T' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'U' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'c' then ( + 17 + ) + else ( + -1 + ) + ) + | 'd' -> ( + if String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'S' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'r' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'F' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'S' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'N' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'e' then ( + 9 + ) + else ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'S' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 'l' && String.unsafe_get s (pos+10) = 'N' && String.unsafe_get s (pos+11) = 'u' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'r' then ( + 10 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'k' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'D' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'r' && String.unsafe_get s (pos+15) = 'y' then ( + 24 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'b' && String.unsafe_get s (pos+8) = 'l' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' then ( + match String.unsafe_get s (pos+2) with + | 'e' -> ( + if String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'S' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'e' && String.unsafe_get s (pos+14) = 's' && String.unsafe_get s (pos+15) = 's' && String.unsafe_get s (pos+16) = 'f' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'l' then ( + 6 + ) + else ( + -1 + ) + ) + | 'i' -> ( + if String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'D' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'r' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'p' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'o' && String.unsafe_get s (pos+18) = 'n' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'm' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'V' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'a' && String.unsafe_get s (pos+16) = 'b' && String.unsafe_get s (pos+17) = 'l' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 26 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'F' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 'u' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'M' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'a' && String.unsafe_get s (pos+24) = 'g' && String.unsafe_get s (pos+25) = 'e' then ( + 13 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'f' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'o' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'O' && String.unsafe_get s (pos+18) = 'v' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 'r' && String.unsafe_get s (pos+21) = 'r' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'd' && String.unsafe_get s (pos+24) = 'e' && String.unsafe_get s (pos+25) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'E' && String.unsafe_get s (pos+5) = 'x' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'c' && String.unsafe_get s (pos+8) = 'u' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'N' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 't' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'f' && String.unsafe_get s (pos+18) = 'i' && String.unsafe_get s (pos+19) = 'c' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'o' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 's' then ( + 23 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 30 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'f' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'o' && String.unsafe_get s (pos+16) = 'n' && String.unsafe_get s (pos+17) = 'N' && String.unsafe_get s (pos+18) = 'o' && String.unsafe_get s (pos+19) = 't' && String.unsafe_get s (pos+20) = 'i' && String.unsafe_get s (pos+21) = 'f' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'c' && String.unsafe_get s (pos+24) = 'a' && String.unsafe_get s (pos+25) = 't' && String.unsafe_get s (pos+26) = 'i' && String.unsafe_get s (pos+27) = 'o' && String.unsafe_get s (pos+28) = 'n' && String.unsafe_get s (pos+29) = 's' then ( + 22 + ) + else ( + -1 + ) + ) + | 34 -> ( + if String.unsafe_get s pos = 'n' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'C' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 'f' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'g' && String.unsafe_get s (pos+18) = 'u' && String.unsafe_get s (pos+19) = 'r' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 't' && String.unsafe_get s (pos+22) = 'i' && String.unsafe_get s (pos+23) = 'o' && String.unsafe_get s (pos+24) = 'n' && String.unsafe_get s (pos+25) = 'O' && String.unsafe_get s (pos+26) = 'v' && String.unsafe_get s (pos+27) = 'e' && String.unsafe_get s (pos+28) = 'r' && String.unsafe_get s (pos+29) = 'r' && String.unsafe_get s (pos+30) = 'i' && String.unsafe_get s (pos+31) = 'd' && String.unsafe_get s (pos+32) = 'e' && String.unsafe_get s (pos+33) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_account := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_arguments := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_command_line := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_end_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_environment_variables := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_executable_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 6 -> + field_execution_successful := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_bool + ) p lb + ) + ); + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_code := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_code_description := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_signal_name := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_exit_signal_number := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_notification_configuration_overrides := ( + Some ( + ( + read__configuration_override_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_process_id := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_process_start_failure_message := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_response_files := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_rule_configuration_overrides := ( + Some ( + ( + read__configuration_override_list + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_start_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stderr := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdin := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdout := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_stdout_stderr := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_configuration_notifications := ( + Some ( + ( + read__notification_list + ) p lb + ) + ); + ) + | 23 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_tool_execution_notifications := ( + Some ( + ( + read__notification_list + ) p lb + ) + ); + ) + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_working_directory := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + account = !field_account; + arguments = !field_arguments; + command_line = !field_command_line; + end_time_utc = !field_end_time_utc; + environment_variables = !field_environment_variables; + executable_location = !field_executable_location; + execution_successful = (match !field_execution_successful with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "execution_successful"); + exit_code = !field_exit_code; + exit_code_description = !field_exit_code_description; + exit_signal_name = !field_exit_signal_name; + exit_signal_number = !field_exit_signal_number; + notification_configuration_overrides = !field_notification_configuration_overrides; + process_id = !field_process_id; + process_start_failure_message = !field_process_start_failure_message; + properties = !field_properties; + response_files = !field_response_files; + rule_configuration_overrides = !field_rule_configuration_overrides; + start_time_utc = !field_start_time_utc; + stderr = !field_stderr; + stdin = !field_stdin; + stdout = !field_stdout; + stdout_stderr = !field_stdout_stderr; + tool_configuration_notifications = !field_tool_configuration_notifications; + tool_execution_notifications = !field_tool_execution_notifications; + working_directory = !field_working_directory; + } + : invocation) + ) +) let invocation_of_string s = read_invocation (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__invocation_option = Atdgen_runtime.Oj_run.write_std_option write_invocation - +let write__invocation_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_invocation + ) +) let string_of__invocation_option ?(len = 1024) x = let ob = Buffer.create len in write__invocation_option ob x; Buffer.contents ob -;; - -let read__invocation_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_invocation p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_invocation p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__invocation_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_invocation + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_invocation + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _invocation_option_of_string s = read__invocation_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_conversion : _ -> conversion -> _ = +let write_conversion : _ -> conversion -> _ = ( fun ob (x : conversion) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.analysis_tool_log_files with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"analysisToolLogFiles\":"; - write__artifact_location_list ob x); - (match x.invocation with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"invocation\":"; - write_invocation ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"tool\":"; - write_tool ob x.tool; - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.analysis_tool_log_files with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"analysisToolLogFiles\":"; + ( + write__artifact_location_list + ) + ob x; + ); + (match x.invocation with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"invocation\":"; + ( + write_invocation + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"tool\":"; + ( + write_tool + ) + ob x.tool; + Buffer.add_char ob '}'; +) let string_of_conversion ?(len = 1024) x = let ob = Buffer.create len in write_conversion ob x; Buffer.contents ob -;; - -let read_conversion p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_analysis_tool_log_files = ref None in - let field_invocation = ref None in - let field_properties = ref None in - let field_tool = ref None in - try +let read_conversion = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - then 3 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | 20 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'l' - && String.unsafe_get s (pos + 12) = 'L' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'g' - && String.unsafe_get s (pos + 15) = 'F' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'l' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 's' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_analysis_tool_log_files := Some (read__artifact_location_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocation := Some (read_invocation p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_tool := Some (read_tool p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_analysis_tool_log_files = ref (None) in + let field_invocation = ref (None) in + let field_properties = ref (None) in + let field_tool = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - then 3 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | _ -> -1) - | 20 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'y' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 's' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'l' - && String.unsafe_get s (pos + 12) = 'L' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'g' - && String.unsafe_get s (pos + 15) = 'F' - && String.unsafe_get s (pos + 16) = 'i' - && String.unsafe_get s (pos + 17) = 'l' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 's' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'l' && String.unsafe_get s (pos+12) = 'L' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'g' && String.unsafe_get s (pos+15) = 'F' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'l' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_analysis_tool_log_files := Some (read__artifact_location_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocation := Some (read_invocation p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_tool := Some (read_tool p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ analysis_tool_log_files = !field_analysis_tool_log_files - ; invocation = !field_invocation - ; properties = !field_properties - ; tool = - (match !field_tool with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "tool") - } - : conversion) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_analysis_tool_log_files := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocation := ( + Some ( + ( + read_invocation + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_tool := ( + Some ( + ( + read_tool + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' then ( + 3 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 20 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'y' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 's' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'l' && String.unsafe_get s (pos+12) = 'L' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'g' && String.unsafe_get s (pos+15) = 'F' && String.unsafe_get s (pos+16) = 'i' && String.unsafe_get s (pos+17) = 'l' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_analysis_tool_log_files := ( + Some ( + ( + read__artifact_location_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocation := ( + Some ( + ( + read_invocation + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_tool := ( + Some ( + ( + read_tool + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + analysis_tool_log_files = !field_analysis_tool_log_files; + invocation = !field_invocation; + properties = !field_properties; + tool = (match !field_tool with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "tool"); + } + : conversion) + ) +) let conversion_of_string s = read_conversion (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_option = Atdgen_runtime.Oj_run.write_std_option write_result - +let write__result_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_result + ) +) let string_of__result_option ?(len = 1024) x = let ob = Buffer.create len in write__result_option ob x; Buffer.contents ob -;; - -let read__result_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_result p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_result p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_result + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_result + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_option_of_string s = read__result_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__conversion_option = Atdgen_runtime.Oj_run.write_std_option write_conversion - +let write__conversion_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_conversion + ) +) let string_of__conversion_option ?(len = 1024) x = let ob = Buffer.create len in write__conversion_option ob x; Buffer.contents ob -;; - -let read__conversion_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_conversion p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_conversion p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__conversion_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_conversion + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_conversion + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _conversion_option_of_string s = read__conversion_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let rec write__artifact_list ob x = (Atdgen_runtime.Oj_run.write_list write_artifact) ob x - +let rec write__artifact_list ob x = ( + Atdgen_runtime.Oj_run.write_list ( + write_artifact + ) +) ob x and string_of__artifact_list ?(len = 1024) x = let ob = Buffer.create len in write__artifact_list ob x; Buffer.contents ob - -and write__artifact_list_option ob x = - (Atdgen_runtime.Oj_run.write_std_option write__artifact_list) ob x - +and write__artifact_list_option ob x = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__artifact_list + ) +) ob x and string_of__artifact_list_option ?(len = 1024) x = let ob = Buffer.create len in write__artifact_list_option ob x; Buffer.contents ob - -and write__external_properties_option ob x = - (Atdgen_runtime.Oj_run.write_std_option write_external_properties) ob x - +and write__external_properties_option ob x = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_properties + ) +) ob x and string_of__external_properties_option ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_option ob x; Buffer.contents ob - -and write_artifact : _ -> artifact -> _ = +and write_artifact : _ -> artifact -> _ = ( fun ob (x : artifact) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.contents with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"contents\":"; - write_artifact_content ob x); - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.encoding with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"encoding\":"; - Yojson.Safe.write_string ob x); - (match x.hashes with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"hashes\":"; - write_hm_str_str ob x); - (match x.last_modified_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"lastModifiedTimeUtc\":"; - Yojson.Safe.write_string ob x); - if x.length <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"length\":"; - write_int64 ob x.length); - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_artifact_location ob x); - (match x.mime_type with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"mimeType\":"; - write_artifact_mimetype ob x); - (match x.offset with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"offset\":"; - write_int64 ob x); - if x.parent_index <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"parentIndex\":"; - write_int64 ob x.parent_index); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_external_properties ob x); - (match x.roles with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"roles\":"; - write__artifact_roles_item_list ob x); - (match x.source_language with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"sourceLanguage\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.contents with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"contents\":"; + ( + write_artifact_content + ) + ob x; + ); + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.encoding with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"encoding\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.hashes with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"hashes\":"; + ( + write_hm_str_str + ) + ob x; + ); + (match x.last_modified_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"lastModifiedTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + if x.length <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"length\":"; + ( + write_int64 + ) + ob x.length; + ); + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.mime_type with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"mimeType\":"; + ( + write_artifact_mimetype + ) + ob x; + ); + (match x.offset with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"offset\":"; + ( + write_int64 + ) + ob x; + ); + if x.parent_index <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"parentIndex\":"; + ( + write_int64 + ) + ob x.parent_index; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_external_properties + ) + ob x; + ); + (match x.roles with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"roles\":"; + ( + write__artifact_roles_item_list + ) + ob x; + ); + (match x.source_language with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"sourceLanguage\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) and string_of_artifact ?(len = 1024) x = let ob = Buffer.create len in write_artifact ob x; Buffer.contents ob - -and write_external_properties : _ -> external_properties -> _ = +and write_external_properties : _ -> external_properties -> _ = ( fun ob (x : external_properties) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.addresses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"addresses\":"; - write__address_list ob x); - (match x.artifacts with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifacts\":"; - write__artifact_list ob x); - (match x.conversion with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"conversion\":"; - write_conversion ob x); - (match x.driver with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"driver\":"; - write_tool_component ob x); - (match x.extensions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"extensions\":"; - write__tool_component_list ob x); - (match x.externalized_properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"externalizedProperties\":"; - write_property_bag ob x); - (match x.graph with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"graph\":"; - write__graph_list ob x); - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_external_properties_guid ob x); - (match x.invocations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"invocations\":"; - write_invocation ob x); - (match x.logical_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"logicalLocations\":"; - write__logical_location_list ob x); - (match x.policies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"policies\":"; - write__tool_component_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.results with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"results\":"; - write_result ob x); - (match x.run_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"runGuid\":"; - write_external_properties_run_guid ob x); - (match x.schema with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"schema\":"; - Yojson.Safe.write_string ob x); - (match x.taxonomies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxonomies\":"; - write__tool_component_list ob x); - (match x.thread_flow_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadFlowLocations\":"; - write__thread_flow_location_list ob x); - (match x.translations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"translations\":"; - write__tool_component_list ob x); - (match x.version with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"version\":"; - write_external_properties_version ob x); - (match x.web_requests with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webRequests\":"; - write__web_request_list ob x); - (match x.web_responses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webResponses\":"; - write__web_response_list ob x); - Buffer.add_char ob '}' - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.addresses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"addresses\":"; + ( + write__address_list + ) + ob x; + ); + (match x.artifacts with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifacts\":"; + ( + write__artifact_list + ) + ob x; + ); + (match x.conversion with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"conversion\":"; + ( + write_conversion + ) + ob x; + ); + (match x.driver with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"driver\":"; + ( + write_tool_component + ) + ob x; + ); + (match x.extensions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"extensions\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.externalized_properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"externalizedProperties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.graph with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"graph\":"; + ( + write__graph_list + ) + ob x; + ); + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_external_properties_guid + ) + ob x; + ); + (match x.invocations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"invocations\":"; + ( + write_invocation + ) + ob x; + ); + (match x.logical_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"logicalLocations\":"; + ( + write__logical_location_list + ) + ob x; + ); + (match x.policies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"policies\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.results with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"results\":"; + ( + write_result + ) + ob x; + ); + (match x.run_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"runGuid\":"; + ( + write_external_properties_run_guid + ) + ob x; + ); + (match x.schema with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"schema\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.taxonomies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxonomies\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.thread_flow_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadFlowLocations\":"; + ( + write__thread_flow_location_list + ) + ob x; + ); + (match x.translations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"translations\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.version with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"version\":"; + ( + write_external_properties_version + ) + ob x; + ); + (match x.web_requests with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webRequests\":"; + ( + write__web_request_list + ) + ob x; + ); + (match x.web_responses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webResponses\":"; + ( + write__web_response_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) and string_of_external_properties ?(len = 1024) x = let ob = Buffer.create len in write_external_properties ob x; Buffer.contents ob -;; - -let rec read__artifact_list p lb = (Atdgen_runtime.Oj_run.read_list read_artifact) p lb - +let rec read__artifact_list p lb = ( + Atdgen_runtime.Oj_run.read_list ( + read_artifact + ) +) p lb and _artifact_list_of_string s = read__artifact_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read__artifact_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__artifact_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__artifact_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - +and read__artifact_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__artifact_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__artifact_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) and _artifact_list_option_of_string s = read__artifact_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read__external_properties_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_properties p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_properties p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - +and read__external_properties_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_properties + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_properties + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) and _external_properties_option_of_string s = read__external_properties_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read_artifact p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_contents = ref None in - let field_description = ref None in - let field_encoding = ref None in - let field_hashes = ref None in - let field_last_modified_time_utc = ref None in - let field_length = ref (-1L) in - let field_location = ref None in - let field_mime_type = ref None in - let field_offset = ref None in - let field_parent_index = ref (-1L) in - let field_properties = ref None in - let field_roles = ref None in - let field_source_language = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +and read_artifact = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 11 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - then 3 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'h' - then 5 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 1) = 'f' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 8 - else -1 - | _ -> -1) - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 's' - then 0 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - then 2 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 6 - else -1 - | 'm' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'y' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'e' - then 7 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 10 - else -1 - | 11 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 9 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'L' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - then 12 - else -1 - | 19 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'M' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'f' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'T' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'm' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 'U' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 'c' - then 4 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_contents := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_encoding := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_hashes := Some (read_hm_str_str p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_last_modified_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_length := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_artifact_location p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_mime_type := Some (read_artifact_mimetype p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_offset := Some (read_int64 p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_external_properties p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_roles := Some (read__artifact_roles_item_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_contents = ref (None) in + let field_description = ref (None) in + let field_encoding = ref (None) in + let field_hashes = ref (None) in + let field_last_modified_time_utc = ref (None) in + let field_length = ref (-1L) in + let field_location = ref (None) in + let field_mime_type = ref (None) in + let field_offset = ref (None) in + let field_parent_index = ref (-1L) in + let field_properties = ref (None) in + let field_roles = ref (None) in + let field_source_language = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 5 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 's' - then 11 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'h' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - then 3 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'h' - then 5 - else -1 - | 'o' -> - if String.unsafe_get s (pos + 1) = 'f' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 't' - then 8 - else -1 - | _ -> -1) - | 8 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 's' - then 0 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'd' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'g' - then 2 - else -1 - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 6 - else -1 - | 'm' -> - if String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 'm' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'y' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'e' - then 7 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 10 - else -1 - | 11 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'I' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'd' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'x' - then 9 - else -1 - | _ -> -1) - | 14 -> - if String.unsafe_get s pos = 's' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'u' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'L' - && String.unsafe_get s (pos + 7) = 'a' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'g' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'a' - && String.unsafe_get s (pos + 12) = 'g' - && String.unsafe_get s (pos + 13) = 'e' - then 12 - else -1 - | 19 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 't' - && String.unsafe_get s (pos + 4) = 'M' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'd' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'f' - && String.unsafe_get s (pos + 9) = 'i' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'T' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'm' - && String.unsafe_get s (pos + 15) = 'e' - && String.unsafe_get s (pos + 16) = 'U' - && String.unsafe_get s (pos + 17) = 't' - && String.unsafe_get s (pos + 18) = 'c' - then 4 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'h' then ( + 5 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'f' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' then ( + 2 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 6 + ) + else ( + -1 + ) + ) + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'y' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'L' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' then ( + 12 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'M' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'T' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 'U' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_contents := Some (read_artifact_content p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_encoding := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_hashes := Some (read_hm_str_str p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_last_modified_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_length := read_int64 p lb - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_artifact_location p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_mime_type := Some (read_artifact_mimetype p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_offset := Some (read_int64 p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_parent_index := read_int64 p lb - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_external_properties p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_roles := Some (read__artifact_roles_item_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ contents = !field_contents - ; description = !field_description - ; encoding = !field_encoding - ; hashes = !field_hashes - ; last_modified_time_utc = !field_last_modified_time_utc - ; length = !field_length - ; location = !field_location - ; mime_type = !field_mime_type - ; offset = !field_offset - ; parent_index = !field_parent_index - ; properties = !field_properties - ; roles = !field_roles - ; source_language = !field_source_language - } - : artifact) - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_contents := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_encoding := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hashes := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_modified_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_length := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_mime_type := ( + Some ( + ( + read_artifact_mimetype + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_offset := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_external_properties + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_roles := ( + Some ( + ( + read__artifact_roles_item_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 5 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'h' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'h' then ( + 5 + ) + else ( + -1 + ) + ) + | 'o' -> ( + if String.unsafe_get s (pos+1) = 'f' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 't' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'd' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'g' then ( + 2 + ) + else ( + -1 + ) + ) + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 6 + ) + else ( + -1 + ) + ) + | 'm' -> ( + if String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'y' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'I' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'x' then ( + 9 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 14 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'u' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'L' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'g' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'a' && String.unsafe_get s (pos+12) = 'g' && String.unsafe_get s (pos+13) = 'e' then ( + 12 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 't' && String.unsafe_get s (pos+4) = 'M' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'd' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'f' && String.unsafe_get s (pos+9) = 'i' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'T' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'm' && String.unsafe_get s (pos+15) = 'e' && String.unsafe_get s (pos+16) = 'U' && String.unsafe_get s (pos+17) = 't' && String.unsafe_get s (pos+18) = 'c' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_contents := ( + Some ( + ( + read_artifact_content + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_encoding := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_hashes := ( + Some ( + ( + read_hm_str_str + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_last_modified_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_length := ( + ( + read_int64 + ) p lb + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_mime_type := ( + Some ( + ( + read_artifact_mimetype + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_offset := ( + Some ( + ( + read_int64 + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_parent_index := ( + ( + read_int64 + ) p lb + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_external_properties + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_roles := ( + Some ( + ( + read__artifact_roles_item_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + contents = !field_contents; + description = !field_description; + encoding = !field_encoding; + hashes = !field_hashes; + last_modified_time_utc = !field_last_modified_time_utc; + length = !field_length; + location = !field_location; + mime_type = !field_mime_type; + offset = !field_offset; + parent_index = !field_parent_index; + properties = !field_properties; + roles = !field_roles; + source_language = !field_source_language; + } + : artifact) + ) +) and artifact_of_string s = read_artifact (Yojson.Safe.init_lexer ()) (Lexing.from_string s) - -and read_external_properties p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_addresses = ref None in - let field_artifacts = ref None in - let field_conversion = ref None in - let field_driver = ref None in - let field_extensions = ref None in - let field_externalized_properties = ref None in - let field_graph = ref None in - let field_guid = ref None in - let field_invocations = ref None in - let field_logical_locations = ref None in - let field_policies = ref None in - let field_properties = ref None in - let field_results = ref None in - let field_run_guid = ref None in - let field_schema = ref None in - let field_taxonomies = ref None in - let field_thread_flow_locations = ref None in - let field_translations = ref None in - let field_version = ref None in - let field_web_requests = ref None in - let field_web_responses = ref None in - try +and read_external_properties = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 7 - else -1 - | 5 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - then 6 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 3 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'h' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'a' - then 14 - else -1 - | _ -> -1) - | 7 -> - (match String.unsafe_get s pos with - | 'r' -> - (match String.unsafe_get s (pos + 1) with - | 'e' -> - if String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 12 - else -1 - | 'u' -> - if String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'd' - then 13 - else -1 - | _ -> -1) - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 18 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 10 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 2 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 11 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 15 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 8 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 19 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 17 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 20 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 9 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 16 - else -1 - | 22 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'z' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'P' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'p' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - then 5 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__address_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__artifact_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_conversion p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_driver := Some (read_tool_component p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__tool_component_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_externalized_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graph := Some (read__graph_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_external_properties_guid p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read_invocation p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__tool_component_list p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read_result p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_guid := Some (read_external_properties_run_guid p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_schema := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__tool_component_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_flow_locations := Some (read__thread_flow_location_list p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__tool_component_list p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (read_external_properties_version p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__web_request_list p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_responses := Some (read__web_response_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_addresses = ref (None) in + let field_artifacts = ref (None) in + let field_conversion = ref (None) in + let field_driver = ref (None) in + let field_extensions = ref (None) in + let field_externalized_properties = ref (None) in + let field_graph = ref (None) in + let field_guid = ref (None) in + let field_invocations = ref (None) in + let field_logical_locations = ref (None) in + let field_policies = ref (None) in + let field_properties = ref (None) in + let field_results = ref (None) in + let field_run_guid = ref (None) in + let field_schema = ref (None) in + let field_taxonomies = ref (None) in + let field_thread_flow_locations = ref (None) in + let field_translations = ref (None) in + let field_version = ref (None) in + let field_web_requests = ref (None) in + let field_web_responses = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 7 - else -1 - | 5 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - then 6 - else -1 - | 6 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 3 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'c' - && String.unsafe_get s (pos + 2) = 'h' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'a' - then 14 - else -1 - | _ -> -1) - | 7 -> - (match String.unsafe_get s pos with - | 'r' -> - (match String.unsafe_get s (pos + 1) with - | 'e' -> - if String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 12 - else -1 - | 'u' -> - if String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'G' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'd' - then 13 - else -1 - | _ -> -1) - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 18 - else -1 - | _ -> -1) - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 10 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 2 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 11 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 15 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 8 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 19 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 17 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 20 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 9 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 16 - else -1 - | 22 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'z' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'P' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'p' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - then 5 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' then ( + 6 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 3 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'h' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'a' then ( + 14 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'r' -> ( + match String.unsafe_get s (pos+1) with + | 'e' -> ( + if String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 'u' -> ( + if String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( + 13 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 22 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'z' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'P' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'p' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__address_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__artifact_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_conversion p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_driver := Some (read_tool_component p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__tool_component_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_externalized_properties := Some (read_property_bag p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graph := Some (read__graph_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_external_properties_guid p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read_invocation p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__tool_component_list p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read_result p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_guid := Some (read_external_properties_run_guid p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_schema := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__tool_component_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_flow_locations := Some (read__thread_flow_location_list p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__tool_component_list p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_version := Some (read_external_properties_version p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__web_request_list p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_responses := Some (read__web_response_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ addresses = !field_addresses - ; artifacts = !field_artifacts - ; conversion = !field_conversion - ; driver = !field_driver - ; extensions = !field_extensions - ; externalized_properties = !field_externalized_properties - ; graph = !field_graph - ; guid = !field_guid - ; invocations = !field_invocations - ; logical_locations = !field_logical_locations - ; policies = !field_policies - ; properties = !field_properties - ; results = !field_results - ; run_guid = !field_run_guid - ; schema = !field_schema - ; taxonomies = !field_taxonomies - ; thread_flow_locations = !field_thread_flow_locations - ; translations = !field_translations - ; version = !field_version - ; web_requests = !field_web_requests - ; web_responses = !field_web_responses - } - : external_properties) - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__address_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__artifact_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_conversion + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_driver := ( + Some ( + ( + read_tool_component + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_externalized_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graph := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_external_properties_guid + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read_invocation + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read_result + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_guid := ( + Some ( + ( + read_external_properties_run_guid + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_schema := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + read_external_properties_version + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__web_request_list + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__web_response_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 7 + ) + else ( + -1 + ) + ) + | 5 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' then ( + 6 + ) + else ( + -1 + ) + ) + | 6 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 3 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'c' && String.unsafe_get s (pos+2) = 'h' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'a' then ( + 14 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | 'r' -> ( + match String.unsafe_get s (pos+1) with + | 'e' -> ( + if String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 'u' -> ( + if String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'G' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'd' then ( + 13 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 18 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 22 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'z' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'P' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'p' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__address_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__artifact_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_conversion + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_driver := ( + Some ( + ( + read_tool_component + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_externalized_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graph := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_external_properties_guid + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read_invocation + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read_result + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_guid := ( + Some ( + ( + read_external_properties_run_guid + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_schema := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version := ( + Some ( + ( + read_external_properties_version + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__web_request_list + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__web_response_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + addresses = !field_addresses; + artifacts = !field_artifacts; + conversion = !field_conversion; + driver = !field_driver; + extensions = !field_extensions; + externalized_properties = !field_externalized_properties; + graph = !field_graph; + guid = !field_guid; + invocations = !field_invocations; + logical_locations = !field_logical_locations; + policies = !field_policies; + properties = !field_properties; + results = !field_results; + run_guid = !field_run_guid; + schema = !field_schema; + taxonomies = !field_taxonomies; + thread_flow_locations = !field_thread_flow_locations; + translations = !field_translations; + version = !field_version; + web_requests = !field_web_requests; + web_responses = !field_web_responses; + } + : external_properties) + ) +) and external_properties_of_string s = read_external_properties (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_version_control_details : _ -> version_control_details -> _ = +let write_version_control_details : _ -> version_control_details -> _ = ( fun ob (x : version_control_details) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.as_of_time_utc with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"asOfTimeUtc\":"; - Yojson.Safe.write_string ob x); - (match x.branch with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"branch\":"; - Yojson.Safe.write_string ob x); - (match x.mapped_to with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"mappedTo\":"; - write_artifact_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"repositoryUri\":"; - Yojson.Safe.write_string ob x.repository_uri; - (match x.revision_id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"revisionId\":"; - Yojson.Safe.write_string ob x); - (match x.revision_tag with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"revisionTag\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.as_of_time_utc with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"asOfTimeUtc\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.branch with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"branch\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.mapped_to with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"mappedTo\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"repositoryUri\":"; + ( + Yojson.Safe.write_string + ) + ob x.repository_uri; + (match x.revision_id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"revisionId\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.revision_tag with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"revisionTag\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_version_control_details ?(len = 1024) x = let ob = Buffer.create len in write_version_control_details ob x; Buffer.contents ob -;; - -let read_version_control_details p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_as_of_time_utc = ref None in - let field_branch = ref None in - let field_mapped_to = ref None in - let field_properties = ref None in - let field_repository_uri = ref None in - let field_revision_id = ref None in - let field_revision_tag = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_version_control_details = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'h' - then 1 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'T' - && String.unsafe_get s (pos + 7) = 'o' - then 2 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'd' - then 5 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'O' - && String.unsafe_get s (pos + 3) = 'f' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'c' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'g' - then 6 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'y' - && String.unsafe_get s (pos + 10) = 'U' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'i' - then 4 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_as_of_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_branch := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_mapped_to := Some (read_artifact_location p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> field_repository_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_revision_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_revision_tag := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_as_of_time_utc = ref (None) in + let field_branch = ref (None) in + let field_mapped_to = ref (None) in + let field_properties = ref (None) in + let field_repository_uri = ref (None) in + let field_revision_id = ref (None) in + let field_revision_tag = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - if String.unsafe_get s pos = 'b' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'h' - then 1 - else -1 - | 8 -> - if String.unsafe_get s pos = 'm' - && String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'T' - && String.unsafe_get s (pos + 7) = 'o' - then 2 - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'I' - && String.unsafe_get s (pos + 9) = 'd' - then 5 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'a' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'O' - && String.unsafe_get s (pos + 3) = 'f' - && String.unsafe_get s (pos + 4) = 'T' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 'c' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 'T' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 'g' - then 6 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'p' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'r' - && String.unsafe_get s (pos + 9) = 'y' - && String.unsafe_get s (pos + 10) = 'U' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'i' - then 4 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( + 1 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'T' && String.unsafe_get s (pos+7) = 'o' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'd' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'O' && String.unsafe_get s (pos+3) = 'f' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'c' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'g' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' && String.unsafe_get s (pos+10) = 'U' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'i' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_as_of_time_utc := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_branch := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_mapped_to := Some (read_artifact_location p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 4 -> field_repository_uri := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_revision_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_revision_tag := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ as_of_time_utc = !field_as_of_time_utc - ; branch = !field_branch - ; mapped_to = !field_mapped_to - ; properties = !field_properties - ; repository_uri = - (match !field_repository_uri with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "repository_uri") - ; revision_id = !field_revision_id - ; revision_tag = !field_revision_tag - } - : version_control_details) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_as_of_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_branch := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_mapped_to := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + field_repository_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_revision_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_revision_tag := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + if String.unsafe_get s pos = 'b' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'h' then ( + 1 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'm' && String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'T' && String.unsafe_get s (pos+7) = 'o' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'I' && String.unsafe_get s (pos+9) = 'd' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'a' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'O' && String.unsafe_get s (pos+3) = 'f' && String.unsafe_get s (pos+4) = 'T' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 'c' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 'T' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'g' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'p' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'y' && String.unsafe_get s (pos+10) = 'U' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'i' then ( + 4 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_as_of_time_utc := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_branch := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_mapped_to := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 4 -> + field_repository_uri := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_revision_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_revision_tag := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + as_of_time_utc = !field_as_of_time_utc; + branch = !field_branch; + mapped_to = !field_mapped_to; + properties = !field_properties; + repository_uri = (match !field_repository_uri with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "repository_uri"); + revision_id = !field_revision_id; + revision_tag = !field_revision_tag; + } + : version_control_details) + ) +) let version_control_details_of_string s = read_version_control_details (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_special_locations : _ -> special_locations -> _ = +let write_special_locations : _ -> special_locations -> _ = ( fun ob (x : special_locations) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.display_base with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"displayBase\":"; - write_artifact_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.display_base with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"displayBase\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_special_locations ?(len = 1024) x = let ob = Buffer.create len in write_special_locations ob x; Buffer.contents ob -;; - -let read_special_locations p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_display_base = ref None in - let field_properties = ref None in - try +let read_special_locations = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'y' - && String.unsafe_get s (pos + 7) = 'B' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_display_base := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_display_base = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 1 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'i' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'y' - && String.unsafe_get s (pos + 7) = 'B' - && String.unsafe_get s (pos + 8) = 'a' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'y' && String.unsafe_get s (pos+7) = 'B' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_display_base := Some (read_artifact_location p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ display_base = !field_display_base; properties = !field_properties } - : special_locations) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_display_base := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'i' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'y' && String.unsafe_get s (pos+7) = 'B' && String.unsafe_get s (pos+8) = 'a' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_display_base := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + display_base = !field_display_base; + properties = !field_properties; + } + : special_locations) + ) +) let special_locations_of_string s = read_special_locations (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_sarif_version ob x = - match x with - | `TwoDotOneDotZero -> Buffer.add_string ob "\"2.1.0\"" -;; - +let write_sarif_version = ( + fun ob x -> + match x with + | `TwoDotOneDotZero -> Buffer.add_string ob "\"2.1.0\"" +) let string_of_sarif_version ?(len = 1024) x = let ob = Buffer.create len in write_sarif_version ob x; Buffer.contents ob -;; - -let read_sarif_version p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "2.1.0" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `TwoDotOneDotZero - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "2.1.0" -> `TwoDotOneDotZero - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_sarif_version = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "2.1.0" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `TwoDotOneDotZero + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "2.1.0" -> + `TwoDotOneDotZero + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let sarif_version_of_string s = read_sarif_version (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_language = Yojson.Safe.write_string - +let write_run_language = ( + Yojson.Safe.write_string +) let string_of_run_language ?(len = 1024) x = let ob = Buffer.create len in write_run_language ob x; Buffer.contents ob -;; - -let read_run_language = Atdgen_runtime.Oj_run.read_string - +let read_run_language = ( + Atdgen_runtime.Oj_run.read_string +) let run_language_of_string s = read_run_language (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_column_kind ob x = - match x with - | `Utf16CodeUnits -> Buffer.add_string ob "\"utf16CodeUnits\"" - | `UnicodeCodePoints -> Buffer.add_string ob "\"unicodeCodePoints\"" -;; - +let write_run_column_kind = ( + fun ob x -> + match x with + | `Utf16CodeUnits -> Buffer.add_string ob "\"utf16CodeUnits\"" + | `UnicodeCodePoints -> Buffer.add_string ob "\"unicodeCodePoints\"" +) let string_of_run_column_kind ?(len = 1024) x = let ob = Buffer.create len in write_run_column_kind ob x; Buffer.contents ob -;; - -let read_run_column_kind p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "utf16CodeUnits" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `Utf16CodeUnits - | "unicodeCodePoints" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - `UnicodeCodePoints - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "utf16CodeUnits" -> `Utf16CodeUnits - | "unicodeCodePoints" -> `UnicodeCodePoints - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read_run_column_kind = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "utf16CodeUnits" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `Utf16CodeUnits + | "unicodeCodePoints" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + `UnicodeCodePoints + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "utf16CodeUnits" -> + `Utf16CodeUnits + | "unicodeCodePoints" -> + `UnicodeCodePoints + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let run_column_kind_of_string s = read_run_column_kind (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_baseline_guid = Yojson.Safe.write_string - +let write_run_baseline_guid = ( + Yojson.Safe.write_string +) let string_of_run_baseline_guid ?(len = 1024) x = let ob = Buffer.create len in write_run_baseline_guid ob x; Buffer.contents ob -;; - -let read_run_baseline_guid = Atdgen_runtime.Oj_run.read_string - +let read_run_baseline_guid = ( + Atdgen_runtime.Oj_run.read_string +) let run_baseline_guid_of_string s = read_run_baseline_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_automation_details_guid = Yojson.Safe.write_string - +let write_run_automation_details_guid = ( + Yojson.Safe.write_string +) let string_of_run_automation_details_guid ?(len = 1024) x = let ob = Buffer.create len in write_run_automation_details_guid ob x; Buffer.contents ob -;; - -let read_run_automation_details_guid = Atdgen_runtime.Oj_run.read_string - +let read_run_automation_details_guid = ( + Atdgen_runtime.Oj_run.read_string +) let run_automation_details_guid_of_string s = read_run_automation_details_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_automation_details_correlation_guid = Yojson.Safe.write_string - +let write_run_automation_details_correlation_guid = ( + Yojson.Safe.write_string +) let string_of_run_automation_details_correlation_guid ?(len = 1024) x = let ob = Buffer.create len in write_run_automation_details_correlation_guid ob x; Buffer.contents ob -;; - -let read_run_automation_details_correlation_guid = Atdgen_runtime.Oj_run.read_string - +let read_run_automation_details_correlation_guid = ( + Atdgen_runtime.Oj_run.read_string +) let run_automation_details_correlation_guid_of_string s = - read_run_automation_details_correlation_guid - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__run_automation_details_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_run_automation_details_guid -;; - + read_run_automation_details_correlation_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__run_automation_details_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_automation_details_guid + ) +) let string_of__run_automation_details_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__run_automation_details_guid_option ob x; Buffer.contents ob -;; - -let read__run_automation_details_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_automation_details_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_automation_details_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_automation_details_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_automation_details_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_automation_details_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_automation_details_guid_option_of_string s = - read__run_automation_details_guid_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_46715fb = - Atdgen_runtime.Oj_run.write_std_option write_run_automation_details_correlation_guid -;; - + read__run_automation_details_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_46715fb = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_automation_details_correlation_guid + ) +) let string_of__option_46715fb ?(len = 1024) x = let ob = Buffer.create len in write__option_46715fb ob x; Buffer.contents ob -;; - -let read__option_46715fb p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_automation_details_correlation_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_automation_details_correlation_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_46715fb = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_automation_details_correlation_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_automation_details_correlation_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_46715fb_of_string s = read__option_46715fb (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_run_automation_details : _ -> run_automation_details -> _ = +let write_run_automation_details : _ -> run_automation_details -> _ = ( fun ob (x : run_automation_details) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.correlation_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"correlationGuid\":"; - write_run_automation_details_correlation_guid ob x); - (match x.description with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"description\":"; - write_message ob x); - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_run_automation_details_guid ob x); - (match x.id with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"id\":"; - Yojson.Safe.write_string ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.correlation_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"correlationGuid\":"; + ( + write_run_automation_details_correlation_guid + ) + ob x; + ); + (match x.description with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"description\":"; + ( + write_message + ) + ob x; + ); + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_run_automation_details_guid + ) + ob x; + ); + (match x.id with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"id\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_run_automation_details ?(len = 1024) x = let ob = Buffer.create len in write_run_automation_details ob x; Buffer.contents ob -;; - -let read_run_automation_details p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_correlation_guid = ref None in - let field_description = ref None in - let field_guid = ref None in - let field_id = ref None in - let field_properties = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_run_automation_details = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 3 - else -1 - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 15 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'G' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'd' - then 0 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_correlation_guid - := Some (read_run_automation_details_correlation_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_run_automation_details_guid p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_correlation_guid = ref (None) in + let field_description = ref (None) in + let field_guid = ref (None) in + let field_id = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 2 -> - if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos + 1) = 'd' - then 3 - else -1 - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 2 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 11 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - then 1 - else -1 - | 15 -> - if String.unsafe_get s pos = 'c' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 'G' - && String.unsafe_get s (pos + 12) = 'u' - && String.unsafe_get s (pos + 13) = 'i' - && String.unsafe_get s (pos + 14) = 'd' - then 0 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'G' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_correlation_guid - := Some (read_run_automation_details_correlation_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_description := Some (read_message p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_run_automation_details_guid p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_id := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ correlation_guid = !field_correlation_guid - ; description = !field_description - ; guid = !field_guid - ; id = !field_id - ; properties = !field_properties - } - : run_automation_details) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_correlation_guid := ( + Some ( + ( + read_run_automation_details_correlation_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_run_automation_details_guid + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 2 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 2 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 11 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' then ( + 1 + ) + else ( + -1 + ) + ) + | 15 -> ( + if String.unsafe_get s pos = 'c' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'G' && String.unsafe_get s (pos+12) = 'u' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_correlation_guid := ( + Some ( + ( + read_run_automation_details_correlation_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_description := ( + Some ( + ( + read_message + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_run_automation_details_guid + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_id := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + correlation_guid = !field_correlation_guid; + description = !field_description; + guid = !field_guid; + id = !field_id; + properties = !field_properties; + } + : run_automation_details) + ) +) let run_automation_details_of_string s = read_run_automation_details (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__x_9eb6bac = - Atdgen_runtime.Oj_run.write_assoc_list Yojson.Safe.write_string write_artifact_location -;; - +let write__x_9eb6bac = ( + Atdgen_runtime.Oj_run.write_assoc_list ( + Yojson.Safe.write_string + ) ( + write_artifact_location + ) +) let string_of__x_9eb6bac ?(len = 1024) x = let ob = Buffer.create len in write__x_9eb6bac ob x; Buffer.contents ob -;; - -let read__x_9eb6bac = - Atdgen_runtime.Oj_run.read_assoc_list +let read__x_9eb6bac = ( + Atdgen_runtime.Oj_run.read_assoc_list ( Atdgen_runtime.Oj_run.read_string + ) ( read_artifact_location -;; - + ) +) let _x_9eb6bac_of_string s = read__x_9eb6bac (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_hm_str_al = write__x_9eb6bac - +let write_hm_str_al = ( + write__x_9eb6bac +) let string_of_hm_str_al ?(len = 1024) x = let ob = Buffer.create len in write_hm_str_al ob x; Buffer.contents ob -;; - -let read_hm_str_al = read__x_9eb6bac - +let read_hm_str_al = ( + read__x_9eb6bac +) let hm_str_al_of_string s = read_hm_str_al (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_external_property_file_reference_guid = Yojson.Safe.write_string - +let write_external_property_file_reference_guid = ( + Yojson.Safe.write_string +) let string_of_external_property_file_reference_guid ?(len = 1024) x = let ob = Buffer.create len in write_external_property_file_reference_guid ob x; Buffer.contents ob -;; - -let read_external_property_file_reference_guid = Atdgen_runtime.Oj_run.read_string - +let read_external_property_file_reference_guid = ( + Atdgen_runtime.Oj_run.read_string +) let external_property_file_reference_guid_of_string s = - read_external_property_file_reference_guid - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_9c938c9 = - Atdgen_runtime.Oj_run.write_std_option write_external_property_file_reference_guid -;; - + read_external_property_file_reference_guid (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_9c938c9 = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_property_file_reference_guid + ) +) let string_of__option_9c938c9 ?(len = 1024) x = let ob = Buffer.create len in write__option_9c938c9 ob x; Buffer.contents ob -;; - -let read__option_9c938c9 p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_property_file_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_property_file_reference_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_9c938c9 = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_property_file_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_property_file_reference_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_9c938c9_of_string s = read__option_9c938c9 (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_external_property_file_reference : _ -> external_property_file_reference -> _ = +let write_external_property_file_reference : _ -> external_property_file_reference -> _ = ( fun ob (x : external_property_file_reference) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"guid\":"; - write_external_property_file_reference_guid ob x); - if x.item_count <> -1L - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"itemCount\":"; - write_int64 ob x.item_count); - (match x.location with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"location\":"; - write_artifact_location ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"guid\":"; + ( + write_external_property_file_reference_guid + ) + ob x; + ); + if x.item_count <> -1L then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"itemCount\":"; + ( + write_int64 + ) + ob x.item_count; + ); + (match x.location with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"location\":"; + ( + write_artifact_location + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_external_property_file_reference ?(len = 1024) x = let ob = Buffer.create len in write_external_property_file_reference ob x; Buffer.contents ob -;; - -let read_external_property_file_reference p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_guid = ref None in - let field_item_count = ref (-1L) in - let field_location = ref None in - let field_properties = ref None in - try +let read_external_property_file_reference = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 2 - else -1 - | 9 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 't' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_external_property_file_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_item_count := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_artifact_location p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_guid = ref (None) in + let field_item_count = ref (-1L) in + let field_location = ref (None) in + let field_properties = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'd' - then 0 - else -1 - | 8 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 't' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'o' - && String.unsafe_get s (pos + 7) = 'n' - then 2 - else -1 - | 9 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 't' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'm' - && String.unsafe_get s (pos + 4) = 'C' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'n' - && String.unsafe_get s (pos + 8) = 't' - then 1 - else -1 - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 3 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_guid := Some (read_external_property_file_reference_guid p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_item_count := read_int64 p lb - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_location := Some (read_artifact_location p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ guid = !field_guid - ; item_count = !field_item_count - ; location = !field_location - ; properties = !field_properties - } - : external_property_file_reference) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_external_property_file_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_item_count := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'd' then ( + 0 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 't' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'o' && String.unsafe_get s (pos+7) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 't' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'm' && String.unsafe_get s (pos+4) = 'C' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'n' && String.unsafe_get s (pos+8) = 't' then ( + 1 + ) + else ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_guid := ( + Some ( + ( + read_external_property_file_reference_guid + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_item_count := ( + ( + read_int64 + ) p lb + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_location := ( + Some ( + ( + read_artifact_location + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + guid = !field_guid; + item_count = !field_item_count; + location = !field_location; + properties = !field_properties; + } + : external_property_file_reference) + ) +) let external_property_file_reference_of_string s = read_external_property_file_reference (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_property_file_reference_list = - Atdgen_runtime.Oj_run.write_list write_external_property_file_reference -;; - +let write__external_property_file_reference_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_external_property_file_reference + ) +) let string_of__external_property_file_reference_list ?(len = 1024) x = let ob = Buffer.create len in write__external_property_file_reference_list ob x; Buffer.contents ob -;; - -let read__external_property_file_reference_list = - Atdgen_runtime.Oj_run.read_list read_external_property_file_reference -;; - +let read__external_property_file_reference_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_external_property_file_reference + ) +) let _external_property_file_reference_list_of_string s = - read__external_property_file_reference_list - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__option_927609b = - Atdgen_runtime.Oj_run.write_std_option write__external_property_file_reference_list -;; - + read__external_property_file_reference_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__option_927609b = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__external_property_file_reference_list + ) +) let string_of__option_927609b ?(len = 1024) x = let ob = Buffer.create len in write__option_927609b ob x; Buffer.contents ob -;; - -let read__option_927609b p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__external_property_file_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__external_property_file_reference_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__option_927609b = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__external_property_file_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__external_property_file_reference_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _option_927609b_of_string s = read__option_927609b (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_property_file_reference_option = - Atdgen_runtime.Oj_run.write_std_option write_external_property_file_reference -;; - +let write__external_property_file_reference_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_property_file_reference + ) +) let string_of__external_property_file_reference_option ?(len = 1024) x = let ob = Buffer.create len in write__external_property_file_reference_option ob x; Buffer.contents ob -;; - -let read__external_property_file_reference_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_property_file_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_property_file_reference p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_property_file_reference_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_property_file_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_property_file_reference + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_property_file_reference_option_of_string s = - read__external_property_file_reference_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_external_property_file_references : _ -> external_property_file_references -> _ = + read__external_property_file_reference_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_external_property_file_references : _ -> external_property_file_references -> _ = ( fun ob (x : external_property_file_references) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.addresses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"addresses\":"; - write__external_property_file_reference_list ob x); - (match x.artifacts with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifacts\":"; - write__external_property_file_reference_list ob x); - (match x.conversion with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"conversion\":"; - write_external_property_file_reference ob x); - (match x.driver with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"driver\":"; - write_external_property_file_reference ob x); - (match x.extensions with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"extensions\":"; - write__external_property_file_reference_list ob x); - (match x.externalized_properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"externalizedProperties\":"; - write_external_property_file_reference ob x); - (match x.graphs with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"graphs\":"; - write__external_property_file_reference_list ob x); - (match x.invocations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"invocations\":"; - write__external_property_file_reference_list ob x); - (match x.logical_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"logicalLocations\":"; - write__external_property_file_reference_list ob x); - (match x.policies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"policies\":"; - write__external_property_file_reference_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.results with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"results\":"; - write__external_property_file_reference_list ob x); - (match x.taxonomies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxonomies\":"; - write__external_property_file_reference_list ob x); - (match x.thread_flow_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadFlowLocations\":"; - write__external_property_file_reference_list ob x); - (match x.translations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"translations\":"; - write__external_property_file_reference_list ob x); - (match x.web_requests with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webRequests\":"; - write__external_property_file_reference_list ob x); - (match x.web_responses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webResponses\":"; - write__external_property_file_reference_list ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.addresses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"addresses\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.artifacts with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifacts\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.conversion with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"conversion\":"; + ( + write_external_property_file_reference + ) + ob x; + ); + (match x.driver with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"driver\":"; + ( + write_external_property_file_reference + ) + ob x; + ); + (match x.extensions with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"extensions\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.externalized_properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"externalizedProperties\":"; + ( + write_external_property_file_reference + ) + ob x; + ); + (match x.graphs with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"graphs\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.invocations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"invocations\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.logical_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"logicalLocations\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.policies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"policies\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.results with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"results\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.taxonomies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxonomies\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.thread_flow_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadFlowLocations\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.translations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"translations\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.web_requests with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webRequests\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + (match x.web_responses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webResponses\":"; + ( + write__external_property_file_reference_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_external_property_file_references ?(len = 1024) x = let ob = Buffer.create len in write_external_property_file_references ob x; Buffer.contents ob -;; - -let read_external_property_file_references p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_addresses = ref None in - let field_artifacts = ref None in - let field_conversion = ref None in - let field_driver = ref None in - let field_extensions = ref None in - let field_externalized_properties = ref None in - let field_graphs = ref None in - let field_invocations = ref None in - let field_logical_locations = ref None in - let field_policies = ref None in - let field_properties = ref None in - let field_results = ref None in - let field_taxonomies = ref None in - let field_thread_flow_locations = ref None in - let field_translations = ref None in - let field_web_requests = ref None in - let field_web_responses = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_external_property_file_references = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 3 - else -1 - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 6 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 11 - else -1 - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 9 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 2 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 10 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 12 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 7 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 15 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 14 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 16 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 8 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 13 - else -1 - | 22 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'z' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'P' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'p' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - then 5 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__external_property_file_reference_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__external_property_file_reference_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_external_property_file_reference p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_driver := Some (read_external_property_file_reference p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__external_property_file_reference_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_externalized_properties - := Some (read_external_property_file_reference p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__external_property_file_reference_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read__external_property_file_reference_list p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_logical_locations - := Some (read__external_property_file_reference_list p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__external_property_file_reference_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read__external_property_file_reference_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__external_property_file_reference_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_thread_flow_locations - := Some (read__external_property_file_reference_list p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__external_property_file_reference_list p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__external_property_file_reference_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_responses := Some (read__external_property_file_reference_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_addresses = ref (None) in + let field_artifacts = ref (None) in + let field_conversion = ref (None) in + let field_driver = ref (None) in + let field_extensions = ref (None) in + let field_externalized_properties = ref (None) in + let field_graphs = ref (None) in + let field_invocations = ref (None) in + let field_logical_locations = ref (None) in + let field_policies = ref (None) in + let field_properties = ref (None) in + let field_results = ref (None) in + let field_taxonomies = ref (None) in + let field_thread_flow_locations = ref (None) in + let field_translations = ref (None) in + let field_web_requests = ref (None) in + let field_web_responses = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 6 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - then 3 - else -1 - | 'g' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 6 - else -1 - | _ -> -1) - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 11 - else -1 - | 8 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 9 - else -1 - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 2 - else -1 - | 'e' -> - if String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - then 4 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 10 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 12 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 7 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 15 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 14 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 16 - else -1 - | _ -> -1) - | 16 -> - if String.unsafe_get s pos = 'l' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 8 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 13 - else -1 - | 22 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'z' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'P' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 'o' - && String.unsafe_get s (pos + 15) = 'p' - && String.unsafe_get s (pos + 16) = 'e' - && String.unsafe_get s (pos + 17) = 'r' - && String.unsafe_get s (pos + 18) = 't' - && String.unsafe_get s (pos + 19) = 'i' - && String.unsafe_get s (pos + 20) = 'e' - && String.unsafe_get s (pos + 21) = 's' - then 5 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 3 + ) + else ( + -1 + ) + ) + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 22 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'z' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'P' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'p' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__external_property_file_reference_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__external_property_file_reference_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_external_property_file_reference p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_driver := Some (read_external_property_file_reference p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_extensions := Some (read__external_property_file_reference_list p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_externalized_properties - := Some (read_external_property_file_reference p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__external_property_file_reference_list p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read__external_property_file_reference_list p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_logical_locations - := Some (read__external_property_file_reference_list p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__external_property_file_reference_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read__external_property_file_reference_list p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__external_property_file_reference_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_thread_flow_locations - := Some (read__external_property_file_reference_list p lb) - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__external_property_file_reference_list p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__external_property_file_reference_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_web_responses := Some (read__external_property_file_reference_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ addresses = !field_addresses - ; artifacts = !field_artifacts - ; conversion = !field_conversion - ; driver = !field_driver - ; extensions = !field_extensions - ; externalized_properties = !field_externalized_properties - ; graphs = !field_graphs - ; invocations = !field_invocations - ; logical_locations = !field_logical_locations - ; policies = !field_policies - ; properties = !field_properties - ; results = !field_results - ; taxonomies = !field_taxonomies - ; thread_flow_locations = !field_thread_flow_locations - ; translations = !field_translations - ; web_requests = !field_web_requests - ; web_responses = !field_web_responses - } - : external_property_file_references) -;; - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_driver := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_externalized_properties := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 6 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' then ( + 3 + ) + else ( + -1 + ) + ) + | 'g' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 6 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 11 + ) + else ( + -1 + ) + ) + | 8 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 2 + ) + else ( + -1 + ) + ) + | 'e' -> ( + if String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' then ( + 4 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 7 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + if String.unsafe_get s pos = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 22 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'z' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'P' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'p' && String.unsafe_get s (pos+16) = 'e' && String.unsafe_get s (pos+17) = 'r' && String.unsafe_get s (pos+18) = 't' && String.unsafe_get s (pos+19) = 'i' && String.unsafe_get s (pos+20) = 'e' && String.unsafe_get s (pos+21) = 's' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_driver := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_extensions := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_externalized_properties := ( + Some ( + ( + read_external_property_file_reference + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__external_property_file_reference_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + addresses = !field_addresses; + artifacts = !field_artifacts; + conversion = !field_conversion; + driver = !field_driver; + extensions = !field_extensions; + externalized_properties = !field_externalized_properties; + graphs = !field_graphs; + invocations = !field_invocations; + logical_locations = !field_logical_locations; + policies = !field_policies; + properties = !field_properties; + results = !field_results; + taxonomies = !field_taxonomies; + thread_flow_locations = !field_thread_flow_locations; + translations = !field_translations; + web_requests = !field_web_requests; + web_responses = !field_web_responses; + } + : external_property_file_references) + ) +) let external_property_file_references_of_string s = - read_external_property_file_references - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__version_control_details_list = - Atdgen_runtime.Oj_run.write_list write_version_control_details -;; - + read_external_property_file_references (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__version_control_details_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_version_control_details + ) +) let string_of__version_control_details_list ?(len = 1024) x = let ob = Buffer.create len in write__version_control_details_list ob x; Buffer.contents ob -;; - -let read__version_control_details_list = - Atdgen_runtime.Oj_run.read_list read_version_control_details -;; - +let read__version_control_details_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_version_control_details + ) +) let _version_control_details_list_of_string s = read__version_control_details_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__version_control_details_list_option = - Atdgen_runtime.Oj_run.write_std_option write__version_control_details_list -;; - +let write__version_control_details_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__version_control_details_list + ) +) let string_of__version_control_details_list_option ?(len = 1024) x = let ob = Buffer.create len in write__version_control_details_list_option ob x; Buffer.contents ob -;; - -let read__version_control_details_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__version_control_details_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__version_control_details_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__version_control_details_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__version_control_details_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__version_control_details_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _version_control_details_list_option_of_string s = - read__version_control_details_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__special_locations_option = - Atdgen_runtime.Oj_run.write_std_option write_special_locations -;; - + read__version_control_details_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__special_locations_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_special_locations + ) +) let string_of__special_locations_option ?(len = 1024) x = let ob = Buffer.create len in write__special_locations_option ob x; Buffer.contents ob -;; - -let read__special_locations_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_special_locations p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_special_locations p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__special_locations_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_special_locations + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_special_locations + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _special_locations_option_of_string s = read__special_locations_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_language_option = Atdgen_runtime.Oj_run.write_std_option write_run_language - +let write__run_language_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_language + ) +) let string_of__run_language_option ?(len = 1024) x = let ob = Buffer.create len in write__run_language_option ob x; Buffer.contents ob -;; - -let read__run_language_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_language p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_language p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_language_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_language + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_language + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_language_option_of_string s = read__run_language_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_column_kind_option = - Atdgen_runtime.Oj_run.write_std_option write_run_column_kind -;; - +let write__run_column_kind_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_column_kind + ) +) let string_of__run_column_kind_option ?(len = 1024) x = let ob = Buffer.create len in write__run_column_kind_option ob x; Buffer.contents ob -;; - -let read__run_column_kind_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_column_kind p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_column_kind p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_column_kind_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_column_kind + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_column_kind + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_column_kind_option_of_string s = read__run_column_kind_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_baseline_guid_option = - Atdgen_runtime.Oj_run.write_std_option write_run_baseline_guid -;; - +let write__run_baseline_guid_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_baseline_guid + ) +) let string_of__run_baseline_guid_option ?(len = 1024) x = let ob = Buffer.create len in write__run_baseline_guid_option ob x; Buffer.contents ob -;; - -let read__run_baseline_guid_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_baseline_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_baseline_guid p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_baseline_guid_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_baseline_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_baseline_guid + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_baseline_guid_option_of_string s = read__run_baseline_guid_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_automation_details_option = - Atdgen_runtime.Oj_run.write_std_option write_run_automation_details -;; - +let write__run_automation_details_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_run_automation_details + ) +) let string_of__run_automation_details_option ?(len = 1024) x = let ob = Buffer.create len in write__run_automation_details_option ob x; Buffer.contents ob -;; - -let read__run_automation_details_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_run_automation_details p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_run_automation_details p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_automation_details_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_run_automation_details + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_run_automation_details + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_automation_details_option_of_string s = read__run_automation_details_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_automation_details_list = - Atdgen_runtime.Oj_run.write_list write_run_automation_details -;; - +let write__run_automation_details_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_run_automation_details + ) +) let string_of__run_automation_details_list ?(len = 1024) x = let ob = Buffer.create len in write__run_automation_details_list ob x; Buffer.contents ob -;; - -let read__run_automation_details_list = - Atdgen_runtime.Oj_run.read_list read_run_automation_details -;; - +let read__run_automation_details_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_run_automation_details + ) +) let _run_automation_details_list_of_string s = read__run_automation_details_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__run_automation_details_list_option = - Atdgen_runtime.Oj_run.write_std_option write__run_automation_details_list -;; - +let write__run_automation_details_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__run_automation_details_list + ) +) let string_of__run_automation_details_list_option ?(len = 1024) x = let ob = Buffer.create len in write__run_automation_details_list_option ob x; Buffer.contents ob -;; - -let read__run_automation_details_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__run_automation_details_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__run_automation_details_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__run_automation_details_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__run_automation_details_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__run_automation_details_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _run_automation_details_list_option_of_string s = - read__run_automation_details_list_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write__result_list = Atdgen_runtime.Oj_run.write_list write_result - + read__run_automation_details_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__result_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_result + ) +) let string_of__result_list ?(len = 1024) x = let ob = Buffer.create len in write__result_list ob x; Buffer.contents ob -;; - -let read__result_list = Atdgen_runtime.Oj_run.read_list read_result - +let read__result_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_result + ) +) let _result_list_of_string s = read__result_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__result_list_option = Atdgen_runtime.Oj_run.write_std_option write__result_list - +let write__result_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__result_list + ) +) let string_of__result_list_option ?(len = 1024) x = let ob = Buffer.create len in write__result_list_option ob x; Buffer.contents ob -;; - -let read__result_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__result_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__result_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__result_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__result_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__result_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _result_list_option_of_string s = read__result_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__invocation_list = Atdgen_runtime.Oj_run.write_list write_invocation - +let write__invocation_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_invocation + ) +) let string_of__invocation_list ?(len = 1024) x = let ob = Buffer.create len in write__invocation_list ob x; Buffer.contents ob -;; - -let read__invocation_list = Atdgen_runtime.Oj_run.read_list read_invocation - +let read__invocation_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_invocation + ) +) let _invocation_list_of_string s = read__invocation_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__invocation_list_option = - Atdgen_runtime.Oj_run.write_std_option write__invocation_list -;; - +let write__invocation_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__invocation_list + ) +) let string_of__invocation_list_option ?(len = 1024) x = let ob = Buffer.create len in write__invocation_list_option ob x; Buffer.contents ob -;; - -let read__invocation_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__invocation_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__invocation_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__invocation_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__invocation_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__invocation_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _invocation_list_option_of_string s = read__invocation_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__hm_str_al_option = Atdgen_runtime.Oj_run.write_std_option write_hm_str_al - +let write__hm_str_al_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_hm_str_al + ) +) let string_of__hm_str_al_option ?(len = 1024) x = let ob = Buffer.create len in write__hm_str_al_option ob x; Buffer.contents ob -;; - -let read__hm_str_al_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_hm_str_al p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_hm_str_al p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__hm_str_al_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_hm_str_al + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_hm_str_al + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _hm_str_al_option_of_string s = read__hm_str_al_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_property_file_references_option = - Atdgen_runtime.Oj_run.write_std_option write_external_property_file_references -;; - +let write__external_property_file_references_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write_external_property_file_references + ) +) let string_of__external_property_file_references_option ?(len = 1024) x = let ob = Buffer.create len in write__external_property_file_references_option ob x; Buffer.contents ob -;; - -let read__external_property_file_references_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read_external_property_file_references p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read_external_property_file_references p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_property_file_references_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read_external_property_file_references + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read_external_property_file_references + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_property_file_references_option_of_string s = - read__external_property_file_references_option - (Yojson.Safe.init_lexer ()) - (Lexing.from_string s) -;; - -let write_run : _ -> run -> _ = + read__external_property_file_references_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_run : _ -> run -> _ = ( fun ob (x : run) -> - Buffer.add_char ob '{'; - let is_first = ref true in - (match x.addresses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"addresses\":"; - write__address_list ob x); - (match x.artifacts with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"artifacts\":"; - write__artifact_list ob x); - (match x.automation_details with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"automationDetails\":"; - write_run_automation_details ob x); - (match x.baseline_guid with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"baselineGuid\":"; - write_run_baseline_guid ob x); - (match x.column_kind with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"columnKind\":"; - write_run_column_kind ob x); - (match x.conversion with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"conversion\":"; - write_conversion ob x); - (match x.default_encoding with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"defaultEncoding\":"; - Yojson.Safe.write_string ob x); - (match x.default_source_language with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"defaultSourceLanguage\":"; - Yojson.Safe.write_string ob x); - (match x.external_property_file_references with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"externalPropertyFileReferences\":"; - write_external_property_file_references ob x); - (match x.graphs with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"graphs\":"; - write__graph_list ob x); - (match x.invocations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"invocations\":"; - write__invocation_list ob x); - (match x.language with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"language\":"; - write_run_language ob x); - (match x.logical_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"logicalLocations\":"; - write__logical_location_list ob x); - if x.newline_sequences <> [ "\r\n"; "\n" ] - then ( - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"newlineSequences\":"; - write__string_list ob x.newline_sequences); - (match x.original_uri_base_ids with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"originalUriBaseIds\":"; - write_hm_str_al ob x); - (match x.policies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"policies\":"; - write__tool_component_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - (match x.redaction_tokens with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"redactionTokens\":"; - write__string_list ob x); - (match x.results with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"results\":"; - write__result_list ob x); - (match x.run_aggregates with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"runAggregates\":"; - write__run_automation_details_list ob x); - (match x.special_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"specialLocations\":"; - write_special_locations ob x); - (match x.taxonomies with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"taxonomies\":"; - write__tool_component_list ob x); - (match x.thread_flow_locations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"threadFlowLocations\":"; - write__thread_flow_location_list ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"tool\":"; - write_tool ob x.tool; - (match x.translations with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"translations\":"; - write__tool_component_list ob x); - (match x.version_control_provenance with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"versionControlProvenance\":"; - write__version_control_details_list ob x); - (match x.web_requests with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webRequests\":"; - write__web_request_list ob x); - (match x.web_responses with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"webResponses\":"; - write__web_response_list ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + (match x.addresses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"addresses\":"; + ( + write__address_list + ) + ob x; + ); + (match x.artifacts with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"artifacts\":"; + ( + write__artifact_list + ) + ob x; + ); + (match x.automation_details with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"automationDetails\":"; + ( + write_run_automation_details + ) + ob x; + ); + (match x.baseline_guid with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"baselineGuid\":"; + ( + write_run_baseline_guid + ) + ob x; + ); + (match x.column_kind with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"columnKind\":"; + ( + write_run_column_kind + ) + ob x; + ); + (match x.conversion with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"conversion\":"; + ( + write_conversion + ) + ob x; + ); + (match x.default_encoding with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"defaultEncoding\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.default_source_language with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"defaultSourceLanguage\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + (match x.external_property_file_references with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"externalPropertyFileReferences\":"; + ( + write_external_property_file_references + ) + ob x; + ); + (match x.graphs with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"graphs\":"; + ( + write__graph_list + ) + ob x; + ); + (match x.invocations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"invocations\":"; + ( + write__invocation_list + ) + ob x; + ); + (match x.language with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"language\":"; + ( + write_run_language + ) + ob x; + ); + (match x.logical_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"logicalLocations\":"; + ( + write__logical_location_list + ) + ob x; + ); + if x.newline_sequences <> ["\r\n"; "\n"] then ( + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"newlineSequences\":"; + ( + write__string_list + ) + ob x.newline_sequences; + ); + (match x.original_uri_base_ids with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"originalUriBaseIds\":"; + ( + write_hm_str_al + ) + ob x; + ); + (match x.policies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"policies\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + (match x.redaction_tokens with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"redactionTokens\":"; + ( + write__string_list + ) + ob x; + ); + (match x.results with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"results\":"; + ( + write__result_list + ) + ob x; + ); + (match x.run_aggregates with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"runAggregates\":"; + ( + write__run_automation_details_list + ) + ob x; + ); + (match x.special_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"specialLocations\":"; + ( + write_special_locations + ) + ob x; + ); + (match x.taxonomies with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"taxonomies\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.thread_flow_locations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"threadFlowLocations\":"; + ( + write__thread_flow_location_list + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"tool\":"; + ( + write_tool + ) + ob x.tool; + (match x.translations with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"translations\":"; + ( + write__tool_component_list + ) + ob x; + ); + (match x.version_control_provenance with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"versionControlProvenance\":"; + ( + write__version_control_details_list + ) + ob x; + ); + (match x.web_requests with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webRequests\":"; + ( + write__web_request_list + ) + ob x; + ); + (match x.web_responses with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"webResponses\":"; + ( + write__web_response_list + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_run ?(len = 1024) x = let ob = Buffer.create len in write_run ob x; Buffer.contents ob -;; - -let read_run p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_addresses = ref None in - let field_artifacts = ref None in - let field_automation_details = ref None in - let field_baseline_guid = ref None in - let field_column_kind = ref None in - let field_conversion = ref None in - let field_default_encoding = ref None in - let field_default_source_language = ref None in - let field_external_property_file_references = ref None in - let field_graphs = ref None in - let field_invocations = ref None in - let field_language = ref None in - let field_logical_locations = ref None in - let field_newline_sequences = ref [ "\r\n"; "\n" ] in - let field_original_uri_base_ids = ref None in - let field_policies = ref None in - let field_properties = ref None in - let field_redaction_tokens = ref None in - let field_results = ref None in - let field_run_aggregates = ref None in - let field_special_locations = ref None in - let field_taxonomies = ref None in - let field_thread_flow_locations = ref None in - let field_tool = ref None in - let field_translations = ref None in - let field_version_control_provenance = ref None in - let field_web_requests = ref None in - let field_web_responses = ref None in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; +let read_run = ( + fun p lb -> Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - then 23 - else -1 - | 6 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 9 - else -1 - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 18 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'e' - then 11 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 15 - else -1 - | _ -> -1) - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - then ( - match String.unsafe_get s (pos + 2) with - | 'l' -> - if String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'K' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'd' - then 4 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 5 - else -1 - | _ -> -1) - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 16 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 21 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 10 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 26 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 'b' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'G' - && String.unsafe_get s (pos + 9) = 'u' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 24 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 27 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'A' - && String.unsafe_get s (pos + 4) = 'g' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'g' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 's' - then 19 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'E' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 'g' - then 6 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'k' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 's' - then 17 - else -1 - | _ -> -1) - | 16 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 12 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'q' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'c' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 's' - then 13 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'p' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 20 - else -1 - | _ -> -1) - | 17 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'D' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'l' - && String.unsafe_get s (pos + 16) = 's' - then 2 - else -1 - | 18 -> - if String.unsafe_get s pos = 'o' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'B' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'I' - && String.unsafe_get s (pos + 16) = 'd' - && String.unsafe_get s (pos + 17) = 's' - then 14 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 22 - else -1 - | 21 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'u' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'L' - && String.unsafe_get s (pos + 14) = 'a' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'g' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'a' - && String.unsafe_get s (pos + 19) = 'g' - && String.unsafe_get s (pos + 20) = 'e' - then 7 - else -1 - | 24 -> - if String.unsafe_get s pos = 'v' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'C' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 'P' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'v' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'n' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 'n' - && String.unsafe_get s (pos + 22) = 'c' - && String.unsafe_get s (pos + 23) = 'e' - then 25 - else -1 - | 30 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'P' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'y' - && String.unsafe_get s (pos + 16) = 'F' - && String.unsafe_get s (pos + 17) = 'i' - && String.unsafe_get s (pos + 18) = 'l' - && String.unsafe_get s (pos + 19) = 'e' - && String.unsafe_get s (pos + 20) = 'R' - && String.unsafe_get s (pos + 21) = 'e' - && String.unsafe_get s (pos + 22) = 'f' - && String.unsafe_get s (pos + 23) = 'e' - && String.unsafe_get s (pos + 24) = 'r' - && String.unsafe_get s (pos + 25) = 'e' - && String.unsafe_get s (pos + 26) = 'n' - && String.unsafe_get s (pos + 27) = 'c' - && String.unsafe_get s (pos + 28) = 'e' - && String.unsafe_get s (pos + 29) = 's' - then 8 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__address_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__artifact_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_automation_details := Some (read_run_automation_details p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_baseline_guid := Some (read_run_baseline_guid p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_column_kind := Some (read_run_column_kind p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_conversion p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_default_encoding := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_default_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_external_property_file_references - := Some (read_external_property_file_references p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__graph_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read__invocation_list p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_language := Some (read_run_language p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_newline_sequences := read__string_list p lb - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_original_uri_base_ids := Some (read_hm_str_al p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__tool_component_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_redaction_tokens := Some (read__string_list p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read__result_list p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_aggregates := Some (read__run_automation_details_list p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_special_locations := Some (read_special_locations p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__tool_component_list p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_flow_locations := Some (read__thread_flow_location_list p lb) - | 23 -> field_tool := Some (read_tool p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__tool_component_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_version_control_provenance - := Some (read__version_control_details_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__web_request_list p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_responses := Some (read__web_response_list p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_addresses = ref (None) in + let field_artifacts = ref (None) in + let field_automation_details = ref (None) in + let field_baseline_guid = ref (None) in + let field_column_kind = ref (None) in + let field_conversion = ref (None) in + let field_default_encoding = ref (None) in + let field_default_source_language = ref (None) in + let field_external_property_file_references = ref (None) in + let field_graphs = ref (None) in + let field_invocations = ref (None) in + let field_language = ref (None) in + let field_logical_locations = ref (None) in + let field_newline_sequences = ref (["\r\n"; "\n"]) in + let field_original_uri_base_ids = ref (None) in + let field_policies = ref (None) in + let field_properties = ref (None) in + let field_redaction_tokens = ref (None) in + let field_results = ref (None) in + let field_run_aggregates = ref (None) in + let field_special_locations = ref (None) in + let field_taxonomies = ref (None) in + let field_thread_flow_locations = ref (None) in + let field_tool = ref (None) in + let field_translations = ref (None) in + let field_version_control_provenance = ref (None) in + let field_web_requests = ref (None) in + let field_web_responses = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'l' - then 23 - else -1 - | 6 -> - if String.unsafe_get s pos = 'g' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'h' - && String.unsafe_get s (pos + 5) = 's' - then 9 - else -1 - | 7 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 's' - then 18 - else -1 - | 8 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'g' - && String.unsafe_get s (pos + 7) = 'e' - then 11 - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 's' - then 15 - else -1 - | _ -> -1) - | 9 -> - if String.unsafe_get s pos = 'a' - then ( - match String.unsafe_get s (pos + 1) with - | 'd' -> - if String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'r' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - then 0 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'f' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'c' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 's' - then 1 - else -1 - | _ -> -1) - else -1 - | 10 -> - (match String.unsafe_get s pos with - | 'c' -> - if String.unsafe_get s (pos + 1) = 'o' - then ( - match String.unsafe_get s (pos + 2) with - | 'l' -> - if String.unsafe_get s (pos + 3) = 'u' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'K' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'd' - then 4 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 3) = 'v' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 's' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - then 5 - else -1 - | _ -> -1) - else -1 - | 'p' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 16 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 'x' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'm' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 21 - else -1 - | _ -> -1) - | 11 -> - (match String.unsafe_get s pos with - | 'i' -> - if String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'v' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 's' - then 10 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'q' - && String.unsafe_get s (pos + 6) = 'u' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 's' - && String.unsafe_get s (pos + 9) = 't' - && String.unsafe_get s (pos + 10) = 's' - then 26 - else -1 - | _ -> -1) - | 12 -> - (match String.unsafe_get s pos with - | 'b' -> - if String.unsafe_get s (pos + 1) = 'a' - && String.unsafe_get s (pos + 2) = 's' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'l' - && String.unsafe_get s (pos + 5) = 'i' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'G' - && String.unsafe_get s (pos + 9) = 'u' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'd' - then 3 - else -1 - | 't' -> - if String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'a' - && String.unsafe_get s (pos + 3) = 'n' - && String.unsafe_get s (pos + 4) = 's' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 't' - && String.unsafe_get s (pos + 8) = 'i' - && String.unsafe_get s (pos + 9) = 'o' - && String.unsafe_get s (pos + 10) = 'n' - && String.unsafe_get s (pos + 11) = 's' - then 24 - else -1 - | 'w' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'b' - && String.unsafe_get s (pos + 3) = 'R' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 's' - && String.unsafe_get s (pos + 6) = 'p' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 's' - && String.unsafe_get s (pos + 10) = 'e' - && String.unsafe_get s (pos + 11) = 's' - then 27 - else -1 - | _ -> -1) - | 13 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 'A' - && String.unsafe_get s (pos + 4) = 'g' - && String.unsafe_get s (pos + 5) = 'g' - && String.unsafe_get s (pos + 6) = 'r' - && String.unsafe_get s (pos + 7) = 'e' - && String.unsafe_get s (pos + 8) = 'g' - && String.unsafe_get s (pos + 9) = 'a' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 's' - then 19 - else -1 - | 15 -> - (match String.unsafe_get s pos with - | 'd' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'E' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'd' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 'g' - then 6 - else -1 - | 'r' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'd' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 't' - && String.unsafe_get s (pos + 6) = 'i' - && String.unsafe_get s (pos + 7) = 'o' - && String.unsafe_get s (pos + 8) = 'n' - && String.unsafe_get s (pos + 9) = 'T' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'k' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'n' - && String.unsafe_get s (pos + 14) = 's' - then 17 - else -1 - | _ -> -1) - | 16 -> - (match String.unsafe_get s pos with - | 'l' -> - if String.unsafe_get s (pos + 1) = 'o' - && String.unsafe_get s (pos + 2) = 'g' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'c' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 12 - else -1 - | 'n' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'w' - && String.unsafe_get s (pos + 3) = 'l' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'e' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 'q' - && String.unsafe_get s (pos + 10) = 'u' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 'n' - && String.unsafe_get s (pos + 13) = 'c' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 's' - then 13 - else -1 - | 's' -> - if String.unsafe_get s (pos + 1) = 'p' - && String.unsafe_get s (pos + 2) = 'e' - && String.unsafe_get s (pos + 3) = 'c' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 'l' - && String.unsafe_get s (pos + 7) = 'L' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'c' - && String.unsafe_get s (pos + 10) = 'a' - && String.unsafe_get s (pos + 11) = 't' - && String.unsafe_get s (pos + 12) = 'i' - && String.unsafe_get s (pos + 13) = 'o' - && String.unsafe_get s (pos + 14) = 'n' - && String.unsafe_get s (pos + 15) = 's' - then 20 - else -1 - | _ -> -1) - | 17 -> - if String.unsafe_get s pos = 'a' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'o' - && String.unsafe_get s (pos + 4) = 'm' - && String.unsafe_get s (pos + 5) = 'a' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 'D' - && String.unsafe_get s (pos + 11) = 'e' - && String.unsafe_get s (pos + 12) = 't' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 'i' - && String.unsafe_get s (pos + 15) = 'l' - && String.unsafe_get s (pos + 16) = 's' - then 2 - else -1 - | 18 -> - if String.unsafe_get s pos = 'o' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'i' - && String.unsafe_get s (pos + 3) = 'g' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'U' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'i' - && String.unsafe_get s (pos + 11) = 'B' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 's' - && String.unsafe_get s (pos + 14) = 'e' - && String.unsafe_get s (pos + 15) = 'I' - && String.unsafe_get s (pos + 16) = 'd' - && String.unsafe_get s (pos + 17) = 's' - then 14 - else -1 - | 19 -> - if String.unsafe_get s pos = 't' - && String.unsafe_get s (pos + 1) = 'h' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'a' - && String.unsafe_get s (pos + 5) = 'd' - && String.unsafe_get s (pos + 6) = 'F' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'w' - && String.unsafe_get s (pos + 10) = 'L' - && String.unsafe_get s (pos + 11) = 'o' - && String.unsafe_get s (pos + 12) = 'c' - && String.unsafe_get s (pos + 13) = 'a' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'i' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'n' - && String.unsafe_get s (pos + 18) = 's' - then 22 - else -1 - | 21 -> - if String.unsafe_get s pos = 'd' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'f' - && String.unsafe_get s (pos + 3) = 'a' - && String.unsafe_get s (pos + 4) = 'u' - && String.unsafe_get s (pos + 5) = 'l' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'S' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'u' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'c' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'L' - && String.unsafe_get s (pos + 14) = 'a' - && String.unsafe_get s (pos + 15) = 'n' - && String.unsafe_get s (pos + 16) = 'g' - && String.unsafe_get s (pos + 17) = 'u' - && String.unsafe_get s (pos + 18) = 'a' - && String.unsafe_get s (pos + 19) = 'g' - && String.unsafe_get s (pos + 20) = 'e' - then 7 - else -1 - | 24 -> - if String.unsafe_get s pos = 'v' - && String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - && String.unsafe_get s (pos + 7) = 'C' - && String.unsafe_get s (pos + 8) = 'o' - && String.unsafe_get s (pos + 9) = 'n' - && String.unsafe_get s (pos + 10) = 't' - && String.unsafe_get s (pos + 11) = 'r' - && String.unsafe_get s (pos + 12) = 'o' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 'P' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'v' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'n' - && String.unsafe_get s (pos + 20) = 'a' - && String.unsafe_get s (pos + 21) = 'n' - && String.unsafe_get s (pos + 22) = 'c' - && String.unsafe_get s (pos + 23) = 'e' - then 25 - else -1 - | 30 -> - if String.unsafe_get s pos = 'e' - && String.unsafe_get s (pos + 1) = 'x' - && String.unsafe_get s (pos + 2) = 't' - && String.unsafe_get s (pos + 3) = 'e' - && String.unsafe_get s (pos + 4) = 'r' - && String.unsafe_get s (pos + 5) = 'n' - && String.unsafe_get s (pos + 6) = 'a' - && String.unsafe_get s (pos + 7) = 'l' - && String.unsafe_get s (pos + 8) = 'P' - && String.unsafe_get s (pos + 9) = 'r' - && String.unsafe_get s (pos + 10) = 'o' - && String.unsafe_get s (pos + 11) = 'p' - && String.unsafe_get s (pos + 12) = 'e' - && String.unsafe_get s (pos + 13) = 'r' - && String.unsafe_get s (pos + 14) = 't' - && String.unsafe_get s (pos + 15) = 'y' - && String.unsafe_get s (pos + 16) = 'F' - && String.unsafe_get s (pos + 17) = 'i' - && String.unsafe_get s (pos + 18) = 'l' - && String.unsafe_get s (pos + 19) = 'e' - && String.unsafe_get s (pos + 20) = 'R' - && String.unsafe_get s (pos + 21) = 'e' - && String.unsafe_get s (pos + 22) = 'f' - && String.unsafe_get s (pos + 23) = 'e' - && String.unsafe_get s (pos + 24) = 'r' - && String.unsafe_get s (pos + 25) = 'e' - && String.unsafe_get s (pos + 26) = 'n' - && String.unsafe_get s (pos + 27) = 'c' - && String.unsafe_get s (pos + 28) = 'e' - && String.unsafe_get s (pos + 29) = 's' - then 8 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' then ( + 23 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 18 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'e' then ( + 11 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' then ( + match String.unsafe_get s (pos+2) with + | 'l' -> ( + if String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'K' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'b' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'G' && String.unsafe_get s (pos+9) = 'u' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'A' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'E' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'g' then ( + 6 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'k' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'q' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'D' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'B' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'I' && String.unsafe_get s (pos+16) = 'd' && String.unsafe_get s (pos+17) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 22 + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'u' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'L' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'g' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'a' && String.unsafe_get s (pos+19) = 'g' && String.unsafe_get s (pos+20) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | 24 -> ( + if String.unsafe_get s pos = 'v' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'C' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 'P' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'v' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'n' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 'n' && String.unsafe_get s (pos+22) = 'c' && String.unsafe_get s (pos+23) = 'e' then ( + 25 + ) + else ( + -1 + ) + ) + | 30 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'P' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'y' && String.unsafe_get s (pos+16) = 'F' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 'R' && String.unsafe_get s (pos+21) = 'e' && String.unsafe_get s (pos+22) = 'f' && String.unsafe_get s (pos+23) = 'e' && String.unsafe_get s (pos+24) = 'r' && String.unsafe_get s (pos+25) = 'e' && String.unsafe_get s (pos+26) = 'n' && String.unsafe_get s (pos+27) = 'c' && String.unsafe_get s (pos+28) = 'e' && String.unsafe_get s (pos+29) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_addresses := Some (read__address_list p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_artifacts := Some (read__artifact_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_automation_details := Some (read_run_automation_details p lb) - | 3 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_baseline_guid := Some (read_run_baseline_guid p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_column_kind := Some (read_run_column_kind p lb) - | 5 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_conversion := Some (read_conversion p lb) - | 6 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_default_encoding := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 7 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_default_source_language := Some (Atdgen_runtime.Oj_run.read_string p lb) - | 8 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_external_property_file_references - := Some (read_external_property_file_references p lb) - | 9 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_graphs := Some (read__graph_list p lb) - | 10 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_invocations := Some (read__invocation_list p lb) - | 11 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_language := Some (read_run_language p lb) - | 12 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_logical_locations := Some (read__logical_location_list p lb) - | 13 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_newline_sequences := read__string_list p lb - | 14 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_original_uri_base_ids := Some (read_hm_str_al p lb) - | 15 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_policies := Some (read__tool_component_list p lb) - | 16 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 17 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_redaction_tokens := Some (read__string_list p lb) - | 18 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_results := Some (read__result_list p lb) - | 19 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_run_aggregates := Some (read__run_automation_details_list p lb) - | 20 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_special_locations := Some (read_special_locations p lb) - | 21 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_taxonomies := Some (read__tool_component_list p lb) - | 22 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_thread_flow_locations := Some (read__thread_flow_location_list p lb) - | 23 -> field_tool := Some (read_tool p lb) - | 24 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_translations := Some (read__tool_component_list p lb) - | 25 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_version_control_provenance - := Some (read__version_control_details_list p lb) - | 26 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_requests := Some (read__web_request_list p lb) - | 27 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_web_responses := Some (read__web_response_list p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ addresses = !field_addresses - ; artifacts = !field_artifacts - ; automation_details = !field_automation_details - ; baseline_guid = !field_baseline_guid - ; column_kind = !field_column_kind - ; conversion = !field_conversion - ; default_encoding = !field_default_encoding - ; default_source_language = !field_default_source_language - ; external_property_file_references = !field_external_property_file_references - ; graphs = !field_graphs - ; invocations = !field_invocations - ; language = !field_language - ; logical_locations = !field_logical_locations - ; newline_sequences = !field_newline_sequences - ; original_uri_base_ids = !field_original_uri_base_ids - ; policies = !field_policies - ; properties = !field_properties - ; redaction_tokens = !field_redaction_tokens - ; results = !field_results - ; run_aggregates = !field_run_aggregates - ; special_locations = !field_special_locations - ; taxonomies = !field_taxonomies - ; thread_flow_locations = !field_thread_flow_locations - ; tool = - (match !field_tool with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "tool") - ; translations = !field_translations - ; version_control_provenance = !field_version_control_provenance - ; web_requests = !field_web_requests - ; web_responses = !field_web_responses - } - : run) -;; - -let run_of_string s = read_run (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__run_list = Atdgen_runtime.Oj_run.write_list write_run - + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__address_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__artifact_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_automation_details := ( + Some ( + ( + read_run_automation_details + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_baseline_guid := ( + Some ( + ( + read_run_baseline_guid + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_column_kind := ( + Some ( + ( + read_run_column_kind + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_conversion + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_encoding := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_external_property_file_references := ( + Some ( + ( + read_external_property_file_references + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read__invocation_list + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_language := ( + Some ( + ( + read_run_language + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_newline_sequences := ( + ( + read__string_list + ) p lb + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_original_uri_base_ids := ( + Some ( + ( + read_hm_str_al + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_redaction_tokens := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read__result_list + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_aggregates := ( + Some ( + ( + read__run_automation_details_list + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_special_locations := ( + Some ( + ( + read_special_locations + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + ) + | 23 -> + field_tool := ( + Some ( + ( + read_tool + ) p lb + ) + ); + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version_control_provenance := ( + Some ( + ( + read__version_control_details_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__web_request_list + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__web_response_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'l' then ( + 23 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 'g' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'h' && String.unsafe_get s (pos+5) = 's' then ( + 9 + ) + else ( + -1 + ) + ) + | 7 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 's' then ( + 18 + ) + else ( + -1 + ) + ) + | 8 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'g' && String.unsafe_get s (pos+7) = 'e' then ( + 11 + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 's' then ( + 15 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 9 -> ( + if String.unsafe_get s pos = 'a' then ( + match String.unsafe_get s (pos+1) with + | 'd' -> ( + if String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' then ( + 0 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'f' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'c' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 10 -> ( + match String.unsafe_get s pos with + | 'c' -> ( + if String.unsafe_get s (pos+1) = 'o' then ( + match String.unsafe_get s (pos+2) with + | 'l' -> ( + if String.unsafe_get s (pos+3) = 'u' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'K' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'd' then ( + 4 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+3) = 'v' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 's' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' then ( + 5 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + else ( + -1 + ) + ) + | 'p' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 16 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 'x' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'm' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 21 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 11 -> ( + match String.unsafe_get s pos with + | 'i' -> ( + if String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'v' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 's' then ( + 10 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'q' && String.unsafe_get s (pos+6) = 'u' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 's' && String.unsafe_get s (pos+9) = 't' && String.unsafe_get s (pos+10) = 's' then ( + 26 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 12 -> ( + match String.unsafe_get s pos with + | 'b' -> ( + if String.unsafe_get s (pos+1) = 'a' && String.unsafe_get s (pos+2) = 's' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'l' && String.unsafe_get s (pos+5) = 'i' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'G' && String.unsafe_get s (pos+9) = 'u' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'd' then ( + 3 + ) + else ( + -1 + ) + ) + | 't' -> ( + if String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'a' && String.unsafe_get s (pos+3) = 'n' && String.unsafe_get s (pos+4) = 's' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 't' && String.unsafe_get s (pos+8) = 'i' && String.unsafe_get s (pos+9) = 'o' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 's' then ( + 24 + ) + else ( + -1 + ) + ) + | 'w' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'R' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 's' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 's' && String.unsafe_get s (pos+10) = 'e' && String.unsafe_get s (pos+11) = 's' then ( + 27 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 13 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 'A' && String.unsafe_get s (pos+4) = 'g' && String.unsafe_get s (pos+5) = 'g' && String.unsafe_get s (pos+6) = 'r' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'g' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 's' then ( + 19 + ) + else ( + -1 + ) + ) + | 15 -> ( + match String.unsafe_get s pos with + | 'd' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'E' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'd' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'g' then ( + 6 + ) + else ( + -1 + ) + ) + | 'r' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'd' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 't' && String.unsafe_get s (pos+6) = 'i' && String.unsafe_get s (pos+7) = 'o' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'T' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'k' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 's' then ( + 17 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 16 -> ( + match String.unsafe_get s pos with + | 'l' -> ( + if String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'c' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 12 + ) + else ( + -1 + ) + ) + | 'n' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'w' && String.unsafe_get s (pos+3) = 'l' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'e' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 'q' && String.unsafe_get s (pos+10) = 'u' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 'n' && String.unsafe_get s (pos+13) = 'c' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 's' then ( + 13 + ) + else ( + -1 + ) + ) + | 's' -> ( + if String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'e' && String.unsafe_get s (pos+3) = 'c' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 'l' && String.unsafe_get s (pos+7) = 'L' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'c' && String.unsafe_get s (pos+10) = 'a' && String.unsafe_get s (pos+11) = 't' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 'n' && String.unsafe_get s (pos+15) = 's' then ( + 20 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 17 -> ( + if String.unsafe_get s pos = 'a' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'm' && String.unsafe_get s (pos+5) = 'a' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 'D' && String.unsafe_get s (pos+11) = 'e' && String.unsafe_get s (pos+12) = 't' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 'i' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 18 -> ( + if String.unsafe_get s pos = 'o' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'i' && String.unsafe_get s (pos+3) = 'g' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'U' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'i' && String.unsafe_get s (pos+11) = 'B' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 's' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'I' && String.unsafe_get s (pos+16) = 'd' && String.unsafe_get s (pos+17) = 's' then ( + 14 + ) + else ( + -1 + ) + ) + | 19 -> ( + if String.unsafe_get s pos = 't' && String.unsafe_get s (pos+1) = 'h' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = 'F' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'w' && String.unsafe_get s (pos+10) = 'L' && String.unsafe_get s (pos+11) = 'o' && String.unsafe_get s (pos+12) = 'c' && String.unsafe_get s (pos+13) = 'a' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'i' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'n' && String.unsafe_get s (pos+18) = 's' then ( + 22 + ) + else ( + -1 + ) + ) + | 21 -> ( + if String.unsafe_get s pos = 'd' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'f' && String.unsafe_get s (pos+3) = 'a' && String.unsafe_get s (pos+4) = 'u' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'S' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'u' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'c' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'L' && String.unsafe_get s (pos+14) = 'a' && String.unsafe_get s (pos+15) = 'n' && String.unsafe_get s (pos+16) = 'g' && String.unsafe_get s (pos+17) = 'u' && String.unsafe_get s (pos+18) = 'a' && String.unsafe_get s (pos+19) = 'g' && String.unsafe_get s (pos+20) = 'e' then ( + 7 + ) + else ( + -1 + ) + ) + | 24 -> ( + if String.unsafe_get s pos = 'v' && String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' && String.unsafe_get s (pos+7) = 'C' && String.unsafe_get s (pos+8) = 'o' && String.unsafe_get s (pos+9) = 'n' && String.unsafe_get s (pos+10) = 't' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 'P' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'v' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'n' && String.unsafe_get s (pos+20) = 'a' && String.unsafe_get s (pos+21) = 'n' && String.unsafe_get s (pos+22) = 'c' && String.unsafe_get s (pos+23) = 'e' then ( + 25 + ) + else ( + -1 + ) + ) + | 30 -> ( + if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'x' && String.unsafe_get s (pos+2) = 't' && String.unsafe_get s (pos+3) = 'e' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'n' && String.unsafe_get s (pos+6) = 'a' && String.unsafe_get s (pos+7) = 'l' && String.unsafe_get s (pos+8) = 'P' && String.unsafe_get s (pos+9) = 'r' && String.unsafe_get s (pos+10) = 'o' && String.unsafe_get s (pos+11) = 'p' && String.unsafe_get s (pos+12) = 'e' && String.unsafe_get s (pos+13) = 'r' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = 'y' && String.unsafe_get s (pos+16) = 'F' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'l' && String.unsafe_get s (pos+19) = 'e' && String.unsafe_get s (pos+20) = 'R' && String.unsafe_get s (pos+21) = 'e' && String.unsafe_get s (pos+22) = 'f' && String.unsafe_get s (pos+23) = 'e' && String.unsafe_get s (pos+24) = 'r' && String.unsafe_get s (pos+25) = 'e' && String.unsafe_get s (pos+26) = 'n' && String.unsafe_get s (pos+27) = 'c' && String.unsafe_get s (pos+28) = 'e' && String.unsafe_get s (pos+29) = 's' then ( + 8 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_addresses := ( + Some ( + ( + read__address_list + ) p lb + ) + ); + ) + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_artifacts := ( + Some ( + ( + read__artifact_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_automation_details := ( + Some ( + ( + read_run_automation_details + ) p lb + ) + ); + ) + | 3 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_baseline_guid := ( + Some ( + ( + read_run_baseline_guid + ) p lb + ) + ); + ) + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_column_kind := ( + Some ( + ( + read_run_column_kind + ) p lb + ) + ); + ) + | 5 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_conversion := ( + Some ( + ( + read_conversion + ) p lb + ) + ); + ) + | 6 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_encoding := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 7 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_default_source_language := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | 8 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_external_property_file_references := ( + Some ( + ( + read_external_property_file_references + ) p lb + ) + ); + ) + | 9 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_graphs := ( + Some ( + ( + read__graph_list + ) p lb + ) + ); + ) + | 10 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_invocations := ( + Some ( + ( + read__invocation_list + ) p lb + ) + ); + ) + | 11 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_language := ( + Some ( + ( + read_run_language + ) p lb + ) + ); + ) + | 12 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_logical_locations := ( + Some ( + ( + read__logical_location_list + ) p lb + ) + ); + ) + | 13 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_newline_sequences := ( + ( + read__string_list + ) p lb + ); + ) + | 14 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_original_uri_base_ids := ( + Some ( + ( + read_hm_str_al + ) p lb + ) + ); + ) + | 15 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_policies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 16 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 17 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_redaction_tokens := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + ) + | 18 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_results := ( + Some ( + ( + read__result_list + ) p lb + ) + ); + ) + | 19 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_run_aggregates := ( + Some ( + ( + read__run_automation_details_list + ) p lb + ) + ); + ) + | 20 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_special_locations := ( + Some ( + ( + read_special_locations + ) p lb + ) + ); + ) + | 21 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_taxonomies := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 22 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_thread_flow_locations := ( + Some ( + ( + read__thread_flow_location_list + ) p lb + ) + ); + ) + | 23 -> + field_tool := ( + Some ( + ( + read_tool + ) p lb + ) + ); + | 24 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_translations := ( + Some ( + ( + read__tool_component_list + ) p lb + ) + ); + ) + | 25 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_version_control_provenance := ( + Some ( + ( + read__version_control_details_list + ) p lb + ) + ); + ) + | 26 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_requests := ( + Some ( + ( + read__web_request_list + ) p lb + ) + ); + ) + | 27 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_web_responses := ( + Some ( + ( + read__web_response_list + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + addresses = !field_addresses; + artifacts = !field_artifacts; + automation_details = !field_automation_details; + baseline_guid = !field_baseline_guid; + column_kind = !field_column_kind; + conversion = !field_conversion; + default_encoding = !field_default_encoding; + default_source_language = !field_default_source_language; + external_property_file_references = !field_external_property_file_references; + graphs = !field_graphs; + invocations = !field_invocations; + language = !field_language; + logical_locations = !field_logical_locations; + newline_sequences = !field_newline_sequences; + original_uri_base_ids = !field_original_uri_base_ids; + policies = !field_policies; + properties = !field_properties; + redaction_tokens = !field_redaction_tokens; + results = !field_results; + run_aggregates = !field_run_aggregates; + special_locations = !field_special_locations; + taxonomies = !field_taxonomies; + thread_flow_locations = !field_thread_flow_locations; + tool = (match !field_tool with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "tool"); + translations = !field_translations; + version_control_provenance = !field_version_control_provenance; + web_requests = !field_web_requests; + web_responses = !field_web_responses; + } + : run) + ) +) +let run_of_string s = + read_run (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__run_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_run + ) +) let string_of__run_list ?(len = 1024) x = let ob = Buffer.create len in write__run_list ob x; Buffer.contents ob -;; - -let read__run_list = Atdgen_runtime.Oj_run.read_list read_run - +let read__run_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_run + ) +) let _run_list_of_string s = read__run_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_properties_list = - Atdgen_runtime.Oj_run.write_list write_external_properties -;; - +let write__external_properties_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_external_properties + ) +) let string_of__external_properties_list ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_list ob x; Buffer.contents ob -;; - -let read__external_properties_list = - Atdgen_runtime.Oj_run.read_list read_external_properties -;; - +let read__external_properties_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_external_properties + ) +) let _external_properties_list_of_string s = read__external_properties_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write__external_properties_list_option = - Atdgen_runtime.Oj_run.write_std_option write__external_properties_list -;; - +let write__external_properties_list_option = ( + Atdgen_runtime.Oj_run.write_std_option ( + write__external_properties_list + ) +) let string_of__external_properties_list_option ?(len = 1024) x = let ob = Buffer.create len in write__external_properties_list_option ob x; Buffer.contents ob -;; - -let read__external_properties_list_option p lb = - Yojson.Safe.read_space p lb; - match Yojson.Safe.start_any_variant p lb with - | `Edgy_bracket -> - (match Yojson.Safe.read_ident p lb with - | "None" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (None : _ option) - | "Some" -> - Atdgen_runtime.Oj_run.read_until_field_value p lb; - let x = read__external_properties_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_gt p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Double_quote -> - (match Yojson.Safe.finish_string p lb with - | "None" -> (None : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) - | `Square_bracket -> - (match Atdgen_runtime.Oj_run.read_string p lb with - | "Some" -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_comma p lb; - Yojson.Safe.read_space p lb; - let x = read__external_properties_list p lb in - Yojson.Safe.read_space p lb; - Yojson.Safe.read_rbr p lb; - (Some x : _ option) - | x -> Atdgen_runtime.Oj_run.invalid_variant_tag p x) -;; - +let read__external_properties_list_option = ( + fun p lb -> + Yojson.Safe.read_space p lb; + match Yojson.Safe.start_any_variant p lb with + | `Edgy_bracket -> ( + match Yojson.Safe.read_ident p lb with + | "None" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (None : _ option) + | "Some" -> + Atdgen_runtime.Oj_run.read_until_field_value p lb; + let x = ( + read__external_properties_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_gt p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Double_quote -> ( + match Yojson.Safe.finish_string p lb with + | "None" -> + (None : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) + | `Square_bracket -> ( + match Atdgen_runtime.Oj_run.read_string p lb with + | "Some" -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_comma p lb; + Yojson.Safe.read_space p lb; + let x = ( + read__external_properties_list + ) p lb + in + Yojson.Safe.read_space p lb; + Yojson.Safe.read_rbr p lb; + (Some x : _ option) + | x -> + Atdgen_runtime.Oj_run.invalid_variant_tag p x + ) +) let _external_properties_list_option_of_string s = read__external_properties_list_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; - -let write_sarif_json_schema : _ -> sarif_json_schema -> _ = +let write_sarif_json_schema : _ -> sarif_json_schema -> _ = ( fun ob (x : sarif_json_schema) -> - Buffer.add_char ob '{'; - let is_first = ref true in - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"version\":"; - write_sarif_version ob x.version; - (match x.inline_external_properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"inlineExternalProperties\":"; - write__external_properties_list ob x); - (match x.properties with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"properties\":"; - write_property_bag ob x); - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"runs\":"; - write__run_list ob x.runs; - (match x.schema with - | None -> () - | Some x -> - if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"$schema\":"; - Yojson.Safe.write_string ob x); - Buffer.add_char ob '}' -;; - + Buffer.add_char ob '{'; + let is_first = ref true in + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"version\":"; + ( + write_sarif_version + ) + ob x.version; + (match x.inline_external_properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"inlineExternalProperties\":"; + ( + write__external_properties_list + ) + ob x; + ); + (match x.properties with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"properties\":"; + ( + write_property_bag + ) + ob x; + ); + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"runs\":"; + ( + write__run_list + ) + ob x.runs; + (match x.schema with None -> () | Some x -> + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"$schema\":"; + ( + Yojson.Safe.write_string + ) + ob x; + ); + Buffer.add_char ob '}'; +) let string_of_sarif_json_schema ?(len = 1024) x = let ob = Buffer.create len in write_sarif_json_schema ob x; Buffer.contents ob -;; - -let read_sarif_json_schema p lb = - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_version = ref None in - let field_inline_external_properties = ref None in - let field_properties = ref None in - let field_runs = ref None in - let field_schema = ref None in - try +let read_sarif_json_schema = ( + fun p lb -> Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end lb; - Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 's' - then 3 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | '$' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - then 4 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 0 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 24 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'E' - && String.unsafe_get s (pos + 7) = 'x' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 'P' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'p' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'r' - && String.unsafe_get s (pos + 20) = 't' - && String.unsafe_get s (pos + 21) = 'i' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 's' - then 1 - else -1 - | _ -> -1 - in - let i = Yojson.Safe.map_ident p f lb in - Atdgen_runtime.Oj_run.read_until_field_value p lb; - (match i with - | 0 -> field_version := Some (read_sarif_version p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_inline_external_properties := Some (read__external_properties_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_runs := Some (read__run_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_schema := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb); - while true do + Yojson.Safe.read_lcurl p lb; + let field_version = ref (None) in + let field_inline_external_properties = ref (None) in + let field_properties = ref (None) in + let field_runs = ref (None) in + let field_schema = ref (None) in + try Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_object_end lb; Yojson.Safe.read_space p lb; - let f s pos len = - if pos < 0 || len < 0 || pos + len > String.length s - then - invalid_arg - (Printf.sprintf - "out-of-bounds substring position or length: string = %S, requested \ - position = %i, requested length = %i" - s - pos - len); - match len with - | 4 -> - if String.unsafe_get s pos = 'r' - && String.unsafe_get s (pos + 1) = 'u' - && String.unsafe_get s (pos + 2) = 'n' - && String.unsafe_get s (pos + 3) = 's' - then 3 - else -1 - | 7 -> - (match String.unsafe_get s pos with - | '$' -> - if String.unsafe_get s (pos + 1) = 's' - && String.unsafe_get s (pos + 2) = 'c' - && String.unsafe_get s (pos + 3) = 'h' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'm' - && String.unsafe_get s (pos + 6) = 'a' - then 4 - else -1 - | 'v' -> - if String.unsafe_get s (pos + 1) = 'e' - && String.unsafe_get s (pos + 2) = 'r' - && String.unsafe_get s (pos + 3) = 's' - && String.unsafe_get s (pos + 4) = 'i' - && String.unsafe_get s (pos + 5) = 'o' - && String.unsafe_get s (pos + 6) = 'n' - then 0 - else -1 - | _ -> -1) - | 10 -> - if String.unsafe_get s pos = 'p' - && String.unsafe_get s (pos + 1) = 'r' - && String.unsafe_get s (pos + 2) = 'o' - && String.unsafe_get s (pos + 3) = 'p' - && String.unsafe_get s (pos + 4) = 'e' - && String.unsafe_get s (pos + 5) = 'r' - && String.unsafe_get s (pos + 6) = 't' - && String.unsafe_get s (pos + 7) = 'i' - && String.unsafe_get s (pos + 8) = 'e' - && String.unsafe_get s (pos + 9) = 's' - then 2 - else -1 - | 24 -> - if String.unsafe_get s pos = 'i' - && String.unsafe_get s (pos + 1) = 'n' - && String.unsafe_get s (pos + 2) = 'l' - && String.unsafe_get s (pos + 3) = 'i' - && String.unsafe_get s (pos + 4) = 'n' - && String.unsafe_get s (pos + 5) = 'e' - && String.unsafe_get s (pos + 6) = 'E' - && String.unsafe_get s (pos + 7) = 'x' - && String.unsafe_get s (pos + 8) = 't' - && String.unsafe_get s (pos + 9) = 'e' - && String.unsafe_get s (pos + 10) = 'r' - && String.unsafe_get s (pos + 11) = 'n' - && String.unsafe_get s (pos + 12) = 'a' - && String.unsafe_get s (pos + 13) = 'l' - && String.unsafe_get s (pos + 14) = 'P' - && String.unsafe_get s (pos + 15) = 'r' - && String.unsafe_get s (pos + 16) = 'o' - && String.unsafe_get s (pos + 17) = 'p' - && String.unsafe_get s (pos + 18) = 'e' - && String.unsafe_get s (pos + 19) = 'r' - && String.unsafe_get s (pos + 20) = 't' - && String.unsafe_get s (pos + 21) = 'i' - && String.unsafe_get s (pos + 22) = 'e' - && String.unsafe_get s (pos + 23) = 's' - then 1 - else -1 - | _ -> -1 + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | '$' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' then ( + 4 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 24 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'E' && String.unsafe_get s (pos+7) = 'x' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 'P' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'p' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'r' && String.unsafe_get s (pos+20) = 't' && String.unsafe_get s (pos+21) = 'i' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) in let i = Yojson.Safe.map_ident p f lb in Atdgen_runtime.Oj_run.read_until_field_value p lb; - match i with - | 0 -> field_version := Some (read_sarif_version p lb) - | 1 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then - field_inline_external_properties := Some (read__external_properties_list p lb) - | 2 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_properties := Some (read_property_bag p lb) - | 3 -> field_runs := Some (read__run_list p lb) - | 4 -> - if not (Yojson.Safe.read_null_if_possible p lb) - then field_schema := Some (Atdgen_runtime.Oj_run.read_string p lb) - | _ -> Yojson.Safe.skip_json p lb - done; - assert false - with - | Yojson.End_of_object -> - ({ version = - (match !field_version with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "version") - ; inline_external_properties = !field_inline_external_properties - ; properties = !field_properties - ; runs = - (match !field_runs with - | Some x -> x - | None -> Atdgen_runtime.Oj_run.missing_field p "runs") - ; schema = !field_schema - } - : sarif_json_schema) -;; - + ( + match i with + | 0 -> + field_version := ( + Some ( + ( + read_sarif_version + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inline_external_properties := ( + Some ( + ( + read__external_properties_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_runs := ( + Some ( + ( + read__run_list + ) p lb + ) + ); + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_schema := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + while true do + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_sep p lb; + Yojson.Safe.read_space p lb; + let f = + fun s pos len -> + if pos < 0 || len < 0 || pos + len > String.length s then + invalid_arg (Printf.sprintf "out-of-bounds substring position or length: string = %S, requested position = %i, requested length = %i" s pos len); + match len with + | 4 -> ( + if String.unsafe_get s pos = 'r' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'n' && String.unsafe_get s (pos+3) = 's' then ( + 3 + ) + else ( + -1 + ) + ) + | 7 -> ( + match String.unsafe_get s pos with + | '$' -> ( + if String.unsafe_get s (pos+1) = 's' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 'h' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'm' && String.unsafe_get s (pos+6) = 'a' then ( + 4 + ) + else ( + -1 + ) + ) + | 'v' -> ( + if String.unsafe_get s (pos+1) = 'e' && String.unsafe_get s (pos+2) = 'r' && String.unsafe_get s (pos+3) = 's' && String.unsafe_get s (pos+4) = 'i' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'n' then ( + 0 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + ) + | 10 -> ( + if String.unsafe_get s pos = 'p' && String.unsafe_get s (pos+1) = 'r' && String.unsafe_get s (pos+2) = 'o' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'e' && String.unsafe_get s (pos+5) = 'r' && String.unsafe_get s (pos+6) = 't' && String.unsafe_get s (pos+7) = 'i' && String.unsafe_get s (pos+8) = 'e' && String.unsafe_get s (pos+9) = 's' then ( + 2 + ) + else ( + -1 + ) + ) + | 24 -> ( + if String.unsafe_get s pos = 'i' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'i' && String.unsafe_get s (pos+4) = 'n' && String.unsafe_get s (pos+5) = 'e' && String.unsafe_get s (pos+6) = 'E' && String.unsafe_get s (pos+7) = 'x' && String.unsafe_get s (pos+8) = 't' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'r' && String.unsafe_get s (pos+11) = 'n' && String.unsafe_get s (pos+12) = 'a' && String.unsafe_get s (pos+13) = 'l' && String.unsafe_get s (pos+14) = 'P' && String.unsafe_get s (pos+15) = 'r' && String.unsafe_get s (pos+16) = 'o' && String.unsafe_get s (pos+17) = 'p' && String.unsafe_get s (pos+18) = 'e' && String.unsafe_get s (pos+19) = 'r' && String.unsafe_get s (pos+20) = 't' && String.unsafe_get s (pos+21) = 'i' && String.unsafe_get s (pos+22) = 'e' && String.unsafe_get s (pos+23) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | _ -> ( + -1 + ) + in + let i = Yojson.Safe.map_ident p f lb in + Atdgen_runtime.Oj_run.read_until_field_value p lb; + ( + match i with + | 0 -> + field_version := ( + Some ( + ( + read_sarif_version + ) p lb + ) + ); + | 1 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_inline_external_properties := ( + Some ( + ( + read__external_properties_list + ) p lb + ) + ); + ) + | 2 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_properties := ( + Some ( + ( + read_property_bag + ) p lb + ) + ); + ) + | 3 -> + field_runs := ( + Some ( + ( + read__run_list + ) p lb + ) + ); + | 4 -> + if not (Yojson.Safe.read_null_if_possible p lb) then ( + field_schema := ( + Some ( + ( + Atdgen_runtime.Oj_run.read_string + ) p lb + ) + ); + ) + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + version = (match !field_version with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "version"); + inline_external_properties = !field_inline_external_properties; + properties = !field_properties; + runs = (match !field_runs with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "runs"); + schema = !field_schema; + } + : sarif_json_schema) + ) +) let sarif_json_schema_of_string s = read_sarif_json_schema (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -;; diff --git a/lib/sarif_v_2_1_0_j.mli b/lib/sarif_v_2_1_0_j.mli index 1a45921..7fcbc34 100644 --- a/lib/sarif_v_2_1_0_j.mli +++ b/lib/sarif_v_2_1_0_j.mli @@ -2,3164 +2,3908 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype [@@deriving show, eq] +type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item [@@deriving show, eq] +type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) type external_properties_guid = Sarif_v_2_1_0_t.external_properties_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = Sarif_v_2_1_0_t.external_properties_run_guid -[@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = + Sarif_v_2_1_0_t.external_properties_run_guid + [@@deriving show,eq] -type external_properties_version = Sarif_v_2_1_0_t.external_properties_version -[@@deriving show, eq] +type external_properties_version = + Sarif_v_2_1_0_t.external_properties_version + [@@deriving show,eq] -type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show, eq] -type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show, eq] +type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show,eq] + +type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = Sarif_v_2_1_0_t.notification_level [@@deriving show, eq] +type notification_level = Sarif_v_2_1_0_t.notification_level + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = Sarif_v_2_1_0_t.property_bag [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = Sarif_v_2_1_0_t.address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = Sarif_v_2_1_0_t.property_bag + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = Sarif_v_2_1_0_t.address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = Sarif_v_2_1_0_t.logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = Sarif_v_2_1_0_t.logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = Sarif_v_2_1_0_t.message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = Sarif_v_2_1_0_t.message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = Sarif_v_2_1_0_t.artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = Sarif_v_2_1_0_t.artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = Sarif_v_2_1_0_t.edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = Sarif_v_2_1_0_t.edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = Sarif_v_2_1_0_t.location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = Sarif_v_2_1_0_t.multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = Sarif_v_2_1_0_t.location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = + Sarif_v_2_1_0_t.multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = Sarif_v_2_1_0_t.artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show, eq] +type artifact_content = Sarif_v_2_1_0_t.artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = Sarif_v_2_1_0_t.graph_traversal [@@deriving show, eq] +type graph_traversal = Sarif_v_2_1_0_t.graph_traversal + [@@deriving show,eq] (** An area within an image. *) -type rectangle = Sarif_v_2_1_0_t.rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = Sarif_v_2_1_0_t.rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = Sarif_v_2_1_0_t.region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = Sarif_v_2_1_0_t.region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = Sarif_v_2_1_0_t.attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = Sarif_v_2_1_0_t.physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = Sarif_v_2_1_0_t.attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = Sarif_v_2_1_0_t.physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = Sarif_v_2_1_0_t.location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = Sarif_v_2_1_0_t.location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = Sarif_v_2_1_0_t.replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = Sarif_v_2_1_0_t.replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = Sarif_v_2_1_0_t.artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = Sarif_v_2_1_0_t.artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = Sarif_v_2_1_0_t.fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = Sarif_v_2_1_0_t.fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = Sarif_v_2_1_0_t.reporting_configuration_level -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = + Sarif_v_2_1_0_t.reporting_configuration_level + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) type reporting_descriptor_deprecated_guids_item = Sarif_v_2_1_0_t.reporting_descriptor_deprecated_guids_item -[@@deriving show, eq] + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) type reporting_descriptor_guid = Sarif_v_2_1_0_t.reporting_descriptor_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) type reporting_descriptor_reference_guid = Sarif_v_2_1_0_t.reporting_descriptor_reference_guid -[@@deriving show, eq] + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state [@@deriving show, eq] +type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state + [@@deriving show,eq] -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) type result_correlation_guid = Sarif_v_2_1_0_t.result_correlation_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = Sarif_v_2_1_0_t.result_guid [@@deriving show, eq] +type result_guid = Sarif_v_2_1_0_t.result_guid + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = Sarif_v_2_1_0_t.result_kind [@@deriving show, eq] +type result_kind = Sarif_v_2_1_0_t.result_kind + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = Sarif_v_2_1_0_t.result_level [@@deriving show, eq] +type result_level = Sarif_v_2_1_0_t.result_level + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) type result_provenance_first_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_first_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) type result_provenance_last_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_last_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = Sarif_v_2_1_0_t.result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = Sarif_v_2_1_0_t.result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = Sarif_v_2_1_0_t.stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = Sarif_v_2_1_0_t.stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = Sarif_v_2_1_0_t.stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = Sarif_v_2_1_0_t.stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = Sarif_v_2_1_0_t.suppression_guid [@@deriving show, eq] +type suppression_guid = Sarif_v_2_1_0_t.suppression_guid + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = Sarif_v_2_1_0_t.suppression_kind [@@deriving show, eq] +type suppression_kind = Sarif_v_2_1_0_t.suppression_kind + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = Sarif_v_2_1_0_t.suppression_status [@@deriving show, eq] +type suppression_status = Sarif_v_2_1_0_t.suppression_status + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = Sarif_v_2_1_0_t.suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = Sarif_v_2_1_0_t.thread_flow_location_importance -[@@deriving show, eq] +type suppression = Sarif_v_2_1_0_t.suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = + Sarif_v_2_1_0_t.thread_flow_location_importance + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = Sarif_v_2_1_0_t.tool_component_contents_item -[@@deriving show, eq] - -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) +type tool_component_contents_item = + Sarif_v_2_1_0_t.tool_component_contents_item + [@@deriving show,eq] + +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) type tool_component_dotted_quad_file_version = Sarif_v_2_1_0_t.tool_component_dotted_quad_file_version -[@@deriving show, eq] + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) +type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) type tool_component_language = Sarif_v_2_1_0_t.tool_component_language -[@@deriving show, eq] + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = Sarif_v_2_1_0_t.tool_component_reference_guid -[@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = + Sarif_v_2_1_0_t.tool_component_reference_guid + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = Sarif_v_2_1_0_t.reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = + Sarif_v_2_1_0_t.reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = Sarif_v_2_1_0_t.configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = Sarif_v_2_1_0_t.configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) type reporting_descriptor_relationship = - Sarif_v_2_1_0_t.reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known + Sarif_v_2_1_0_t.reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = Sarif_v_2_1_0_t.tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = Sarif_v_2_1_0_t.tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = Sarif_v_2_1_0_t.tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = Sarif_v_2_1_0_t.tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = Sarif_v_2_1_0_t.web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = Sarif_v_2_1_0_t.web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = Sarif_v_2_1_0_t.web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = Sarif_v_2_1_0_t.web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = Sarif_v_2_1_0_t.thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = Sarif_v_2_1_0_t.thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = Sarif_v_2_1_0_t.code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = Sarif_v_2_1_0_t.code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = Sarif_v_2_1_0_t.node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = Sarif_v_2_1_0_t.exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = Sarif_v_2_1_0_t.node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = Sarif_v_2_1_0_t.exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = Sarif_v_2_1_0_t.graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = Sarif_v_2_1_0_t.graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = Sarif_v_2_1_0_t.result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = Sarif_v_2_1_0_t.result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = Sarif_v_2_1_0_t.notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = Sarif_v_2_1_0_t.notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = Sarif_v_2_1_0_t.invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = Sarif_v_2_1_0_t.invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = Sarif_v_2_1_0_t.conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = Sarif_v_2_1_0_t.artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = Sarif_v_2_1_0_t.conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = Sarif_v_2_1_0_t.artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = Sarif_v_2_1_0_t.external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = Sarif_v_2_1_0_t.version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = Sarif_v_2_1_0_t.external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = Sarif_v_2_1_0_t.version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = Sarif_v_2_1_0_t.special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = Sarif_v_2_1_0_t.run_language [@@deriving show, eq] +type special_locations = Sarif_v_2_1_0_t.special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = Sarif_v_2_1_0_t.run_language + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = Sarif_v_2_1_0_t.run_column_kind [@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = Sarif_v_2_1_0_t.run_automation_details_guid -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) +type run_column_kind = Sarif_v_2_1_0_t.run_column_kind + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = + Sarif_v_2_1_0_t.run_automation_details_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) type run_automation_details_correlation_guid = Sarif_v_2_1_0_t.run_automation_details_correlation_guid -[@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) type external_property_file_reference_guid = Sarif_v_2_1_0_t.external_property_file_reference_guid -[@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = Sarif_v_2_1_0_t.external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = + Sarif_v_2_1_0_t.external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) type external_property_file_references = - Sarif_v_2_1_0_t.external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = Sarif_v_2_1_0_t.run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the + Sarif_v_2_1_0_t.external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = Sarif_v_2_1_0_t.run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] - -(** Output a JSON value of type {!type:artifact_mimetype}. *) -val write_artifact_mimetype : Buffer.t -> artifact_mimetype -> unit - -(** Serialize a value of type {!type:artifact_mimetype} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact_mimetype : ?len:int -> artifact_mimetype -> string - -(** Input JSON data of type {!type:artifact_mimetype}. *) -val read_artifact_mimetype : Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_mimetype - -(** Deserialize JSON data of type {!type:artifact_mimetype}. *) -val artifact_mimetype_of_string : string -> artifact_mimetype - -(** Output a JSON value of type {!type:artifact_roles_item}. *) -val write_artifact_roles_item : Buffer.t -> artifact_roles_item -> unit - -(** Serialize a value of type {!type:artifact_roles_item} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact_roles_item : ?len:int -> artifact_roles_item -> string - -(** Input JSON data of type {!type:artifact_roles_item}. *) -val read_artifact_roles_item - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> artifact_roles_item - -(** Deserialize JSON data of type {!type:artifact_roles_item}. *) -val artifact_roles_item_of_string : string -> artifact_roles_item - -(** Output a JSON value of type {!type:external_properties_guid}. *) -val write_external_properties_guid : Buffer.t -> external_properties_guid -> unit - -(** Serialize a value of type {!type:external_properties_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_properties_guid : ?len:int -> external_properties_guid -> string - -(** Input JSON data of type {!type:external_properties_guid}. *) -val read_external_properties_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_properties_guid - -(** Deserialize JSON data of type {!type:external_properties_guid}. *) -val external_properties_guid_of_string : string -> external_properties_guid - -(** Output a JSON value of type {!type:external_properties_run_guid}. *) -val write_external_properties_run_guid : Buffer.t -> external_properties_run_guid -> unit - -(** Serialize a value of type {!type:external_properties_run_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_properties_run_guid - : ?len:int - -> external_properties_run_guid - -> string - -(** Input JSON data of type {!type:external_properties_run_guid}. *) -val read_external_properties_run_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_properties_run_guid - -(** Deserialize JSON data of type {!type:external_properties_run_guid}. *) -val external_properties_run_guid_of_string : string -> external_properties_run_guid - -(** Output a JSON value of type {!type:external_properties_version}. *) -val write_external_properties_version : Buffer.t -> external_properties_version -> unit - -(** Serialize a value of type {!type:external_properties_version} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_properties_version - : ?len:int - -> external_properties_version - -> string - -(** Input JSON data of type {!type:external_properties_version}. *) -val read_external_properties_version - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_properties_version - -(** Deserialize JSON data of type {!type:external_properties_version}. *) -val external_properties_version_of_string : string -> external_properties_version - -(** Output a JSON value of type {!type:hm_str_str}. *) -val write_hm_str_str : Buffer.t -> hm_str_str -> unit - -(** Serialize a value of type {!type:hm_str_str} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_hm_str_str : ?len:int -> hm_str_str -> string - -(** Input JSON data of type {!type:hm_str_str}. *) -val read_hm_str_str : Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_str - -(** Deserialize JSON data of type {!type:hm_str_str}. *) -val hm_str_str_of_string : string -> hm_str_str - -(** Output a JSON value of type {!type:int64}. *) -val write_int64 : Buffer.t -> int64 -> unit - -(** Serialize a value of type {!type:int64} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_int64 : ?len:int -> int64 -> string - -(** Input JSON data of type {!type:int64}. *) -val read_int64 : Yojson.Safe.lexer_state -> Lexing.lexbuf -> int64 - -(** Deserialize JSON data of type {!type:int64}. *) -val int64_of_string : string -> int64 - -(** Output a JSON value of type {!type:notification_level}. *) -val write_notification_level : Buffer.t -> notification_level -> unit - -(** Serialize a value of type {!type:notification_level} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_notification_level : ?len:int -> notification_level -> string - -(** Input JSON data of type {!type:notification_level}. *) -val read_notification_level - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> notification_level - -(** Deserialize JSON data of type {!type:notification_level}. *) -val notification_level_of_string : string -> notification_level - -(** Output a JSON value of type {!type:property_bag}. *) -val write_property_bag : Buffer.t -> property_bag -> unit - -(** Serialize a value of type {!type:property_bag} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_property_bag : ?len:int -> property_bag -> string - -(** Input JSON data of type {!type:property_bag}. *) -val read_property_bag : Yojson.Safe.lexer_state -> Lexing.lexbuf -> property_bag - -(** Deserialize JSON data of type {!type:property_bag}. *) -val property_bag_of_string : string -> property_bag - -(** Output a JSON value of type {!type:address}. *) -val write_address : Buffer.t -> address -> unit - -(** Serialize a value of type {!type:address} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_address : ?len:int -> address -> string - -(** Input JSON data of type {!type:address}. *) -val read_address : Yojson.Safe.lexer_state -> Lexing.lexbuf -> address - -(** Deserialize JSON data of type {!type:address}. *) -val address_of_string : string -> address - -(** Output a JSON value of type {!type:logical_location}. *) -val write_logical_location : Buffer.t -> logical_location -> unit - -(** Serialize a value of type {!type:logical_location} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_logical_location : ?len:int -> logical_location -> string - -(** Input JSON data of type {!type:logical_location}. *) -val read_logical_location : Yojson.Safe.lexer_state -> Lexing.lexbuf -> logical_location - -(** Deserialize JSON data of type {!type:logical_location}. *) -val logical_location_of_string : string -> logical_location - -(** Output a JSON value of type {!type:message}. *) -val write_message : Buffer.t -> message -> unit - -(** Serialize a value of type {!type:message} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_message : ?len:int -> message -> string - -(** Input JSON data of type {!type:message}. *) -val read_message : Yojson.Safe.lexer_state -> Lexing.lexbuf -> message - -(** Deserialize JSON data of type {!type:message}. *) -val message_of_string : string -> message - -(** Output a JSON value of type {!type:artifact_location}. *) -val write_artifact_location : Buffer.t -> artifact_location -> unit - -(** Serialize a value of type {!type:artifact_location} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact_location : ?len:int -> artifact_location -> string - -(** Input JSON data of type {!type:artifact_location}. *) -val read_artifact_location : Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_location - -(** Deserialize JSON data of type {!type:artifact_location}. *) -val artifact_location_of_string : string -> artifact_location - -(** Output a JSON value of type {!type:edge}. *) -val write_edge : Buffer.t -> edge -> unit - -(** Serialize a value of type {!type:edge} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_edge : ?len:int -> edge -> string - -(** Input JSON data of type {!type:edge}. *) -val read_edge : Yojson.Safe.lexer_state -> Lexing.lexbuf -> edge - -(** Deserialize JSON data of type {!type:edge}. *) -val edge_of_string : string -> edge - -(** Output a JSON value of type {!type:location_relationship}. *) -val write_location_relationship : Buffer.t -> location_relationship -> unit - -(** Serialize a value of type {!type:location_relationship} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_location_relationship : ?len:int -> location_relationship -> string - -(** Input JSON data of type {!type:location_relationship}. *) -val read_location_relationship - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> location_relationship - -(** Deserialize JSON data of type {!type:location_relationship}. *) -val location_relationship_of_string : string -> location_relationship - -(** Output a JSON value of type {!type:multiformat_message_string}. *) -val write_multiformat_message_string : Buffer.t -> multiformat_message_string -> unit - -(** Serialize a value of type {!type:multiformat_message_string} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_multiformat_message_string - : ?len:int - -> multiformat_message_string - -> string - -(** Input JSON data of type {!type:multiformat_message_string}. *) -val read_multiformat_message_string - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> multiformat_message_string - -(** Deserialize JSON data of type {!type:multiformat_message_string}. *) -val multiformat_message_string_of_string : string -> multiformat_message_string - -(** Output a JSON value of type {!type:artifact_content}. *) -val write_artifact_content : Buffer.t -> artifact_content -> unit - -(** Serialize a value of type {!type:artifact_content} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact_content : ?len:int -> artifact_content -> string - -(** Input JSON data of type {!type:artifact_content}. *) -val read_artifact_content : Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_content - -(** Deserialize JSON data of type {!type:artifact_content}. *) -val artifact_content_of_string : string -> artifact_content - -(** Output a JSON value of type {!type:hm_str_mms}. *) -val write_hm_str_mms : Buffer.t -> hm_str_mms -> unit - -(** Serialize a value of type {!type:hm_str_mms} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_hm_str_mms : ?len:int -> hm_str_mms -> string - -(** Input JSON data of type {!type:hm_str_mms}. *) -val read_hm_str_mms : Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_mms - -(** Deserialize JSON data of type {!type:hm_str_mms}. *) -val hm_str_mms_of_string : string -> hm_str_mms - -(** Output a JSON value of type {!type:edge_traversal}. *) -val write_edge_traversal : Buffer.t -> edge_traversal -> unit - -(** Serialize a value of type {!type:edge_traversal} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_edge_traversal : ?len:int -> edge_traversal -> string - -(** Input JSON data of type {!type:edge_traversal}. *) -val read_edge_traversal : Yojson.Safe.lexer_state -> Lexing.lexbuf -> edge_traversal - -(** Deserialize JSON data of type {!type:edge_traversal}. *) -val edge_traversal_of_string : string -> edge_traversal - -(** Output a JSON value of type {!type:graph_traversal_variant0}. *) -val write_graph_traversal_variant0 : Buffer.t -> graph_traversal_variant0 -> unit - -(** Serialize a value of type {!type:graph_traversal_variant0} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_graph_traversal_variant0 : ?len:int -> graph_traversal_variant0 -> string - -(** Input JSON data of type {!type:graph_traversal_variant0}. *) -val read_graph_traversal_variant0 - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> graph_traversal_variant0 - -(** Deserialize JSON data of type {!type:graph_traversal_variant0}. *) -val graph_traversal_variant0_of_string : string -> graph_traversal_variant0 - -(** Output a JSON value of type {!type:graph_traversal_variant1}. *) -val write_graph_traversal_variant1 : Buffer.t -> graph_traversal_variant1 -> unit - -(** Serialize a value of type {!type:graph_traversal_variant1} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_graph_traversal_variant1 : ?len:int -> graph_traversal_variant1 -> string - -(** Input JSON data of type {!type:graph_traversal_variant1}. *) -val read_graph_traversal_variant1 - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> graph_traversal_variant1 - -(** Deserialize JSON data of type {!type:graph_traversal_variant1}. *) -val graph_traversal_variant1_of_string : string -> graph_traversal_variant1 - -(** Output a JSON value of type {!type:graph_traversal}. *) -val write_graph_traversal : Buffer.t -> graph_traversal -> unit - -(** Serialize a value of type {!type:graph_traversal} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_graph_traversal : ?len:int -> graph_traversal -> string - -(** Input JSON data of type {!type:graph_traversal}. *) -val read_graph_traversal : Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph_traversal - -(** Deserialize JSON data of type {!type:graph_traversal}. *) -val graph_traversal_of_string : string -> graph_traversal - -(** Output a JSON value of type {!type:rectangle}. *) -val write_rectangle : Buffer.t -> rectangle -> unit - -(** Serialize a value of type {!type:rectangle} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_rectangle : ?len:int -> rectangle -> string - -(** Input JSON data of type {!type:rectangle}. *) -val read_rectangle : Yojson.Safe.lexer_state -> Lexing.lexbuf -> rectangle - -(** Deserialize JSON data of type {!type:rectangle}. *) -val rectangle_of_string : string -> rectangle - -(** Output a JSON value of type {!type:region}. *) -val write_region : Buffer.t -> region -> unit - -(** Serialize a value of type {!type:region} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_region : ?len:int -> region -> string - -(** Input JSON data of type {!type:region}. *) -val read_region : Yojson.Safe.lexer_state -> Lexing.lexbuf -> region - -(** Deserialize JSON data of type {!type:region}. *) -val region_of_string : string -> region - -(** Output a JSON value of type {!type:attachment}. *) -val write_attachment : Buffer.t -> attachment -> unit - -(** Serialize a value of type {!type:attachment} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_attachment : ?len:int -> attachment -> string - -(** Input JSON data of type {!type:attachment}. *) -val read_attachment : Yojson.Safe.lexer_state -> Lexing.lexbuf -> attachment - -(** Deserialize JSON data of type {!type:attachment}. *) -val attachment_of_string : string -> attachment - -(** Output a JSON value of type {!type:physical_location}. *) -val write_physical_location : Buffer.t -> physical_location -> unit - -(** Serialize a value of type {!type:physical_location} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_physical_location : ?len:int -> physical_location -> string - -(** Input JSON data of type {!type:physical_location}. *) -val read_physical_location : Yojson.Safe.lexer_state -> Lexing.lexbuf -> physical_location - -(** Deserialize JSON data of type {!type:physical_location}. *) -val physical_location_of_string : string -> physical_location - -(** Output a JSON value of type {!type:location}. *) -val write_location : Buffer.t -> location -> unit - -(** Serialize a value of type {!type:location} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_location : ?len:int -> location -> string - -(** Input JSON data of type {!type:location}. *) -val read_location : Yojson.Safe.lexer_state -> Lexing.lexbuf -> location - -(** Deserialize JSON data of type {!type:location}. *) -val location_of_string : string -> location - -(** Output a JSON value of type {!type:replacement}. *) -val write_replacement : Buffer.t -> replacement -> unit - -(** Serialize a value of type {!type:replacement} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_replacement : ?len:int -> replacement -> string - -(** Input JSON data of type {!type:replacement}. *) -val read_replacement : Yojson.Safe.lexer_state -> Lexing.lexbuf -> replacement - -(** Deserialize JSON data of type {!type:replacement}. *) -val replacement_of_string : string -> replacement - -(** Output a JSON value of type {!type:artifact_change}. *) -val write_artifact_change : Buffer.t -> artifact_change -> unit - -(** Serialize a value of type {!type:artifact_change} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact_change : ?len:int -> artifact_change -> string - -(** Input JSON data of type {!type:artifact_change}. *) -val read_artifact_change : Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_change - -(** Deserialize JSON data of type {!type:artifact_change}. *) -val artifact_change_of_string : string -> artifact_change - -(** Output a JSON value of type {!type:fix}. *) -val write_fix : Buffer.t -> fix -> unit - -(** Serialize a value of type {!type:fix} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_fix : ?len:int -> fix -> string - -(** Input JSON data of type {!type:fix}. *) -val read_fix : Yojson.Safe.lexer_state -> Lexing.lexbuf -> fix - -(** Deserialize JSON data of type {!type:fix}. *) -val fix_of_string : string -> fix - -(** Output a JSON value of type {!type:reporting_configuration_level}. *) -val write_reporting_configuration_level - : Buffer.t - -> reporting_configuration_level - -> unit - -(** Serialize a value of type {!type:reporting_configuration_level} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_configuration_level - : ?len:int - -> reporting_configuration_level - -> string - -(** Input JSON data of type {!type:reporting_configuration_level}. *) -val read_reporting_configuration_level - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_configuration_level - -(** Deserialize JSON data of type {!type:reporting_configuration_level}. *) -val reporting_configuration_level_of_string : string -> reporting_configuration_level - -(** Output a JSON value of type {!type:reporting_configuration}. *) -val write_reporting_configuration : Buffer.t -> reporting_configuration -> unit - -(** Serialize a value of type {!type:reporting_configuration} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_configuration : ?len:int -> reporting_configuration -> string - -(** Input JSON data of type {!type:reporting_configuration}. *) -val read_reporting_configuration - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_configuration - -(** Deserialize JSON data of type {!type:reporting_configuration}. *) -val reporting_configuration_of_string : string -> reporting_configuration - -(** Output a JSON value of type {!type:reporting_descriptor_deprecated_guids_item}. *) -val write_reporting_descriptor_deprecated_guids_item - : Buffer.t - -> reporting_descriptor_deprecated_guids_item - -> unit - -(** Serialize a value of type {!type:reporting_descriptor_deprecated_guids_item} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor_deprecated_guids_item - : ?len:int - -> reporting_descriptor_deprecated_guids_item - -> string - -(** Input JSON data of type {!type:reporting_descriptor_deprecated_guids_item}. *) -val read_reporting_descriptor_deprecated_guids_item - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor_deprecated_guids_item - -(** Deserialize JSON data of type {!type:reporting_descriptor_deprecated_guids_item}. *) -val reporting_descriptor_deprecated_guids_item_of_string - : string - -> reporting_descriptor_deprecated_guids_item - -(** Output a JSON value of type {!type:reporting_descriptor_guid}. *) -val write_reporting_descriptor_guid : Buffer.t -> reporting_descriptor_guid -> unit - -(** Serialize a value of type {!type:reporting_descriptor_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor_guid : ?len:int -> reporting_descriptor_guid -> string - -(** Input JSON data of type {!type:reporting_descriptor_guid}. *) -val read_reporting_descriptor_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor_guid - -(** Deserialize JSON data of type {!type:reporting_descriptor_guid}. *) -val reporting_descriptor_guid_of_string : string -> reporting_descriptor_guid - -(** Output a JSON value of type {!type:reporting_descriptor_reference_guid}. *) -val write_reporting_descriptor_reference_guid - : Buffer.t - -> reporting_descriptor_reference_guid - -> unit - -(** Serialize a value of type {!type:reporting_descriptor_reference_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor_reference_guid - : ?len:int - -> reporting_descriptor_reference_guid - -> string - -(** Input JSON data of type {!type:reporting_descriptor_reference_guid}. *) -val read_reporting_descriptor_reference_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor_reference_guid - -(** Deserialize JSON data of type {!type:reporting_descriptor_reference_guid}. *) -val reporting_descriptor_reference_guid_of_string - : string - -> reporting_descriptor_reference_guid - -(** Output a JSON value of type {!type:result_baseline_state}. *) -val write_result_baseline_state : Buffer.t -> result_baseline_state -> unit - -(** Serialize a value of type {!type:result_baseline_state} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_baseline_state : ?len:int -> result_baseline_state -> string - -(** Input JSON data of type {!type:result_baseline_state}. *) -val read_result_baseline_state - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> result_baseline_state - -(** Deserialize JSON data of type {!type:result_baseline_state}. *) -val result_baseline_state_of_string : string -> result_baseline_state - -(** Output a JSON value of type {!type:result_correlation_guid}. *) -val write_result_correlation_guid : Buffer.t -> result_correlation_guid -> unit - -(** Serialize a value of type {!type:result_correlation_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_correlation_guid : ?len:int -> result_correlation_guid -> string - -(** Input JSON data of type {!type:result_correlation_guid}. *) -val read_result_correlation_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> result_correlation_guid - -(** Deserialize JSON data of type {!type:result_correlation_guid}. *) -val result_correlation_guid_of_string : string -> result_correlation_guid - -(** Output a JSON value of type {!type:result_guid}. *) -val write_result_guid : Buffer.t -> result_guid -> unit - -(** Serialize a value of type {!type:result_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_guid : ?len:int -> result_guid -> string - -(** Input JSON data of type {!type:result_guid}. *) -val read_result_guid : Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_guid - -(** Deserialize JSON data of type {!type:result_guid}. *) -val result_guid_of_string : string -> result_guid - -(** Output a JSON value of type {!type:result_kind}. *) -val write_result_kind : Buffer.t -> result_kind -> unit - -(** Serialize a value of type {!type:result_kind} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_kind : ?len:int -> result_kind -> string - -(** Input JSON data of type {!type:result_kind}. *) -val read_result_kind : Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_kind - -(** Deserialize JSON data of type {!type:result_kind}. *) -val result_kind_of_string : string -> result_kind - -(** Output a JSON value of type {!type:result_level}. *) -val write_result_level : Buffer.t -> result_level -> unit - -(** Serialize a value of type {!type:result_level} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_level : ?len:int -> result_level -> string - -(** Input JSON data of type {!type:result_level}. *) -val read_result_level : Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_level - -(** Deserialize JSON data of type {!type:result_level}. *) -val result_level_of_string : string -> result_level - -(** Output a JSON value of type {!type:result_provenance_first_detection_run_guid}. *) -val write_result_provenance_first_detection_run_guid - : Buffer.t - -> result_provenance_first_detection_run_guid - -> unit - -(** Serialize a value of type {!type:result_provenance_first_detection_run_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_provenance_first_detection_run_guid - : ?len:int - -> result_provenance_first_detection_run_guid - -> string - -(** Input JSON data of type {!type:result_provenance_first_detection_run_guid}. *) -val read_result_provenance_first_detection_run_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> result_provenance_first_detection_run_guid - -(** Deserialize JSON data of type {!type:result_provenance_first_detection_run_guid}. *) -val result_provenance_first_detection_run_guid_of_string - : string - -> result_provenance_first_detection_run_guid - -(** Output a JSON value of type {!type:result_provenance_last_detection_run_guid}. *) -val write_result_provenance_last_detection_run_guid - : Buffer.t - -> result_provenance_last_detection_run_guid - -> unit - -(** Serialize a value of type {!type:result_provenance_last_detection_run_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_provenance_last_detection_run_guid - : ?len:int - -> result_provenance_last_detection_run_guid - -> string - -(** Input JSON data of type {!type:result_provenance_last_detection_run_guid}. *) -val read_result_provenance_last_detection_run_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> result_provenance_last_detection_run_guid - -(** Deserialize JSON data of type {!type:result_provenance_last_detection_run_guid}. *) -val result_provenance_last_detection_run_guid_of_string - : string - -> result_provenance_last_detection_run_guid - -(** Output a JSON value of type {!type:result_provenance}. *) -val write_result_provenance : Buffer.t -> result_provenance -> unit - -(** Serialize a value of type {!type:result_provenance} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result_provenance : ?len:int -> result_provenance -> string - -(** Input JSON data of type {!type:result_provenance}. *) -val read_result_provenance : Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_provenance - -(** Deserialize JSON data of type {!type:result_provenance}. *) -val result_provenance_of_string : string -> result_provenance - -(** Output a JSON value of type {!type:stack_frame}. *) -val write_stack_frame : Buffer.t -> stack_frame -> unit - -(** Serialize a value of type {!type:stack_frame} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_stack_frame : ?len:int -> stack_frame -> string - -(** Input JSON data of type {!type:stack_frame}. *) -val read_stack_frame : Yojson.Safe.lexer_state -> Lexing.lexbuf -> stack_frame - -(** Deserialize JSON data of type {!type:stack_frame}. *) -val stack_frame_of_string : string -> stack_frame - -(** Output a JSON value of type {!type:stack}. *) -val write_stack : Buffer.t -> stack -> unit - -(** Serialize a value of type {!type:stack} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_stack : ?len:int -> stack -> string - -(** Input JSON data of type {!type:stack}. *) -val read_stack : Yojson.Safe.lexer_state -> Lexing.lexbuf -> stack - -(** Deserialize JSON data of type {!type:stack}. *) -val stack_of_string : string -> stack - -(** Output a JSON value of type {!type:suppression_guid}. *) -val write_suppression_guid : Buffer.t -> suppression_guid -> unit - -(** Serialize a value of type {!type:suppression_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_suppression_guid : ?len:int -> suppression_guid -> string - -(** Input JSON data of type {!type:suppression_guid}. *) -val read_suppression_guid : Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression_guid - -(** Deserialize JSON data of type {!type:suppression_guid}. *) -val suppression_guid_of_string : string -> suppression_guid - -(** Output a JSON value of type {!type:suppression_kind}. *) -val write_suppression_kind : Buffer.t -> suppression_kind -> unit - -(** Serialize a value of type {!type:suppression_kind} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_suppression_kind : ?len:int -> suppression_kind -> string - -(** Input JSON data of type {!type:suppression_kind}. *) -val read_suppression_kind : Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression_kind - -(** Deserialize JSON data of type {!type:suppression_kind}. *) -val suppression_kind_of_string : string -> suppression_kind - -(** Output a JSON value of type {!type:suppression_status}. *) -val write_suppression_status : Buffer.t -> suppression_status -> unit - -(** Serialize a value of type {!type:suppression_status} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_suppression_status : ?len:int -> suppression_status -> string - -(** Input JSON data of type {!type:suppression_status}. *) -val read_suppression_status - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> suppression_status - -(** Deserialize JSON data of type {!type:suppression_status}. *) -val suppression_status_of_string : string -> suppression_status - -(** Output a JSON value of type {!type:suppression}. *) -val write_suppression : Buffer.t -> suppression -> unit - -(** Serialize a value of type {!type:suppression} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_suppression : ?len:int -> suppression -> string - -(** Input JSON data of type {!type:suppression}. *) -val read_suppression : Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression - -(** Deserialize JSON data of type {!type:suppression}. *) -val suppression_of_string : string -> suppression - -(** Output a JSON value of type {!type:thread_flow_location_importance}. *) -val write_thread_flow_location_importance - : Buffer.t - -> thread_flow_location_importance - -> unit - -(** Serialize a value of type {!type:thread_flow_location_importance} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_thread_flow_location_importance - : ?len:int - -> thread_flow_location_importance - -> string - -(** Input JSON data of type {!type:thread_flow_location_importance}. *) -val read_thread_flow_location_importance - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> thread_flow_location_importance - -(** Deserialize JSON data of type {!type:thread_flow_location_importance}. *) -val thread_flow_location_importance_of_string : string -> thread_flow_location_importance - -(** Output a JSON value of type {!type:tool_component_contents_item}. *) -val write_tool_component_contents_item : Buffer.t -> tool_component_contents_item -> unit - -(** Serialize a value of type {!type:tool_component_contents_item} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_contents_item - : ?len:int - -> tool_component_contents_item - -> string - -(** Input JSON data of type {!type:tool_component_contents_item}. *) -val read_tool_component_contents_item - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_contents_item - -(** Deserialize JSON data of type {!type:tool_component_contents_item}. *) -val tool_component_contents_item_of_string : string -> tool_component_contents_item - -(** Output a JSON value of type {!type:tool_component_dotted_quad_file_version}. *) -val write_tool_component_dotted_quad_file_version - : Buffer.t - -> tool_component_dotted_quad_file_version - -> unit - -(** Serialize a value of type {!type:tool_component_dotted_quad_file_version} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_dotted_quad_file_version - : ?len:int - -> tool_component_dotted_quad_file_version - -> string - -(** Input JSON data of type {!type:tool_component_dotted_quad_file_version}. *) -val read_tool_component_dotted_quad_file_version - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_dotted_quad_file_version - -(** Deserialize JSON data of type {!type:tool_component_dotted_quad_file_version}. *) -val tool_component_dotted_quad_file_version_of_string - : string - -> tool_component_dotted_quad_file_version - -(** Output a JSON value of type {!type:tool_component_guid}. *) -val write_tool_component_guid : Buffer.t -> tool_component_guid -> unit - -(** Serialize a value of type {!type:tool_component_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_guid : ?len:int -> tool_component_guid -> string - -(** Input JSON data of type {!type:tool_component_guid}. *) -val read_tool_component_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_guid - -(** Deserialize JSON data of type {!type:tool_component_guid}. *) -val tool_component_guid_of_string : string -> tool_component_guid - -(** Output a JSON value of type {!type:tool_component_language}. *) -val write_tool_component_language : Buffer.t -> tool_component_language -> unit - -(** Serialize a value of type {!type:tool_component_language} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_language : ?len:int -> tool_component_language -> string - -(** Input JSON data of type {!type:tool_component_language}. *) -val read_tool_component_language - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_language - -(** Deserialize JSON data of type {!type:tool_component_language}. *) -val tool_component_language_of_string : string -> tool_component_language - -(** Output a JSON value of type {!type:tool_component_reference_guid}. *) -val write_tool_component_reference_guid - : Buffer.t - -> tool_component_reference_guid - -> unit - -(** Serialize a value of type {!type:tool_component_reference_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_reference_guid - : ?len:int - -> tool_component_reference_guid - -> string - -(** Input JSON data of type {!type:tool_component_reference_guid}. *) -val read_tool_component_reference_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_reference_guid - -(** Deserialize JSON data of type {!type:tool_component_reference_guid}. *) -val tool_component_reference_guid_of_string : string -> tool_component_reference_guid - -(** Output a JSON value of type {!type:tool_component_reference}. *) -val write_tool_component_reference : Buffer.t -> tool_component_reference -> unit - -(** Serialize a value of type {!type:tool_component_reference} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component_reference : ?len:int -> tool_component_reference -> string - -(** Input JSON data of type {!type:tool_component_reference}. *) -val read_tool_component_reference - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> tool_component_reference - -(** Deserialize JSON data of type {!type:tool_component_reference}. *) -val tool_component_reference_of_string : string -> tool_component_reference - -(** Output a JSON value of type {!type:reporting_descriptor_reference}. *) -val write_reporting_descriptor_reference - : Buffer.t - -> reporting_descriptor_reference - -> unit - -(** Serialize a value of type {!type:reporting_descriptor_reference} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor_reference - : ?len:int - -> reporting_descriptor_reference - -> string - -(** Input JSON data of type {!type:reporting_descriptor_reference}. *) -val read_reporting_descriptor_reference - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor_reference - -(** Deserialize JSON data of type {!type:reporting_descriptor_reference}. *) -val reporting_descriptor_reference_of_string : string -> reporting_descriptor_reference - -(** Output a JSON value of type {!type:configuration_override}. *) -val write_configuration_override : Buffer.t -> configuration_override -> unit - -(** Serialize a value of type {!type:configuration_override} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_configuration_override : ?len:int -> configuration_override -> string - -(** Input JSON data of type {!type:configuration_override}. *) -val read_configuration_override - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> configuration_override - -(** Deserialize JSON data of type {!type:configuration_override}. *) -val configuration_override_of_string : string -> configuration_override - -(** Output a JSON value of type {!type:reporting_descriptor_relationship}. *) -val write_reporting_descriptor_relationship - : Buffer.t - -> reporting_descriptor_relationship - -> unit - -(** Serialize a value of type {!type:reporting_descriptor_relationship} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor_relationship - : ?len:int - -> reporting_descriptor_relationship - -> string - -(** Input JSON data of type {!type:reporting_descriptor_relationship}. *) -val read_reporting_descriptor_relationship - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor_relationship - -(** Deserialize JSON data of type {!type:reporting_descriptor_relationship}. *) -val reporting_descriptor_relationship_of_string - : string - -> reporting_descriptor_relationship - -(** Output a JSON value of type {!type:reporting_descriptor}. *) -val write_reporting_descriptor : Buffer.t -> reporting_descriptor -> unit - -(** Serialize a value of type {!type:reporting_descriptor} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_reporting_descriptor : ?len:int -> reporting_descriptor -> string - -(** Input JSON data of type {!type:reporting_descriptor}. *) -val read_reporting_descriptor - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> reporting_descriptor - -(** Deserialize JSON data of type {!type:reporting_descriptor}. *) -val reporting_descriptor_of_string : string -> reporting_descriptor - -(** Output a JSON value of type {!type:translation_metadata}. *) -val write_translation_metadata : Buffer.t -> translation_metadata -> unit - -(** Serialize a value of type {!type:translation_metadata} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_translation_metadata : ?len:int -> translation_metadata -> string - -(** Input JSON data of type {!type:translation_metadata}. *) -val read_translation_metadata - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> translation_metadata - -(** Deserialize JSON data of type {!type:translation_metadata}. *) -val translation_metadata_of_string : string -> translation_metadata - -(** Output a JSON value of type {!type:tool_component}. *) -val write_tool_component : Buffer.t -> tool_component -> unit - -(** Serialize a value of type {!type:tool_component} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool_component : ?len:int -> tool_component -> string - -(** Input JSON data of type {!type:tool_component}. *) -val read_tool_component : Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component - -(** Deserialize JSON data of type {!type:tool_component}. *) -val tool_component_of_string : string -> tool_component - -(** Output a JSON value of type {!type:tool}. *) -val write_tool : Buffer.t -> tool -> unit - -(** Serialize a value of type {!type:tool} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_tool : ?len:int -> tool -> string - -(** Input JSON data of type {!type:tool}. *) -val read_tool : Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool - -(** Deserialize JSON data of type {!type:tool}. *) -val tool_of_string : string -> tool - -(** Output a JSON value of type {!type:web_request}. *) -val write_web_request : Buffer.t -> web_request -> unit - -(** Serialize a value of type {!type:web_request} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_web_request : ?len:int -> web_request -> string - -(** Input JSON data of type {!type:web_request}. *) -val read_web_request : Yojson.Safe.lexer_state -> Lexing.lexbuf -> web_request - -(** Deserialize JSON data of type {!type:web_request}. *) -val web_request_of_string : string -> web_request - -(** Output a JSON value of type {!type:web_response}. *) -val write_web_response : Buffer.t -> web_response -> unit - -(** Serialize a value of type {!type:web_response} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_web_response : ?len:int -> web_response -> string - -(** Input JSON data of type {!type:web_response}. *) -val read_web_response : Yojson.Safe.lexer_state -> Lexing.lexbuf -> web_response - -(** Deserialize JSON data of type {!type:web_response}. *) -val web_response_of_string : string -> web_response - -(** Output a JSON value of type {!type:thread_flow_location}. *) -val write_thread_flow_location : Buffer.t -> thread_flow_location -> unit - -(** Serialize a value of type {!type:thread_flow_location} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_thread_flow_location : ?len:int -> thread_flow_location -> string - -(** Input JSON data of type {!type:thread_flow_location}. *) -val read_thread_flow_location - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> thread_flow_location - -(** Deserialize JSON data of type {!type:thread_flow_location}. *) -val thread_flow_location_of_string : string -> thread_flow_location - -(** Output a JSON value of type {!type:thread_flow}. *) -val write_thread_flow : Buffer.t -> thread_flow -> unit - -(** Serialize a value of type {!type:thread_flow} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_thread_flow : ?len:int -> thread_flow -> string - -(** Input JSON data of type {!type:thread_flow}. *) -val read_thread_flow : Yojson.Safe.lexer_state -> Lexing.lexbuf -> thread_flow - -(** Deserialize JSON data of type {!type:thread_flow}. *) -val thread_flow_of_string : string -> thread_flow - -(** Output a JSON value of type {!type:code_flow}. *) -val write_code_flow : Buffer.t -> code_flow -> unit - -(** Serialize a value of type {!type:code_flow} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_code_flow : ?len:int -> code_flow -> string - -(** Input JSON data of type {!type:code_flow}. *) -val read_code_flow : Yojson.Safe.lexer_state -> Lexing.lexbuf -> code_flow - -(** Deserialize JSON data of type {!type:code_flow}. *) -val code_flow_of_string : string -> code_flow - -(** Output a JSON value of type {!type:node}. *) -val write_node : Buffer.t -> node -> unit - -(** Serialize a value of type {!type:node} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_node : ?len:int -> node -> string - -(** Input JSON data of type {!type:node}. *) -val read_node : Yojson.Safe.lexer_state -> Lexing.lexbuf -> node - -(** Deserialize JSON data of type {!type:node}. *) -val node_of_string : string -> node - -(** Output a JSON value of type {!type:exception_}. *) -val write_exception_ : Buffer.t -> exception_ -> unit - -(** Serialize a value of type {!type:exception_} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_exception_ : ?len:int -> exception_ -> string - -(** Input JSON data of type {!type:exception_}. *) -val read_exception_ : Yojson.Safe.lexer_state -> Lexing.lexbuf -> exception_ - -(** Deserialize JSON data of type {!type:exception_}. *) -val exception__of_string : string -> exception_ + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] + +val write_artifact_mimetype : + Buffer.t -> artifact_mimetype -> unit + (** Output a JSON value of type {!type:artifact_mimetype}. *) + +val string_of_artifact_mimetype : + ?len:int -> artifact_mimetype -> string + (** Serialize a value of type {!type:artifact_mimetype} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact_mimetype : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_mimetype + (** Input JSON data of type {!type:artifact_mimetype}. *) + +val artifact_mimetype_of_string : + string -> artifact_mimetype + (** Deserialize JSON data of type {!type:artifact_mimetype}. *) + +val write_artifact_roles_item : + Buffer.t -> artifact_roles_item -> unit + (** Output a JSON value of type {!type:artifact_roles_item}. *) + +val string_of_artifact_roles_item : + ?len:int -> artifact_roles_item -> string + (** Serialize a value of type {!type:artifact_roles_item} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact_roles_item : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_roles_item + (** Input JSON data of type {!type:artifact_roles_item}. *) + +val artifact_roles_item_of_string : + string -> artifact_roles_item + (** Deserialize JSON data of type {!type:artifact_roles_item}. *) + +val write_external_properties_guid : + Buffer.t -> external_properties_guid -> unit + (** Output a JSON value of type {!type:external_properties_guid}. *) + +val string_of_external_properties_guid : + ?len:int -> external_properties_guid -> string + (** Serialize a value of type {!type:external_properties_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_properties_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_properties_guid + (** Input JSON data of type {!type:external_properties_guid}. *) + +val external_properties_guid_of_string : + string -> external_properties_guid + (** Deserialize JSON data of type {!type:external_properties_guid}. *) + +val write_external_properties_run_guid : + Buffer.t -> external_properties_run_guid -> unit + (** Output a JSON value of type {!type:external_properties_run_guid}. *) + +val string_of_external_properties_run_guid : + ?len:int -> external_properties_run_guid -> string + (** Serialize a value of type {!type:external_properties_run_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_properties_run_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_properties_run_guid + (** Input JSON data of type {!type:external_properties_run_guid}. *) + +val external_properties_run_guid_of_string : + string -> external_properties_run_guid + (** Deserialize JSON data of type {!type:external_properties_run_guid}. *) + +val write_external_properties_version : + Buffer.t -> external_properties_version -> unit + (** Output a JSON value of type {!type:external_properties_version}. *) + +val string_of_external_properties_version : + ?len:int -> external_properties_version -> string + (** Serialize a value of type {!type:external_properties_version} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_properties_version : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_properties_version + (** Input JSON data of type {!type:external_properties_version}. *) + +val external_properties_version_of_string : + string -> external_properties_version + (** Deserialize JSON data of type {!type:external_properties_version}. *) + +val write_hm_str_str : + Buffer.t -> hm_str_str -> unit + (** Output a JSON value of type {!type:hm_str_str}. *) + +val string_of_hm_str_str : + ?len:int -> hm_str_str -> string + (** Serialize a value of type {!type:hm_str_str} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_hm_str_str : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_str + (** Input JSON data of type {!type:hm_str_str}. *) + +val hm_str_str_of_string : + string -> hm_str_str + (** Deserialize JSON data of type {!type:hm_str_str}. *) + +val write_int64 : + Buffer.t -> int64 -> unit + (** Output a JSON value of type {!type:int64}. *) + +val string_of_int64 : + ?len:int -> int64 -> string + (** Serialize a value of type {!type:int64} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_int64 : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> int64 + (** Input JSON data of type {!type:int64}. *) + +val int64_of_string : + string -> int64 + (** Deserialize JSON data of type {!type:int64}. *) + +val write_notification_level : + Buffer.t -> notification_level -> unit + (** Output a JSON value of type {!type:notification_level}. *) + +val string_of_notification_level : + ?len:int -> notification_level -> string + (** Serialize a value of type {!type:notification_level} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_notification_level : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> notification_level + (** Input JSON data of type {!type:notification_level}. *) + +val notification_level_of_string : + string -> notification_level + (** Deserialize JSON data of type {!type:notification_level}. *) + +val write_property_bag : + Buffer.t -> property_bag -> unit + (** Output a JSON value of type {!type:property_bag}. *) + +val string_of_property_bag : + ?len:int -> property_bag -> string + (** Serialize a value of type {!type:property_bag} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_property_bag : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> property_bag + (** Input JSON data of type {!type:property_bag}. *) + +val property_bag_of_string : + string -> property_bag + (** Deserialize JSON data of type {!type:property_bag}. *) + +val write_address : + Buffer.t -> address -> unit + (** Output a JSON value of type {!type:address}. *) + +val string_of_address : + ?len:int -> address -> string + (** Serialize a value of type {!type:address} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_address : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> address + (** Input JSON data of type {!type:address}. *) + +val address_of_string : + string -> address + (** Deserialize JSON data of type {!type:address}. *) + +val write_logical_location : + Buffer.t -> logical_location -> unit + (** Output a JSON value of type {!type:logical_location}. *) + +val string_of_logical_location : + ?len:int -> logical_location -> string + (** Serialize a value of type {!type:logical_location} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_logical_location : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> logical_location + (** Input JSON data of type {!type:logical_location}. *) + +val logical_location_of_string : + string -> logical_location + (** Deserialize JSON data of type {!type:logical_location}. *) + +val write_message : + Buffer.t -> message -> unit + (** Output a JSON value of type {!type:message}. *) + +val string_of_message : + ?len:int -> message -> string + (** Serialize a value of type {!type:message} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_message : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> message + (** Input JSON data of type {!type:message}. *) + +val message_of_string : + string -> message + (** Deserialize JSON data of type {!type:message}. *) + +val write_artifact_location : + Buffer.t -> artifact_location -> unit + (** Output a JSON value of type {!type:artifact_location}. *) + +val string_of_artifact_location : + ?len:int -> artifact_location -> string + (** Serialize a value of type {!type:artifact_location} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact_location : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_location + (** Input JSON data of type {!type:artifact_location}. *) + +val artifact_location_of_string : + string -> artifact_location + (** Deserialize JSON data of type {!type:artifact_location}. *) + +val write_edge : + Buffer.t -> edge -> unit + (** Output a JSON value of type {!type:edge}. *) + +val string_of_edge : + ?len:int -> edge -> string + (** Serialize a value of type {!type:edge} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_edge : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> edge + (** Input JSON data of type {!type:edge}. *) + +val edge_of_string : + string -> edge + (** Deserialize JSON data of type {!type:edge}. *) + +val write_location_relationship : + Buffer.t -> location_relationship -> unit + (** Output a JSON value of type {!type:location_relationship}. *) + +val string_of_location_relationship : + ?len:int -> location_relationship -> string + (** Serialize a value of type {!type:location_relationship} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_location_relationship : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> location_relationship + (** Input JSON data of type {!type:location_relationship}. *) + +val location_relationship_of_string : + string -> location_relationship + (** Deserialize JSON data of type {!type:location_relationship}. *) + +val write_multiformat_message_string : + Buffer.t -> multiformat_message_string -> unit + (** Output a JSON value of type {!type:multiformat_message_string}. *) + +val string_of_multiformat_message_string : + ?len:int -> multiformat_message_string -> string + (** Serialize a value of type {!type:multiformat_message_string} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_multiformat_message_string : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> multiformat_message_string + (** Input JSON data of type {!type:multiformat_message_string}. *) + +val multiformat_message_string_of_string : + string -> multiformat_message_string + (** Deserialize JSON data of type {!type:multiformat_message_string}. *) + +val write_artifact_content : + Buffer.t -> artifact_content -> unit + (** Output a JSON value of type {!type:artifact_content}. *) + +val string_of_artifact_content : + ?len:int -> artifact_content -> string + (** Serialize a value of type {!type:artifact_content} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact_content : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_content + (** Input JSON data of type {!type:artifact_content}. *) + +val artifact_content_of_string : + string -> artifact_content + (** Deserialize JSON data of type {!type:artifact_content}. *) + +val write_hm_str_mms : + Buffer.t -> hm_str_mms -> unit + (** Output a JSON value of type {!type:hm_str_mms}. *) + +val string_of_hm_str_mms : + ?len:int -> hm_str_mms -> string + (** Serialize a value of type {!type:hm_str_mms} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_hm_str_mms : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_mms + (** Input JSON data of type {!type:hm_str_mms}. *) + +val hm_str_mms_of_string : + string -> hm_str_mms + (** Deserialize JSON data of type {!type:hm_str_mms}. *) + +val write_edge_traversal : + Buffer.t -> edge_traversal -> unit + (** Output a JSON value of type {!type:edge_traversal}. *) + +val string_of_edge_traversal : + ?len:int -> edge_traversal -> string + (** Serialize a value of type {!type:edge_traversal} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_edge_traversal : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> edge_traversal + (** Input JSON data of type {!type:edge_traversal}. *) + +val edge_traversal_of_string : + string -> edge_traversal + (** Deserialize JSON data of type {!type:edge_traversal}. *) + +val write_graph_traversal_variant0 : + Buffer.t -> graph_traversal_variant0 -> unit + (** Output a JSON value of type {!type:graph_traversal_variant0}. *) + +val string_of_graph_traversal_variant0 : + ?len:int -> graph_traversal_variant0 -> string + (** Serialize a value of type {!type:graph_traversal_variant0} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_graph_traversal_variant0 : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph_traversal_variant0 + (** Input JSON data of type {!type:graph_traversal_variant0}. *) + +val graph_traversal_variant0_of_string : + string -> graph_traversal_variant0 + (** Deserialize JSON data of type {!type:graph_traversal_variant0}. *) + +val write_graph_traversal_variant1 : + Buffer.t -> graph_traversal_variant1 -> unit + (** Output a JSON value of type {!type:graph_traversal_variant1}. *) + +val string_of_graph_traversal_variant1 : + ?len:int -> graph_traversal_variant1 -> string + (** Serialize a value of type {!type:graph_traversal_variant1} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_graph_traversal_variant1 : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph_traversal_variant1 + (** Input JSON data of type {!type:graph_traversal_variant1}. *) + +val graph_traversal_variant1_of_string : + string -> graph_traversal_variant1 + (** Deserialize JSON data of type {!type:graph_traversal_variant1}. *) + +val write_graph_traversal : + Buffer.t -> graph_traversal -> unit + (** Output a JSON value of type {!type:graph_traversal}. *) + +val string_of_graph_traversal : + ?len:int -> graph_traversal -> string + (** Serialize a value of type {!type:graph_traversal} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_graph_traversal : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph_traversal + (** Input JSON data of type {!type:graph_traversal}. *) + +val graph_traversal_of_string : + string -> graph_traversal + (** Deserialize JSON data of type {!type:graph_traversal}. *) + +val write_rectangle : + Buffer.t -> rectangle -> unit + (** Output a JSON value of type {!type:rectangle}. *) + +val string_of_rectangle : + ?len:int -> rectangle -> string + (** Serialize a value of type {!type:rectangle} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_rectangle : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> rectangle + (** Input JSON data of type {!type:rectangle}. *) + +val rectangle_of_string : + string -> rectangle + (** Deserialize JSON data of type {!type:rectangle}. *) + +val write_region : + Buffer.t -> region -> unit + (** Output a JSON value of type {!type:region}. *) + +val string_of_region : + ?len:int -> region -> string + (** Serialize a value of type {!type:region} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_region : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> region + (** Input JSON data of type {!type:region}. *) + +val region_of_string : + string -> region + (** Deserialize JSON data of type {!type:region}. *) + +val write_attachment : + Buffer.t -> attachment -> unit + (** Output a JSON value of type {!type:attachment}. *) + +val string_of_attachment : + ?len:int -> attachment -> string + (** Serialize a value of type {!type:attachment} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_attachment : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> attachment + (** Input JSON data of type {!type:attachment}. *) + +val attachment_of_string : + string -> attachment + (** Deserialize JSON data of type {!type:attachment}. *) + +val write_physical_location : + Buffer.t -> physical_location -> unit + (** Output a JSON value of type {!type:physical_location}. *) + +val string_of_physical_location : + ?len:int -> physical_location -> string + (** Serialize a value of type {!type:physical_location} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_physical_location : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> physical_location + (** Input JSON data of type {!type:physical_location}. *) + +val physical_location_of_string : + string -> physical_location + (** Deserialize JSON data of type {!type:physical_location}. *) + +val write_location : + Buffer.t -> location -> unit + (** Output a JSON value of type {!type:location}. *) + +val string_of_location : + ?len:int -> location -> string + (** Serialize a value of type {!type:location} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_location : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> location + (** Input JSON data of type {!type:location}. *) + +val location_of_string : + string -> location + (** Deserialize JSON data of type {!type:location}. *) + +val write_replacement : + Buffer.t -> replacement -> unit + (** Output a JSON value of type {!type:replacement}. *) + +val string_of_replacement : + ?len:int -> replacement -> string + (** Serialize a value of type {!type:replacement} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_replacement : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> replacement + (** Input JSON data of type {!type:replacement}. *) + +val replacement_of_string : + string -> replacement + (** Deserialize JSON data of type {!type:replacement}. *) + +val write_artifact_change : + Buffer.t -> artifact_change -> unit + (** Output a JSON value of type {!type:artifact_change}. *) + +val string_of_artifact_change : + ?len:int -> artifact_change -> string + (** Serialize a value of type {!type:artifact_change} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact_change : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact_change + (** Input JSON data of type {!type:artifact_change}. *) + +val artifact_change_of_string : + string -> artifact_change + (** Deserialize JSON data of type {!type:artifact_change}. *) + +val write_fix : + Buffer.t -> fix -> unit + (** Output a JSON value of type {!type:fix}. *) + +val string_of_fix : + ?len:int -> fix -> string + (** Serialize a value of type {!type:fix} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_fix : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> fix + (** Input JSON data of type {!type:fix}. *) + +val fix_of_string : + string -> fix + (** Deserialize JSON data of type {!type:fix}. *) + +val write_reporting_configuration_level : + Buffer.t -> reporting_configuration_level -> unit + (** Output a JSON value of type {!type:reporting_configuration_level}. *) + +val string_of_reporting_configuration_level : + ?len:int -> reporting_configuration_level -> string + (** Serialize a value of type {!type:reporting_configuration_level} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_configuration_level : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_configuration_level + (** Input JSON data of type {!type:reporting_configuration_level}. *) + +val reporting_configuration_level_of_string : + string -> reporting_configuration_level + (** Deserialize JSON data of type {!type:reporting_configuration_level}. *) + +val write_reporting_configuration : + Buffer.t -> reporting_configuration -> unit + (** Output a JSON value of type {!type:reporting_configuration}. *) + +val string_of_reporting_configuration : + ?len:int -> reporting_configuration -> string + (** Serialize a value of type {!type:reporting_configuration} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_configuration : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_configuration + (** Input JSON data of type {!type:reporting_configuration}. *) + +val reporting_configuration_of_string : + string -> reporting_configuration + (** Deserialize JSON data of type {!type:reporting_configuration}. *) + +val write_reporting_descriptor_deprecated_guids_item : + Buffer.t -> reporting_descriptor_deprecated_guids_item -> unit + (** Output a JSON value of type {!type:reporting_descriptor_deprecated_guids_item}. *) + +val string_of_reporting_descriptor_deprecated_guids_item : + ?len:int -> reporting_descriptor_deprecated_guids_item -> string + (** Serialize a value of type {!type:reporting_descriptor_deprecated_guids_item} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor_deprecated_guids_item : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor_deprecated_guids_item + (** Input JSON data of type {!type:reporting_descriptor_deprecated_guids_item}. *) + +val reporting_descriptor_deprecated_guids_item_of_string : + string -> reporting_descriptor_deprecated_guids_item + (** Deserialize JSON data of type {!type:reporting_descriptor_deprecated_guids_item}. *) + +val write_reporting_descriptor_guid : + Buffer.t -> reporting_descriptor_guid -> unit + (** Output a JSON value of type {!type:reporting_descriptor_guid}. *) + +val string_of_reporting_descriptor_guid : + ?len:int -> reporting_descriptor_guid -> string + (** Serialize a value of type {!type:reporting_descriptor_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor_guid + (** Input JSON data of type {!type:reporting_descriptor_guid}. *) + +val reporting_descriptor_guid_of_string : + string -> reporting_descriptor_guid + (** Deserialize JSON data of type {!type:reporting_descriptor_guid}. *) + +val write_reporting_descriptor_reference_guid : + Buffer.t -> reporting_descriptor_reference_guid -> unit + (** Output a JSON value of type {!type:reporting_descriptor_reference_guid}. *) + +val string_of_reporting_descriptor_reference_guid : + ?len:int -> reporting_descriptor_reference_guid -> string + (** Serialize a value of type {!type:reporting_descriptor_reference_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor_reference_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor_reference_guid + (** Input JSON data of type {!type:reporting_descriptor_reference_guid}. *) + +val reporting_descriptor_reference_guid_of_string : + string -> reporting_descriptor_reference_guid + (** Deserialize JSON data of type {!type:reporting_descriptor_reference_guid}. *) + +val write_result_baseline_state : + Buffer.t -> result_baseline_state -> unit + (** Output a JSON value of type {!type:result_baseline_state}. *) + +val string_of_result_baseline_state : + ?len:int -> result_baseline_state -> string + (** Serialize a value of type {!type:result_baseline_state} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_baseline_state : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_baseline_state + (** Input JSON data of type {!type:result_baseline_state}. *) + +val result_baseline_state_of_string : + string -> result_baseline_state + (** Deserialize JSON data of type {!type:result_baseline_state}. *) + +val write_result_correlation_guid : + Buffer.t -> result_correlation_guid -> unit + (** Output a JSON value of type {!type:result_correlation_guid}. *) + +val string_of_result_correlation_guid : + ?len:int -> result_correlation_guid -> string + (** Serialize a value of type {!type:result_correlation_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_correlation_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_correlation_guid + (** Input JSON data of type {!type:result_correlation_guid}. *) + +val result_correlation_guid_of_string : + string -> result_correlation_guid + (** Deserialize JSON data of type {!type:result_correlation_guid}. *) + +val write_result_guid : + Buffer.t -> result_guid -> unit + (** Output a JSON value of type {!type:result_guid}. *) + +val string_of_result_guid : + ?len:int -> result_guid -> string + (** Serialize a value of type {!type:result_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_guid + (** Input JSON data of type {!type:result_guid}. *) + +val result_guid_of_string : + string -> result_guid + (** Deserialize JSON data of type {!type:result_guid}. *) + +val write_result_kind : + Buffer.t -> result_kind -> unit + (** Output a JSON value of type {!type:result_kind}. *) + +val string_of_result_kind : + ?len:int -> result_kind -> string + (** Serialize a value of type {!type:result_kind} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_kind : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_kind + (** Input JSON data of type {!type:result_kind}. *) + +val result_kind_of_string : + string -> result_kind + (** Deserialize JSON data of type {!type:result_kind}. *) + +val write_result_level : + Buffer.t -> result_level -> unit + (** Output a JSON value of type {!type:result_level}. *) + +val string_of_result_level : + ?len:int -> result_level -> string + (** Serialize a value of type {!type:result_level} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_level : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_level + (** Input JSON data of type {!type:result_level}. *) + +val result_level_of_string : + string -> result_level + (** Deserialize JSON data of type {!type:result_level}. *) + +val write_result_provenance_first_detection_run_guid : + Buffer.t -> result_provenance_first_detection_run_guid -> unit + (** Output a JSON value of type {!type:result_provenance_first_detection_run_guid}. *) + +val string_of_result_provenance_first_detection_run_guid : + ?len:int -> result_provenance_first_detection_run_guid -> string + (** Serialize a value of type {!type:result_provenance_first_detection_run_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_provenance_first_detection_run_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_provenance_first_detection_run_guid + (** Input JSON data of type {!type:result_provenance_first_detection_run_guid}. *) + +val result_provenance_first_detection_run_guid_of_string : + string -> result_provenance_first_detection_run_guid + (** Deserialize JSON data of type {!type:result_provenance_first_detection_run_guid}. *) + +val write_result_provenance_last_detection_run_guid : + Buffer.t -> result_provenance_last_detection_run_guid -> unit + (** Output a JSON value of type {!type:result_provenance_last_detection_run_guid}. *) + +val string_of_result_provenance_last_detection_run_guid : + ?len:int -> result_provenance_last_detection_run_guid -> string + (** Serialize a value of type {!type:result_provenance_last_detection_run_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_provenance_last_detection_run_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_provenance_last_detection_run_guid + (** Input JSON data of type {!type:result_provenance_last_detection_run_guid}. *) + +val result_provenance_last_detection_run_guid_of_string : + string -> result_provenance_last_detection_run_guid + (** Deserialize JSON data of type {!type:result_provenance_last_detection_run_guid}. *) + +val write_result_provenance : + Buffer.t -> result_provenance -> unit + (** Output a JSON value of type {!type:result_provenance}. *) + +val string_of_result_provenance : + ?len:int -> result_provenance -> string + (** Serialize a value of type {!type:result_provenance} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result_provenance : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result_provenance + (** Input JSON data of type {!type:result_provenance}. *) + +val result_provenance_of_string : + string -> result_provenance + (** Deserialize JSON data of type {!type:result_provenance}. *) + +val write_stack_frame : + Buffer.t -> stack_frame -> unit + (** Output a JSON value of type {!type:stack_frame}. *) + +val string_of_stack_frame : + ?len:int -> stack_frame -> string + (** Serialize a value of type {!type:stack_frame} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_stack_frame : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> stack_frame + (** Input JSON data of type {!type:stack_frame}. *) + +val stack_frame_of_string : + string -> stack_frame + (** Deserialize JSON data of type {!type:stack_frame}. *) + +val write_stack : + Buffer.t -> stack -> unit + (** Output a JSON value of type {!type:stack}. *) + +val string_of_stack : + ?len:int -> stack -> string + (** Serialize a value of type {!type:stack} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_stack : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> stack + (** Input JSON data of type {!type:stack}. *) + +val stack_of_string : + string -> stack + (** Deserialize JSON data of type {!type:stack}. *) + +val write_suppression_guid : + Buffer.t -> suppression_guid -> unit + (** Output a JSON value of type {!type:suppression_guid}. *) + +val string_of_suppression_guid : + ?len:int -> suppression_guid -> string + (** Serialize a value of type {!type:suppression_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_suppression_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression_guid + (** Input JSON data of type {!type:suppression_guid}. *) + +val suppression_guid_of_string : + string -> suppression_guid + (** Deserialize JSON data of type {!type:suppression_guid}. *) + +val write_suppression_kind : + Buffer.t -> suppression_kind -> unit + (** Output a JSON value of type {!type:suppression_kind}. *) + +val string_of_suppression_kind : + ?len:int -> suppression_kind -> string + (** Serialize a value of type {!type:suppression_kind} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_suppression_kind : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression_kind + (** Input JSON data of type {!type:suppression_kind}. *) + +val suppression_kind_of_string : + string -> suppression_kind + (** Deserialize JSON data of type {!type:suppression_kind}. *) + +val write_suppression_status : + Buffer.t -> suppression_status -> unit + (** Output a JSON value of type {!type:suppression_status}. *) + +val string_of_suppression_status : + ?len:int -> suppression_status -> string + (** Serialize a value of type {!type:suppression_status} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_suppression_status : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression_status + (** Input JSON data of type {!type:suppression_status}. *) + +val suppression_status_of_string : + string -> suppression_status + (** Deserialize JSON data of type {!type:suppression_status}. *) + +val write_suppression : + Buffer.t -> suppression -> unit + (** Output a JSON value of type {!type:suppression}. *) + +val string_of_suppression : + ?len:int -> suppression -> string + (** Serialize a value of type {!type:suppression} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_suppression : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> suppression + (** Input JSON data of type {!type:suppression}. *) + +val suppression_of_string : + string -> suppression + (** Deserialize JSON data of type {!type:suppression}. *) + +val write_thread_flow_location_importance : + Buffer.t -> thread_flow_location_importance -> unit + (** Output a JSON value of type {!type:thread_flow_location_importance}. *) + +val string_of_thread_flow_location_importance : + ?len:int -> thread_flow_location_importance -> string + (** Serialize a value of type {!type:thread_flow_location_importance} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_thread_flow_location_importance : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> thread_flow_location_importance + (** Input JSON data of type {!type:thread_flow_location_importance}. *) + +val thread_flow_location_importance_of_string : + string -> thread_flow_location_importance + (** Deserialize JSON data of type {!type:thread_flow_location_importance}. *) + +val write_tool_component_contents_item : + Buffer.t -> tool_component_contents_item -> unit + (** Output a JSON value of type {!type:tool_component_contents_item}. *) + +val string_of_tool_component_contents_item : + ?len:int -> tool_component_contents_item -> string + (** Serialize a value of type {!type:tool_component_contents_item} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_contents_item : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_contents_item + (** Input JSON data of type {!type:tool_component_contents_item}. *) + +val tool_component_contents_item_of_string : + string -> tool_component_contents_item + (** Deserialize JSON data of type {!type:tool_component_contents_item}. *) + +val write_tool_component_dotted_quad_file_version : + Buffer.t -> tool_component_dotted_quad_file_version -> unit + (** Output a JSON value of type {!type:tool_component_dotted_quad_file_version}. *) + +val string_of_tool_component_dotted_quad_file_version : + ?len:int -> tool_component_dotted_quad_file_version -> string + (** Serialize a value of type {!type:tool_component_dotted_quad_file_version} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_dotted_quad_file_version : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_dotted_quad_file_version + (** Input JSON data of type {!type:tool_component_dotted_quad_file_version}. *) + +val tool_component_dotted_quad_file_version_of_string : + string -> tool_component_dotted_quad_file_version + (** Deserialize JSON data of type {!type:tool_component_dotted_quad_file_version}. *) + +val write_tool_component_guid : + Buffer.t -> tool_component_guid -> unit + (** Output a JSON value of type {!type:tool_component_guid}. *) + +val string_of_tool_component_guid : + ?len:int -> tool_component_guid -> string + (** Serialize a value of type {!type:tool_component_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_guid + (** Input JSON data of type {!type:tool_component_guid}. *) + +val tool_component_guid_of_string : + string -> tool_component_guid + (** Deserialize JSON data of type {!type:tool_component_guid}. *) + +val write_tool_component_language : + Buffer.t -> tool_component_language -> unit + (** Output a JSON value of type {!type:tool_component_language}. *) + +val string_of_tool_component_language : + ?len:int -> tool_component_language -> string + (** Serialize a value of type {!type:tool_component_language} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_language : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_language + (** Input JSON data of type {!type:tool_component_language}. *) + +val tool_component_language_of_string : + string -> tool_component_language + (** Deserialize JSON data of type {!type:tool_component_language}. *) + +val write_tool_component_reference_guid : + Buffer.t -> tool_component_reference_guid -> unit + (** Output a JSON value of type {!type:tool_component_reference_guid}. *) + +val string_of_tool_component_reference_guid : + ?len:int -> tool_component_reference_guid -> string + (** Serialize a value of type {!type:tool_component_reference_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_reference_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_reference_guid + (** Input JSON data of type {!type:tool_component_reference_guid}. *) + +val tool_component_reference_guid_of_string : + string -> tool_component_reference_guid + (** Deserialize JSON data of type {!type:tool_component_reference_guid}. *) + +val write_tool_component_reference : + Buffer.t -> tool_component_reference -> unit + (** Output a JSON value of type {!type:tool_component_reference}. *) + +val string_of_tool_component_reference : + ?len:int -> tool_component_reference -> string + (** Serialize a value of type {!type:tool_component_reference} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component_reference : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component_reference + (** Input JSON data of type {!type:tool_component_reference}. *) + +val tool_component_reference_of_string : + string -> tool_component_reference + (** Deserialize JSON data of type {!type:tool_component_reference}. *) + +val write_reporting_descriptor_reference : + Buffer.t -> reporting_descriptor_reference -> unit + (** Output a JSON value of type {!type:reporting_descriptor_reference}. *) + +val string_of_reporting_descriptor_reference : + ?len:int -> reporting_descriptor_reference -> string + (** Serialize a value of type {!type:reporting_descriptor_reference} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor_reference : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor_reference + (** Input JSON data of type {!type:reporting_descriptor_reference}. *) + +val reporting_descriptor_reference_of_string : + string -> reporting_descriptor_reference + (** Deserialize JSON data of type {!type:reporting_descriptor_reference}. *) + +val write_configuration_override : + Buffer.t -> configuration_override -> unit + (** Output a JSON value of type {!type:configuration_override}. *) + +val string_of_configuration_override : + ?len:int -> configuration_override -> string + (** Serialize a value of type {!type:configuration_override} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_configuration_override : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> configuration_override + (** Input JSON data of type {!type:configuration_override}. *) + +val configuration_override_of_string : + string -> configuration_override + (** Deserialize JSON data of type {!type:configuration_override}. *) + +val write_reporting_descriptor_relationship : + Buffer.t -> reporting_descriptor_relationship -> unit + (** Output a JSON value of type {!type:reporting_descriptor_relationship}. *) + +val string_of_reporting_descriptor_relationship : + ?len:int -> reporting_descriptor_relationship -> string + (** Serialize a value of type {!type:reporting_descriptor_relationship} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor_relationship : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor_relationship + (** Input JSON data of type {!type:reporting_descriptor_relationship}. *) + +val reporting_descriptor_relationship_of_string : + string -> reporting_descriptor_relationship + (** Deserialize JSON data of type {!type:reporting_descriptor_relationship}. *) + +val write_reporting_descriptor : + Buffer.t -> reporting_descriptor -> unit + (** Output a JSON value of type {!type:reporting_descriptor}. *) + +val string_of_reporting_descriptor : + ?len:int -> reporting_descriptor -> string + (** Serialize a value of type {!type:reporting_descriptor} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_reporting_descriptor : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> reporting_descriptor + (** Input JSON data of type {!type:reporting_descriptor}. *) + +val reporting_descriptor_of_string : + string -> reporting_descriptor + (** Deserialize JSON data of type {!type:reporting_descriptor}. *) + +val write_translation_metadata : + Buffer.t -> translation_metadata -> unit + (** Output a JSON value of type {!type:translation_metadata}. *) + +val string_of_translation_metadata : + ?len:int -> translation_metadata -> string + (** Serialize a value of type {!type:translation_metadata} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_translation_metadata : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> translation_metadata + (** Input JSON data of type {!type:translation_metadata}. *) + +val translation_metadata_of_string : + string -> translation_metadata + (** Deserialize JSON data of type {!type:translation_metadata}. *) + +val write_tool_component : + Buffer.t -> tool_component -> unit + (** Output a JSON value of type {!type:tool_component}. *) + +val string_of_tool_component : + ?len:int -> tool_component -> string + (** Serialize a value of type {!type:tool_component} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool_component : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool_component + (** Input JSON data of type {!type:tool_component}. *) + +val tool_component_of_string : + string -> tool_component + (** Deserialize JSON data of type {!type:tool_component}. *) + +val write_tool : + Buffer.t -> tool -> unit + (** Output a JSON value of type {!type:tool}. *) + +val string_of_tool : + ?len:int -> tool -> string + (** Serialize a value of type {!type:tool} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_tool : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> tool + (** Input JSON data of type {!type:tool}. *) + +val tool_of_string : + string -> tool + (** Deserialize JSON data of type {!type:tool}. *) + +val write_web_request : + Buffer.t -> web_request -> unit + (** Output a JSON value of type {!type:web_request}. *) + +val string_of_web_request : + ?len:int -> web_request -> string + (** Serialize a value of type {!type:web_request} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_web_request : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> web_request + (** Input JSON data of type {!type:web_request}. *) + +val web_request_of_string : + string -> web_request + (** Deserialize JSON data of type {!type:web_request}. *) + +val write_web_response : + Buffer.t -> web_response -> unit + (** Output a JSON value of type {!type:web_response}. *) + +val string_of_web_response : + ?len:int -> web_response -> string + (** Serialize a value of type {!type:web_response} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_web_response : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> web_response + (** Input JSON data of type {!type:web_response}. *) + +val web_response_of_string : + string -> web_response + (** Deserialize JSON data of type {!type:web_response}. *) + +val write_thread_flow_location : + Buffer.t -> thread_flow_location -> unit + (** Output a JSON value of type {!type:thread_flow_location}. *) + +val string_of_thread_flow_location : + ?len:int -> thread_flow_location -> string + (** Serialize a value of type {!type:thread_flow_location} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_thread_flow_location : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> thread_flow_location + (** Input JSON data of type {!type:thread_flow_location}. *) + +val thread_flow_location_of_string : + string -> thread_flow_location + (** Deserialize JSON data of type {!type:thread_flow_location}. *) + +val write_thread_flow : + Buffer.t -> thread_flow -> unit + (** Output a JSON value of type {!type:thread_flow}. *) + +val string_of_thread_flow : + ?len:int -> thread_flow -> string + (** Serialize a value of type {!type:thread_flow} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_thread_flow : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> thread_flow + (** Input JSON data of type {!type:thread_flow}. *) + +val thread_flow_of_string : + string -> thread_flow + (** Deserialize JSON data of type {!type:thread_flow}. *) + +val write_code_flow : + Buffer.t -> code_flow -> unit + (** Output a JSON value of type {!type:code_flow}. *) + +val string_of_code_flow : + ?len:int -> code_flow -> string + (** Serialize a value of type {!type:code_flow} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_code_flow : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> code_flow + (** Input JSON data of type {!type:code_flow}. *) + +val code_flow_of_string : + string -> code_flow + (** Deserialize JSON data of type {!type:code_flow}. *) + +val write_node : + Buffer.t -> node -> unit + (** Output a JSON value of type {!type:node}. *) + +val string_of_node : + ?len:int -> node -> string + (** Serialize a value of type {!type:node} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_node : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> node + (** Input JSON data of type {!type:node}. *) + +val node_of_string : + string -> node + (** Deserialize JSON data of type {!type:node}. *) + +val write_exception_ : + Buffer.t -> exception_ -> unit + (** Output a JSON value of type {!type:exception_}. *) + +val string_of_exception_ : + ?len:int -> exception_ -> string + (** Serialize a value of type {!type:exception_} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_exception_ : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> exception_ + (** Input JSON data of type {!type:exception_}. *) + +val exception__of_string : + string -> exception_ + (** Deserialize JSON data of type {!type:exception_}. *) + +val write_graph : + Buffer.t -> graph -> unit + (** Output a JSON value of type {!type:graph}. *) + +val string_of_graph : + ?len:int -> graph -> string + (** Serialize a value of type {!type:graph} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_graph : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph + (** Input JSON data of type {!type:graph}. *) + +val graph_of_string : + string -> graph + (** Deserialize JSON data of type {!type:graph}. *) + +val write_result : + Buffer.t -> result -> unit + (** Output a JSON value of type {!type:result}. *) + +val string_of_result : + ?len:int -> result -> string + (** Serialize a value of type {!type:result} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_result : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> result + (** Input JSON data of type {!type:result}. *) + +val result_of_string : + string -> result + (** Deserialize JSON data of type {!type:result}. *) + +val write_notification : + Buffer.t -> notification -> unit + (** Output a JSON value of type {!type:notification}. *) + +val string_of_notification : + ?len:int -> notification -> string + (** Serialize a value of type {!type:notification} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_notification : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> notification + (** Input JSON data of type {!type:notification}. *) + +val notification_of_string : + string -> notification + (** Deserialize JSON data of type {!type:notification}. *) + +val write_invocation : + Buffer.t -> invocation -> unit + (** Output a JSON value of type {!type:invocation}. *) + +val string_of_invocation : + ?len:int -> invocation -> string + (** Serialize a value of type {!type:invocation} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_invocation : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> invocation + (** Input JSON data of type {!type:invocation}. *) + +val invocation_of_string : + string -> invocation + (** Deserialize JSON data of type {!type:invocation}. *) + +val write_conversion : + Buffer.t -> conversion -> unit + (** Output a JSON value of type {!type:conversion}. *) + +val string_of_conversion : + ?len:int -> conversion -> string + (** Serialize a value of type {!type:conversion} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_conversion : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> conversion + (** Input JSON data of type {!type:conversion}. *) + +val conversion_of_string : + string -> conversion + (** Deserialize JSON data of type {!type:conversion}. *) + +val write_artifact : + Buffer.t -> artifact -> unit + (** Output a JSON value of type {!type:artifact}. *) + +val string_of_artifact : + ?len:int -> artifact -> string + (** Serialize a value of type {!type:artifact} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_artifact : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact + (** Input JSON data of type {!type:artifact}. *) + +val artifact_of_string : + string -> artifact + (** Deserialize JSON data of type {!type:artifact}. *) + +val write_external_properties : + Buffer.t -> external_properties -> unit + (** Output a JSON value of type {!type:external_properties}. *) + +val string_of_external_properties : + ?len:int -> external_properties -> string + (** Serialize a value of type {!type:external_properties} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_properties : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_properties + (** Input JSON data of type {!type:external_properties}. *) + +val external_properties_of_string : + string -> external_properties + (** Deserialize JSON data of type {!type:external_properties}. *) + +val write_version_control_details : + Buffer.t -> version_control_details -> unit + (** Output a JSON value of type {!type:version_control_details}. *) + +val string_of_version_control_details : + ?len:int -> version_control_details -> string + (** Serialize a value of type {!type:version_control_details} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_version_control_details : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> version_control_details + (** Input JSON data of type {!type:version_control_details}. *) + +val version_control_details_of_string : + string -> version_control_details + (** Deserialize JSON data of type {!type:version_control_details}. *) + +val write_special_locations : + Buffer.t -> special_locations -> unit + (** Output a JSON value of type {!type:special_locations}. *) + +val string_of_special_locations : + ?len:int -> special_locations -> string + (** Serialize a value of type {!type:special_locations} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_special_locations : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> special_locations + (** Input JSON data of type {!type:special_locations}. *) + +val special_locations_of_string : + string -> special_locations + (** Deserialize JSON data of type {!type:special_locations}. *) + +val write_sarif_version : + Buffer.t -> sarif_version -> unit + (** Output a JSON value of type {!type:sarif_version}. *) + +val string_of_sarif_version : + ?len:int -> sarif_version -> string + (** Serialize a value of type {!type:sarif_version} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_sarif_version : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> sarif_version + (** Input JSON data of type {!type:sarif_version}. *) + +val sarif_version_of_string : + string -> sarif_version + (** Deserialize JSON data of type {!type:sarif_version}. *) + +val write_run_language : + Buffer.t -> run_language -> unit + (** Output a JSON value of type {!type:run_language}. *) + +val string_of_run_language : + ?len:int -> run_language -> string + (** Serialize a value of type {!type:run_language} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_language : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_language + (** Input JSON data of type {!type:run_language}. *) + +val run_language_of_string : + string -> run_language + (** Deserialize JSON data of type {!type:run_language}. *) + +val write_run_column_kind : + Buffer.t -> run_column_kind -> unit + (** Output a JSON value of type {!type:run_column_kind}. *) + +val string_of_run_column_kind : + ?len:int -> run_column_kind -> string + (** Serialize a value of type {!type:run_column_kind} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_column_kind : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_column_kind + (** Input JSON data of type {!type:run_column_kind}. *) + +val run_column_kind_of_string : + string -> run_column_kind + (** Deserialize JSON data of type {!type:run_column_kind}. *) + +val write_run_baseline_guid : + Buffer.t -> run_baseline_guid -> unit + (** Output a JSON value of type {!type:run_baseline_guid}. *) + +val string_of_run_baseline_guid : + ?len:int -> run_baseline_guid -> string + (** Serialize a value of type {!type:run_baseline_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_baseline_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_baseline_guid + (** Input JSON data of type {!type:run_baseline_guid}. *) + +val run_baseline_guid_of_string : + string -> run_baseline_guid + (** Deserialize JSON data of type {!type:run_baseline_guid}. *) + +val write_run_automation_details_guid : + Buffer.t -> run_automation_details_guid -> unit + (** Output a JSON value of type {!type:run_automation_details_guid}. *) + +val string_of_run_automation_details_guid : + ?len:int -> run_automation_details_guid -> string + (** Serialize a value of type {!type:run_automation_details_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_automation_details_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_automation_details_guid + (** Input JSON data of type {!type:run_automation_details_guid}. *) + +val run_automation_details_guid_of_string : + string -> run_automation_details_guid + (** Deserialize JSON data of type {!type:run_automation_details_guid}. *) + +val write_run_automation_details_correlation_guid : + Buffer.t -> run_automation_details_correlation_guid -> unit + (** Output a JSON value of type {!type:run_automation_details_correlation_guid}. *) + +val string_of_run_automation_details_correlation_guid : + ?len:int -> run_automation_details_correlation_guid -> string + (** Serialize a value of type {!type:run_automation_details_correlation_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_automation_details_correlation_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_automation_details_correlation_guid + (** Input JSON data of type {!type:run_automation_details_correlation_guid}. *) + +val run_automation_details_correlation_guid_of_string : + string -> run_automation_details_correlation_guid + (** Deserialize JSON data of type {!type:run_automation_details_correlation_guid}. *) + +val write_run_automation_details : + Buffer.t -> run_automation_details -> unit + (** Output a JSON value of type {!type:run_automation_details}. *) + +val string_of_run_automation_details : + ?len:int -> run_automation_details -> string + (** Serialize a value of type {!type:run_automation_details} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run_automation_details : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_automation_details + (** Input JSON data of type {!type:run_automation_details}. *) + +val run_automation_details_of_string : + string -> run_automation_details + (** Deserialize JSON data of type {!type:run_automation_details}. *) + +val write_hm_str_al : + Buffer.t -> hm_str_al -> unit + (** Output a JSON value of type {!type:hm_str_al}. *) + +val string_of_hm_str_al : + ?len:int -> hm_str_al -> string + (** Serialize a value of type {!type:hm_str_al} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_hm_str_al : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_al + (** Input JSON data of type {!type:hm_str_al}. *) + +val hm_str_al_of_string : + string -> hm_str_al + (** Deserialize JSON data of type {!type:hm_str_al}. *) + +val write_external_property_file_reference_guid : + Buffer.t -> external_property_file_reference_guid -> unit + (** Output a JSON value of type {!type:external_property_file_reference_guid}. *) + +val string_of_external_property_file_reference_guid : + ?len:int -> external_property_file_reference_guid -> string + (** Serialize a value of type {!type:external_property_file_reference_guid} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_property_file_reference_guid : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_property_file_reference_guid + (** Input JSON data of type {!type:external_property_file_reference_guid}. *) + +val external_property_file_reference_guid_of_string : + string -> external_property_file_reference_guid + (** Deserialize JSON data of type {!type:external_property_file_reference_guid}. *) + +val write_external_property_file_reference : + Buffer.t -> external_property_file_reference -> unit + (** Output a JSON value of type {!type:external_property_file_reference}. *) + +val string_of_external_property_file_reference : + ?len:int -> external_property_file_reference -> string + (** Serialize a value of type {!type:external_property_file_reference} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_property_file_reference : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_property_file_reference + (** Input JSON data of type {!type:external_property_file_reference}. *) + +val external_property_file_reference_of_string : + string -> external_property_file_reference + (** Deserialize JSON data of type {!type:external_property_file_reference}. *) + +val write_external_property_file_references : + Buffer.t -> external_property_file_references -> unit + (** Output a JSON value of type {!type:external_property_file_references}. *) + +val string_of_external_property_file_references : + ?len:int -> external_property_file_references -> string + (** Serialize a value of type {!type:external_property_file_references} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_external_property_file_references : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> external_property_file_references + (** Input JSON data of type {!type:external_property_file_references}. *) + +val external_property_file_references_of_string : + string -> external_property_file_references + (** Deserialize JSON data of type {!type:external_property_file_references}. *) + +val write_run : + Buffer.t -> run -> unit + (** Output a JSON value of type {!type:run}. *) + +val string_of_run : + ?len:int -> run -> string + (** Serialize a value of type {!type:run} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_run : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> run + (** Input JSON data of type {!type:run}. *) + +val run_of_string : + string -> run + (** Deserialize JSON data of type {!type:run}. *) + +val write_sarif_json_schema : + Buffer.t -> sarif_json_schema -> unit + (** Output a JSON value of type {!type:sarif_json_schema}. *) + +val string_of_sarif_json_schema : + ?len:int -> sarif_json_schema -> string + (** Serialize a value of type {!type:sarif_json_schema} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_sarif_json_schema : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> sarif_json_schema + (** Input JSON data of type {!type:sarif_json_schema}. *) + +val sarif_json_schema_of_string : + string -> sarif_json_schema + (** Deserialize JSON data of type {!type:sarif_json_schema}. *) -(** Output a JSON value of type {!type:graph}. *) -val write_graph : Buffer.t -> graph -> unit - -(** Serialize a value of type {!type:graph} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_graph : ?len:int -> graph -> string - -(** Input JSON data of type {!type:graph}. *) -val read_graph : Yojson.Safe.lexer_state -> Lexing.lexbuf -> graph - -(** Deserialize JSON data of type {!type:graph}. *) -val graph_of_string : string -> graph - -(** Output a JSON value of type {!type:result}. *) -val write_result : Buffer.t -> result -> unit - -(** Serialize a value of type {!type:result} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_result : ?len:int -> result -> string - -(** Input JSON data of type {!type:result}. *) -val read_result : Yojson.Safe.lexer_state -> Lexing.lexbuf -> result - -(** Deserialize JSON data of type {!type:result}. *) -val result_of_string : string -> result - -(** Output a JSON value of type {!type:notification}. *) -val write_notification : Buffer.t -> notification -> unit - -(** Serialize a value of type {!type:notification} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_notification : ?len:int -> notification -> string - -(** Input JSON data of type {!type:notification}. *) -val read_notification : Yojson.Safe.lexer_state -> Lexing.lexbuf -> notification - -(** Deserialize JSON data of type {!type:notification}. *) -val notification_of_string : string -> notification - -(** Output a JSON value of type {!type:invocation}. *) -val write_invocation : Buffer.t -> invocation -> unit - -(** Serialize a value of type {!type:invocation} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_invocation : ?len:int -> invocation -> string - -(** Input JSON data of type {!type:invocation}. *) -val read_invocation : Yojson.Safe.lexer_state -> Lexing.lexbuf -> invocation - -(** Deserialize JSON data of type {!type:invocation}. *) -val invocation_of_string : string -> invocation - -(** Output a JSON value of type {!type:conversion}. *) -val write_conversion : Buffer.t -> conversion -> unit - -(** Serialize a value of type {!type:conversion} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_conversion : ?len:int -> conversion -> string - -(** Input JSON data of type {!type:conversion}. *) -val read_conversion : Yojson.Safe.lexer_state -> Lexing.lexbuf -> conversion - -(** Deserialize JSON data of type {!type:conversion}. *) -val conversion_of_string : string -> conversion - -(** Output a JSON value of type {!type:artifact}. *) -val write_artifact : Buffer.t -> artifact -> unit - -(** Serialize a value of type {!type:artifact} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_artifact : ?len:int -> artifact -> string - -(** Input JSON data of type {!type:artifact}. *) -val read_artifact : Yojson.Safe.lexer_state -> Lexing.lexbuf -> artifact - -(** Deserialize JSON data of type {!type:artifact}. *) -val artifact_of_string : string -> artifact - -(** Output a JSON value of type {!type:external_properties}. *) -val write_external_properties : Buffer.t -> external_properties -> unit - -(** Serialize a value of type {!type:external_properties} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_properties : ?len:int -> external_properties -> string - -(** Input JSON data of type {!type:external_properties}. *) -val read_external_properties - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_properties - -(** Deserialize JSON data of type {!type:external_properties}. *) -val external_properties_of_string : string -> external_properties - -(** Output a JSON value of type {!type:version_control_details}. *) -val write_version_control_details : Buffer.t -> version_control_details -> unit - -(** Serialize a value of type {!type:version_control_details} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_version_control_details : ?len:int -> version_control_details -> string - -(** Input JSON data of type {!type:version_control_details}. *) -val read_version_control_details - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> version_control_details - -(** Deserialize JSON data of type {!type:version_control_details}. *) -val version_control_details_of_string : string -> version_control_details - -(** Output a JSON value of type {!type:special_locations}. *) -val write_special_locations : Buffer.t -> special_locations -> unit - -(** Serialize a value of type {!type:special_locations} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_special_locations : ?len:int -> special_locations -> string - -(** Input JSON data of type {!type:special_locations}. *) -val read_special_locations : Yojson.Safe.lexer_state -> Lexing.lexbuf -> special_locations - -(** Deserialize JSON data of type {!type:special_locations}. *) -val special_locations_of_string : string -> special_locations - -(** Output a JSON value of type {!type:sarif_version}. *) -val write_sarif_version : Buffer.t -> sarif_version -> unit - -(** Serialize a value of type {!type:sarif_version} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_sarif_version : ?len:int -> sarif_version -> string - -(** Input JSON data of type {!type:sarif_version}. *) -val read_sarif_version : Yojson.Safe.lexer_state -> Lexing.lexbuf -> sarif_version - -(** Deserialize JSON data of type {!type:sarif_version}. *) -val sarif_version_of_string : string -> sarif_version - -(** Output a JSON value of type {!type:run_language}. *) -val write_run_language : Buffer.t -> run_language -> unit - -(** Serialize a value of type {!type:run_language} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_language : ?len:int -> run_language -> string - -(** Input JSON data of type {!type:run_language}. *) -val read_run_language : Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_language - -(** Deserialize JSON data of type {!type:run_language}. *) -val run_language_of_string : string -> run_language - -(** Output a JSON value of type {!type:run_column_kind}. *) -val write_run_column_kind : Buffer.t -> run_column_kind -> unit - -(** Serialize a value of type {!type:run_column_kind} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_column_kind : ?len:int -> run_column_kind -> string - -(** Input JSON data of type {!type:run_column_kind}. *) -val read_run_column_kind : Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_column_kind - -(** Deserialize JSON data of type {!type:run_column_kind}. *) -val run_column_kind_of_string : string -> run_column_kind - -(** Output a JSON value of type {!type:run_baseline_guid}. *) -val write_run_baseline_guid : Buffer.t -> run_baseline_guid -> unit - -(** Serialize a value of type {!type:run_baseline_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_baseline_guid : ?len:int -> run_baseline_guid -> string - -(** Input JSON data of type {!type:run_baseline_guid}. *) -val read_run_baseline_guid : Yojson.Safe.lexer_state -> Lexing.lexbuf -> run_baseline_guid - -(** Deserialize JSON data of type {!type:run_baseline_guid}. *) -val run_baseline_guid_of_string : string -> run_baseline_guid - -(** Output a JSON value of type {!type:run_automation_details_guid}. *) -val write_run_automation_details_guid : Buffer.t -> run_automation_details_guid -> unit - -(** Serialize a value of type {!type:run_automation_details_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_automation_details_guid - : ?len:int - -> run_automation_details_guid - -> string - -(** Input JSON data of type {!type:run_automation_details_guid}. *) -val read_run_automation_details_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> run_automation_details_guid - -(** Deserialize JSON data of type {!type:run_automation_details_guid}. *) -val run_automation_details_guid_of_string : string -> run_automation_details_guid - -(** Output a JSON value of type {!type:run_automation_details_correlation_guid}. *) -val write_run_automation_details_correlation_guid - : Buffer.t - -> run_automation_details_correlation_guid - -> unit - -(** Serialize a value of type {!type:run_automation_details_correlation_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_automation_details_correlation_guid - : ?len:int - -> run_automation_details_correlation_guid - -> string - -(** Input JSON data of type {!type:run_automation_details_correlation_guid}. *) -val read_run_automation_details_correlation_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> run_automation_details_correlation_guid - -(** Deserialize JSON data of type {!type:run_automation_details_correlation_guid}. *) -val run_automation_details_correlation_guid_of_string - : string - -> run_automation_details_correlation_guid - -(** Output a JSON value of type {!type:run_automation_details}. *) -val write_run_automation_details : Buffer.t -> run_automation_details -> unit - -(** Serialize a value of type {!type:run_automation_details} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run_automation_details : ?len:int -> run_automation_details -> string - -(** Input JSON data of type {!type:run_automation_details}. *) -val read_run_automation_details - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> run_automation_details - -(** Deserialize JSON data of type {!type:run_automation_details}. *) -val run_automation_details_of_string : string -> run_automation_details - -(** Output a JSON value of type {!type:hm_str_al}. *) -val write_hm_str_al : Buffer.t -> hm_str_al -> unit - -(** Serialize a value of type {!type:hm_str_al} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_hm_str_al : ?len:int -> hm_str_al -> string - -(** Input JSON data of type {!type:hm_str_al}. *) -val read_hm_str_al : Yojson.Safe.lexer_state -> Lexing.lexbuf -> hm_str_al - -(** Deserialize JSON data of type {!type:hm_str_al}. *) -val hm_str_al_of_string : string -> hm_str_al - -(** Output a JSON value of type {!type:external_property_file_reference_guid}. *) -val write_external_property_file_reference_guid - : Buffer.t - -> external_property_file_reference_guid - -> unit - -(** Serialize a value of type {!type:external_property_file_reference_guid} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_property_file_reference_guid - : ?len:int - -> external_property_file_reference_guid - -> string - -(** Input JSON data of type {!type:external_property_file_reference_guid}. *) -val read_external_property_file_reference_guid - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_property_file_reference_guid - -(** Deserialize JSON data of type {!type:external_property_file_reference_guid}. *) -val external_property_file_reference_guid_of_string - : string - -> external_property_file_reference_guid - -(** Output a JSON value of type {!type:external_property_file_reference}. *) -val write_external_property_file_reference - : Buffer.t - -> external_property_file_reference - -> unit - -(** Serialize a value of type {!type:external_property_file_reference} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_property_file_reference - : ?len:int - -> external_property_file_reference - -> string - -(** Input JSON data of type {!type:external_property_file_reference}. *) -val read_external_property_file_reference - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_property_file_reference - -(** Deserialize JSON data of type {!type:external_property_file_reference}. *) -val external_property_file_reference_of_string - : string - -> external_property_file_reference - -(** Output a JSON value of type {!type:external_property_file_references}. *) -val write_external_property_file_references - : Buffer.t - -> external_property_file_references - -> unit - -(** Serialize a value of type {!type:external_property_file_references} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_external_property_file_references - : ?len:int - -> external_property_file_references - -> string - -(** Input JSON data of type {!type:external_property_file_references}. *) -val read_external_property_file_references - : Yojson.Safe.lexer_state - -> Lexing.lexbuf - -> external_property_file_references - -(** Deserialize JSON data of type {!type:external_property_file_references}. *) -val external_property_file_references_of_string - : string - -> external_property_file_references - -(** Output a JSON value of type {!type:run}. *) -val write_run : Buffer.t -> run -> unit - -(** Serialize a value of type {!type:run} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_run : ?len:int -> run -> string - -(** Input JSON data of type {!type:run}. *) -val read_run : Yojson.Safe.lexer_state -> Lexing.lexbuf -> run - -(** Deserialize JSON data of type {!type:run}. *) -val run_of_string : string -> run - -(** Output a JSON value of type {!type:sarif_json_schema}. *) -val write_sarif_json_schema : Buffer.t -> sarif_json_schema -> unit - -(** Serialize a value of type {!type:sarif_json_schema} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) -val string_of_sarif_json_schema : ?len:int -> sarif_json_schema -> string - -(** Input JSON data of type {!type:sarif_json_schema}. *) -val read_sarif_json_schema : Yojson.Safe.lexer_state -> Lexing.lexbuf -> sarif_json_schema - -(** Deserialize JSON data of type {!type:sarif_json_schema}. *) -val sarif_json_schema_of_string : string -> sarif_json_schema diff --git a/lib/sarif_v_2_1_0_t.ml b/lib/sarif_v_2_1_0_t.ml index f22b43a..d00b299 100644 --- a/lib/sarif_v_2_1_0_t.ml +++ b/lib/sarif_v_2_1_0_t.ml @@ -2,1508 +2,2062 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = string [@@deriving show, eq] +type artifact_mimetype = string + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = - [ `AnalysisTarget - | `Attachment - | `ResponseFile - | `ResultFile - | `StandardStream - | `TracedFile - | `Unmodified - | `Modified - | `Added - | `Deleted - | `Renamed - | `Uncontrolled - | `Driver - | `Extension - | `Translation - | `Taxonomy - | `Policy - | `ReferencedOnCommandLine - | `MemoryContents - | `Directory - | `UserSpecifiedConfiguration - | `ToolSpecifiedConfiguration +type artifact_roles_item = [ + `AnalysisTarget | `Attachment | `ResponseFile | `ResultFile + | `StandardStream | `TracedFile | `Unmodified | `Modified | `Added + | `Deleted | `Renamed | `Uncontrolled | `Driver | `Extension | `Translation + | `Taxonomy | `Policy | `ReferencedOnCommandLine | `MemoryContents + | `Directory | `UserSpecifiedConfiguration | `ToolSpecifiedConfiguration | `DebugOutputFile - ] -[@@deriving show, eq] +] + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) -type external_properties_guid = string [@@deriving show, eq] +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) +type external_properties_guid = string + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = string [@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = string + [@@deriving show,eq] -type external_properties_version = [ `TwoDotOneDotZero ] [@@deriving show, eq] -type hm_str_str = (string * string) list [@@deriving show, eq] -type int64 = Int64.t [@@deriving show, eq] +type external_properties_version = [ `TwoDotOneDotZero ] [@@deriving show,eq] + +type hm_str_str = (string * string) list [@@deriving show,eq] + +type int64 = Int64.t [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] +type notification_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = (string * Yojson.Safe.t) list [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = (string * Yojson.Safe.t) list + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = (string * multiformat_message_string) list [@@deriving show, eq] +type artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = (string * multiformat_message_string) list + [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = - [ `Variant0 of graph_traversal_variant0 +type graph_traversal = [ + `Variant0 of graph_traversal_variant0 | `Variant1 of graph_traversal_variant1 - ] -[@@deriving show, eq] +] + [@@deriving show,eq] (** An area within an image. *) -type rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) -type reporting_descriptor_deprecated_guids_item = string [@@deriving show, eq] +type reporting_descriptor_deprecated_guids_item = string + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) -type reporting_descriptor_guid = string [@@deriving show, eq] +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) +type reporting_descriptor_guid = string + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) -type reporting_descriptor_reference_guid = string [@@deriving show, eq] +type reporting_descriptor_reference_guid = string + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = - [ `New - | `Unchanged - | `Updated - | `Absent - ] -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) -type result_correlation_guid = string [@@deriving show, eq] +type result_baseline_state = [ `New | `Unchanged | `Updated | `Absent ] + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) +type result_correlation_guid = string + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = string [@@deriving show, eq] +type result_guid = string + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = - [ `NotApplicable - | `Pass - | `Fail - | `Review - | `Open - | `Informational - ] -[@@deriving show, eq] +type result_kind = [ + `NotApplicable | `Pass | `Fail | `Review | `Open | `Informational +] + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] - -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) -type result_provenance_first_detection_run_guid = string [@@deriving show, eq] - -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) -type result_provenance_last_detection_run_guid = string [@@deriving show, eq] +type result_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] + +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) +type result_provenance_first_detection_run_guid = string + [@@deriving show,eq] + +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) +type result_provenance_last_detection_run_guid = string + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = string [@@deriving show, eq] +type suppression_guid = string + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = - [ `InSource - | `External - ] -[@@deriving show, eq] +type suppression_kind = [ `InSource | `External ] + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = - [ `Accepted - | `UnderReview - | `Rejected - ] -[@@deriving show, eq] +type suppression_status = [ `Accepted | `UnderReview | `Rejected ] + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = - [ `Important - | `Essential - | `Unimportant - ] -[@@deriving show, eq] +type suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = [ + `Important | `Essential | `Unimportant +] + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = - [ `LocalizedData - | `NonLocalizedData - ] -[@@deriving show, eq] +type tool_component_contents_item = [ `LocalizedData | `NonLocalizedData ] + [@@deriving show,eq] -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) -type tool_component_dotted_quad_file_version = string [@@deriving show, eq] +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) +type tool_component_dotted_quad_file_version = string + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = string [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type tool_component_language = string [@@deriving show, eq] +type tool_component_guid = string + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type tool_component_language = string + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = string [@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = string + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) -type reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known +type reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = [ `TwoDotOneDotZero ] [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = string [@@deriving show, eq] +type special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = [ `TwoDotOneDotZero ] [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = string + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = - [ `Utf16CodeUnits - | `UnicodeCodePoints - ] -[@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = string [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = string [@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) -type run_automation_details_correlation_guid = string [@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = (string * artifact_location) list [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) -type external_property_file_reference_guid = string [@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) -type external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the +type run_column_kind = [ `Utf16CodeUnits | `UnicodeCodePoints ] + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = string + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = string + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) +type run_automation_details_correlation_guid = string + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = (string * artifact_location) list [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) +type external_property_file_reference_guid = string + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) +type external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] diff --git a/lib/sarif_v_2_1_0_t.mli b/lib/sarif_v_2_1_0_t.mli index f22b43a..d00b299 100644 --- a/lib/sarif_v_2_1_0_t.mli +++ b/lib/sarif_v_2_1_0_t.mli @@ -2,1508 +2,2062 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = string [@@deriving show, eq] +type artifact_mimetype = string + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = - [ `AnalysisTarget - | `Attachment - | `ResponseFile - | `ResultFile - | `StandardStream - | `TracedFile - | `Unmodified - | `Modified - | `Added - | `Deleted - | `Renamed - | `Uncontrolled - | `Driver - | `Extension - | `Translation - | `Taxonomy - | `Policy - | `ReferencedOnCommandLine - | `MemoryContents - | `Directory - | `UserSpecifiedConfiguration - | `ToolSpecifiedConfiguration +type artifact_roles_item = [ + `AnalysisTarget | `Attachment | `ResponseFile | `ResultFile + | `StandardStream | `TracedFile | `Unmodified | `Modified | `Added + | `Deleted | `Renamed | `Uncontrolled | `Driver | `Extension | `Translation + | `Taxonomy | `Policy | `ReferencedOnCommandLine | `MemoryContents + | `Directory | `UserSpecifiedConfiguration | `ToolSpecifiedConfiguration | `DebugOutputFile - ] -[@@deriving show, eq] +] + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) -type external_properties_guid = string [@@deriving show, eq] +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) +type external_properties_guid = string + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = string [@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = string + [@@deriving show,eq] -type external_properties_version = [ `TwoDotOneDotZero ] [@@deriving show, eq] -type hm_str_str = (string * string) list [@@deriving show, eq] -type int64 = Int64.t [@@deriving show, eq] +type external_properties_version = [ `TwoDotOneDotZero ] [@@deriving show,eq] + +type hm_str_str = (string * string) list [@@deriving show,eq] + +type int64 = Int64.t [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] +type notification_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = (string * Yojson.Safe.t) list [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = (string * Yojson.Safe.t) list + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = (string * multiformat_message_string) list [@@deriving show, eq] +type artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = (string * multiformat_message_string) list + [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = - [ `Variant0 of graph_traversal_variant0 +type graph_traversal = [ + `Variant0 of graph_traversal_variant0 | `Variant1 of graph_traversal_variant1 - ] -[@@deriving show, eq] +] + [@@deriving show,eq] (** An area within an image. *) -type rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) -type reporting_descriptor_deprecated_guids_item = string [@@deriving show, eq] +type reporting_descriptor_deprecated_guids_item = string + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) -type reporting_descriptor_guid = string [@@deriving show, eq] +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) +type reporting_descriptor_guid = string + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) -type reporting_descriptor_reference_guid = string [@@deriving show, eq] +type reporting_descriptor_reference_guid = string + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = - [ `New - | `Unchanged - | `Updated - | `Absent - ] -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) -type result_correlation_guid = string [@@deriving show, eq] +type result_baseline_state = [ `New | `Unchanged | `Updated | `Absent ] + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) +type result_correlation_guid = string + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = string [@@deriving show, eq] +type result_guid = string + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = - [ `NotApplicable - | `Pass - | `Fail - | `Review - | `Open - | `Informational - ] -[@@deriving show, eq] +type result_kind = [ + `NotApplicable | `Pass | `Fail | `Review | `Open | `Informational +] + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = - [ `None - | `Note - | `Warning - | `Error - ] -[@@deriving show, eq] - -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) -type result_provenance_first_detection_run_guid = string [@@deriving show, eq] - -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) -type result_provenance_last_detection_run_guid = string [@@deriving show, eq] +type result_level = [ `None | `Note | `Warning | `Error ] + [@@deriving show,eq] + +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) +type result_provenance_first_detection_run_guid = string + [@@deriving show,eq] + +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) +type result_provenance_last_detection_run_guid = string + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = string [@@deriving show, eq] +type suppression_guid = string + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = - [ `InSource - | `External - ] -[@@deriving show, eq] +type suppression_kind = [ `InSource | `External ] + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = - [ `Accepted - | `UnderReview - | `Rejected - ] -[@@deriving show, eq] +type suppression_status = [ `Accepted | `UnderReview | `Rejected ] + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = - [ `Important - | `Essential - | `Unimportant - ] -[@@deriving show, eq] +type suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = [ + `Important | `Essential | `Unimportant +] + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = - [ `LocalizedData - | `NonLocalizedData - ] -[@@deriving show, eq] +type tool_component_contents_item = [ `LocalizedData | `NonLocalizedData ] + [@@deriving show,eq] -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) -type tool_component_dotted_quad_file_version = string [@@deriving show, eq] +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) +type tool_component_dotted_quad_file_version = string + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = string [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type tool_component_language = string [@@deriving show, eq] +type tool_component_guid = string + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type tool_component_language = string + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = string [@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = string + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) -type reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known +type reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = [ `TwoDotOneDotZero ] [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = string [@@deriving show, eq] +type special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = [ `TwoDotOneDotZero ] [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = string + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = - [ `Utf16CodeUnits - | `UnicodeCodePoints - ] -[@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = string [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = string [@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) -type run_automation_details_correlation_guid = string [@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = (string * artifact_location) list [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) -type external_property_file_reference_guid = string [@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) -type external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the +type run_column_kind = [ `Utf16CodeUnits | `UnicodeCodePoints ] + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = string + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = string + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) +type run_automation_details_correlation_guid = string + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = (string * artifact_location) list [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) +type external_property_file_reference_guid = string + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) +type external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] diff --git a/lib/sarif_v_2_1_0_v.ml b/lib/sarif_v_2_1_0_v.ml index 9754828..b57f4ea 100644 --- a/lib/sarif_v_2_1_0_v.ml +++ b/lib/sarif_v_2_1_0_v.ml @@ -2,3979 +2,5092 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype [@@deriving show, eq] +type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item [@@deriving show, eq] +type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) type external_properties_guid = Sarif_v_2_1_0_t.external_properties_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = Sarif_v_2_1_0_t.external_properties_run_guid -[@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = + Sarif_v_2_1_0_t.external_properties_run_guid + [@@deriving show,eq] -type external_properties_version = Sarif_v_2_1_0_t.external_properties_version -[@@deriving show, eq] +type external_properties_version = + Sarif_v_2_1_0_t.external_properties_version + [@@deriving show,eq] -type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show, eq] -type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show, eq] +type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show,eq] + +type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = Sarif_v_2_1_0_t.notification_level [@@deriving show, eq] +type notification_level = Sarif_v_2_1_0_t.notification_level + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = Sarif_v_2_1_0_t.property_bag [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = Sarif_v_2_1_0_t.address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = Sarif_v_2_1_0_t.property_bag + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = Sarif_v_2_1_0_t.address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = Sarif_v_2_1_0_t.logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = Sarif_v_2_1_0_t.logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = Sarif_v_2_1_0_t.message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = Sarif_v_2_1_0_t.message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = Sarif_v_2_1_0_t.artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = Sarif_v_2_1_0_t.artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = Sarif_v_2_1_0_t.edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = Sarif_v_2_1_0_t.edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = Sarif_v_2_1_0_t.location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = Sarif_v_2_1_0_t.multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = Sarif_v_2_1_0_t.location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = + Sarif_v_2_1_0_t.multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = Sarif_v_2_1_0_t.artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show, eq] +type artifact_content = Sarif_v_2_1_0_t.artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = Sarif_v_2_1_0_t.graph_traversal [@@deriving show, eq] +type graph_traversal = Sarif_v_2_1_0_t.graph_traversal + [@@deriving show,eq] (** An area within an image. *) -type rectangle = Sarif_v_2_1_0_t.rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = Sarif_v_2_1_0_t.rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = Sarif_v_2_1_0_t.region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = Sarif_v_2_1_0_t.region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = Sarif_v_2_1_0_t.attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = Sarif_v_2_1_0_t.physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = Sarif_v_2_1_0_t.attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = Sarif_v_2_1_0_t.physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = Sarif_v_2_1_0_t.location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = Sarif_v_2_1_0_t.location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = Sarif_v_2_1_0_t.replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = Sarif_v_2_1_0_t.replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = Sarif_v_2_1_0_t.artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = Sarif_v_2_1_0_t.artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = Sarif_v_2_1_0_t.fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = Sarif_v_2_1_0_t.fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = Sarif_v_2_1_0_t.reporting_configuration_level -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = + Sarif_v_2_1_0_t.reporting_configuration_level + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) type reporting_descriptor_deprecated_guids_item = Sarif_v_2_1_0_t.reporting_descriptor_deprecated_guids_item -[@@deriving show, eq] + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) type reporting_descriptor_guid = Sarif_v_2_1_0_t.reporting_descriptor_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) type reporting_descriptor_reference_guid = Sarif_v_2_1_0_t.reporting_descriptor_reference_guid -[@@deriving show, eq] + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state [@@deriving show, eq] +type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state + [@@deriving show,eq] -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) type result_correlation_guid = Sarif_v_2_1_0_t.result_correlation_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = Sarif_v_2_1_0_t.result_guid [@@deriving show, eq] +type result_guid = Sarif_v_2_1_0_t.result_guid + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = Sarif_v_2_1_0_t.result_kind [@@deriving show, eq] +type result_kind = Sarif_v_2_1_0_t.result_kind + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = Sarif_v_2_1_0_t.result_level [@@deriving show, eq] +type result_level = Sarif_v_2_1_0_t.result_level + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) type result_provenance_first_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_first_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) type result_provenance_last_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_last_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = Sarif_v_2_1_0_t.result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = Sarif_v_2_1_0_t.result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = Sarif_v_2_1_0_t.stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = Sarif_v_2_1_0_t.stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = Sarif_v_2_1_0_t.stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = Sarif_v_2_1_0_t.stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = Sarif_v_2_1_0_t.suppression_guid [@@deriving show, eq] +type suppression_guid = Sarif_v_2_1_0_t.suppression_guid + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = Sarif_v_2_1_0_t.suppression_kind [@@deriving show, eq] +type suppression_kind = Sarif_v_2_1_0_t.suppression_kind + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = Sarif_v_2_1_0_t.suppression_status [@@deriving show, eq] +type suppression_status = Sarif_v_2_1_0_t.suppression_status + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = Sarif_v_2_1_0_t.suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = Sarif_v_2_1_0_t.thread_flow_location_importance -[@@deriving show, eq] +type suppression = Sarif_v_2_1_0_t.suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = + Sarif_v_2_1_0_t.thread_flow_location_importance + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = Sarif_v_2_1_0_t.tool_component_contents_item -[@@deriving show, eq] - -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) +type tool_component_contents_item = + Sarif_v_2_1_0_t.tool_component_contents_item + [@@deriving show,eq] + +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) type tool_component_dotted_quad_file_version = Sarif_v_2_1_0_t.tool_component_dotted_quad_file_version -[@@deriving show, eq] + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) +type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) type tool_component_language = Sarif_v_2_1_0_t.tool_component_language -[@@deriving show, eq] + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = Sarif_v_2_1_0_t.tool_component_reference_guid -[@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = + Sarif_v_2_1_0_t.tool_component_reference_guid + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = Sarif_v_2_1_0_t.reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = + Sarif_v_2_1_0_t.reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = Sarif_v_2_1_0_t.configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = Sarif_v_2_1_0_t.configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) type reporting_descriptor_relationship = - Sarif_v_2_1_0_t.reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known + Sarif_v_2_1_0_t.reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = Sarif_v_2_1_0_t.tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = Sarif_v_2_1_0_t.tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = Sarif_v_2_1_0_t.tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = Sarif_v_2_1_0_t.tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = Sarif_v_2_1_0_t.web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = Sarif_v_2_1_0_t.web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = Sarif_v_2_1_0_t.web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = Sarif_v_2_1_0_t.web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = Sarif_v_2_1_0_t.thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = Sarif_v_2_1_0_t.thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = Sarif_v_2_1_0_t.code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = Sarif_v_2_1_0_t.code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = Sarif_v_2_1_0_t.node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = Sarif_v_2_1_0_t.exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = Sarif_v_2_1_0_t.node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = Sarif_v_2_1_0_t.exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = Sarif_v_2_1_0_t.graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = Sarif_v_2_1_0_t.graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = Sarif_v_2_1_0_t.result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = Sarif_v_2_1_0_t.result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = Sarif_v_2_1_0_t.notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = Sarif_v_2_1_0_t.notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = Sarif_v_2_1_0_t.invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = Sarif_v_2_1_0_t.invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = Sarif_v_2_1_0_t.conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = Sarif_v_2_1_0_t.artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = Sarif_v_2_1_0_t.conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = Sarif_v_2_1_0_t.artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = Sarif_v_2_1_0_t.external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = Sarif_v_2_1_0_t.version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = Sarif_v_2_1_0_t.external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = Sarif_v_2_1_0_t.version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = Sarif_v_2_1_0_t.special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = Sarif_v_2_1_0_t.run_language [@@deriving show, eq] +type special_locations = Sarif_v_2_1_0_t.special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = Sarif_v_2_1_0_t.run_language + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = Sarif_v_2_1_0_t.run_column_kind [@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = Sarif_v_2_1_0_t.run_automation_details_guid -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) +type run_column_kind = Sarif_v_2_1_0_t.run_column_kind + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = + Sarif_v_2_1_0_t.run_automation_details_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) type run_automation_details_correlation_guid = Sarif_v_2_1_0_t.run_automation_details_correlation_guid -[@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) type external_property_file_reference_guid = Sarif_v_2_1_0_t.external_property_file_reference_guid -[@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = Sarif_v_2_1_0_t.external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = + Sarif_v_2_1_0_t.external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) type external_property_file_references = - Sarif_v_2_1_0_t.external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = Sarif_v_2_1_0_t.run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the + Sarif_v_2_1_0_t.external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = Sarif_v_2_1_0_t.run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] - -let validate__float_option _ _ = None -let validate__string_list _ _ = None -let validate__string_list_option _ _ = None -let validate__string_option _ _ = None -let validate__x_c3c9756 _ _ = None - -let validate__x_d561347 path x = - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_property_bag" in - if Sarif_v_2_1_0_util.validate_property_bag x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (Atdgen_runtime.Ov_run.validate_list (fun path x -> - let _, x = x in - (fun _ _ -> None) (`Index 1 :: path) x)) - path - x -;; - -let validate_artifact_mimetype path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact_mimetype" in - if Sarif_v_2_1_0_util.validate_artifact_mimetype x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__artifact_mimetype_option = - Atdgen_runtime.Ov_run.validate_option validate_artifact_mimetype -;; - -let validate_artifact_roles_item _ _ = None -let validate__artifact_roles_item_list _ _ = None -let validate__artifact_roles_item_list_option _ _ = None - -let validate_external_properties_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties_guid" in - if Sarif_v_2_1_0_util.validate_external_properties_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__external_properties_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_external_properties_guid -;; - -let validate_external_properties_run_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties_run_guid" in - if Sarif_v_2_1_0_util.validate_external_properties_run_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__external_properties_run_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_external_properties_run_guid -;; - -let validate_external_properties_version _ _ = None -let validate__external_properties_version_option _ _ = None -let validate_hm_str_str = validate__x_c3c9756 -let validate__hm_str_str_option _ _ = None -let validate_int64 _ _ = None -let validate__int64_option _ _ = None -let validate_notification_level _ _ = None -let validate__notification_level_option _ _ = None -let validate_property_bag = validate__x_d561347 - -let validate__property_bag_option = - Atdgen_runtime.Ov_run.validate_option validate_property_bag -;; - -let validate_address : _ -> address -> _ = + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] + +let validate__float_option = ( + fun _ _ -> None +) +let validate__string_list = ( + fun _ _ -> None +) +let validate__string_list_option = ( + fun _ _ -> None +) +let validate__string_option = ( + fun _ _ -> None +) +let validate__x_c3c9756 = ( + fun _ _ -> None +) +let validate__x_d561347 = ( + (fun path x -> + (match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_property_bag" in + if (Sarif_v_2_1_0_util.validate_property_bag) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> ( + Atdgen_runtime.Ov_run.validate_list ( + fun path x -> + (let _, x = x in + ( + (fun _ _ -> None) + ) (`Index 1 :: path) x + ) + ) + ) path x + ) + ) +) +let validate_artifact_mimetype = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_address" in - if Sarif_v_2_1_0_util.validate_address x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__address_list = Atdgen_runtime.Ov_run.validate_list validate_address - -let validate__address_list_option = - Atdgen_runtime.Ov_run.validate_option validate__address_list -;; - -let validate__address_option = Atdgen_runtime.Ov_run.validate_option validate_address - -let validate_logical_location : _ -> logical_location -> _ = + let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact_mimetype" in + if (Sarif_v_2_1_0_util.validate_artifact_mimetype) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__artifact_mimetype_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_artifact_mimetype + ) +) +let validate_artifact_roles_item = ( + fun _ _ -> None +) +let validate__artifact_roles_item_list = ( + fun _ _ -> None +) +let validate__artifact_roles_item_list_option = ( + fun _ _ -> None +) +let validate_external_properties_guid = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_logical_location" in - if Sarif_v_2_1_0_util.validate_logical_location x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__logical_location_list = - Atdgen_runtime.Ov_run.validate_list validate_logical_location -;; - -let validate__logical_location_list_option = - Atdgen_runtime.Ov_run.validate_option validate__logical_location_list -;; - -let validate_message : _ -> message -> _ = - fun path x -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__message_option = Atdgen_runtime.Ov_run.validate_option validate_message - -let validate_artifact_location : _ -> artifact_location -> _ = + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties_guid" in + if (Sarif_v_2_1_0_util.validate_external_properties_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__external_properties_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_properties_guid + ) +) +let validate_external_properties_run_guid = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact_location" in - if Sarif_v_2_1_0_util.validate_artifact_location x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__artifact_location_list = - Atdgen_runtime.Ov_run.validate_list validate_artifact_location -;; - -let validate__artifact_location_list_option = - Atdgen_runtime.Ov_run.validate_option validate__artifact_location_list -;; - -let validate__artifact_location_option = - Atdgen_runtime.Ov_run.validate_option validate_artifact_location -;; - -let validate_edge : _ -> edge -> _ = + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties_run_guid" in + if (Sarif_v_2_1_0_util.validate_external_properties_run_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__external_properties_run_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_properties_run_guid + ) +) +let validate_external_properties_version = ( + fun _ _ -> None +) +let validate__external_properties_version_option = ( + fun _ _ -> None +) +let validate_hm_str_str = ( + validate__x_c3c9756 +) +let validate__hm_str_str_option = ( + fun _ _ -> None +) +let validate_int64 = ( + (fun _ _ -> None) +) +let validate__int64_option = ( + fun _ _ -> None +) +let validate_notification_level = ( + fun _ _ -> None +) +let validate__notification_level_option = ( + fun _ _ -> None +) +let validate_property_bag = ( + validate__x_d561347 +) +let validate__property_bag_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_property_bag + ) +) +let validate_address : _ -> address -> _ = ( fun path x -> - match validate__message_option (`Field "label" :: path) x.label with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__edge_list = Atdgen_runtime.Ov_run.validate_list validate_edge -let validate__edge_list_option = Atdgen_runtime.Ov_run.validate_option validate__edge_list - -let validate_location_relationship : _ -> location_relationship -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_address" in + if (Sarif_v_2_1_0_util.validate_address) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__address_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_address + ) +) +let validate__address_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__address_list + ) +) +let validate__address_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_address + ) +) +let validate_logical_location : _ -> logical_location -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_location_relationship" in - if Sarif_v_2_1_0_util.validate_location_relationship x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__location_relationship_list = - Atdgen_runtime.Ov_run.validate_list validate_location_relationship -;; - -let validate__location_relationship_list_option = - Atdgen_runtime.Ov_run.validate_option validate__location_relationship_list -;; - -let validate_multiformat_message_string : _ -> multiformat_message_string -> _ = - fun path x -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__multiformat_message_string_option = - Atdgen_runtime.Ov_run.validate_option validate_multiformat_message_string -;; - -let validate__x_a05fe6a = - Atdgen_runtime.Ov_run.validate_list (fun path x -> - let _, x = x in - validate_multiformat_message_string (`Index 1 :: path) x) -;; - -let validate_artifact_content : _ -> artifact_content -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_logical_location" in + if (Sarif_v_2_1_0_util.validate_logical_location) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__logical_location_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_logical_location + ) +) +let validate__logical_location_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__logical_location_list + ) +) +let validate_message : _ -> message -> _ = ( fun path x -> - match validate__property_bag_option (`Field "properties" :: path) x.properties with - | Some _ as err -> err - | None -> - validate__multiformat_message_string_option (`Field "rendered" :: path) x.rendered -;; - -let validate__artifact_content_option = - Atdgen_runtime.Ov_run.validate_option validate_artifact_content -;; - -let validate_hm_str_mms = validate__x_a05fe6a - -let validate__hm_str_mms_option = - Atdgen_runtime.Ov_run.validate_option validate_hm_str_mms -;; - -let validate_edge_traversal : _ -> edge_traversal -> _ = + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__message_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_message + ) +) +let validate_artifact_location : _ -> artifact_location -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_edge_traversal" in - if Sarif_v_2_1_0_util.validate_edge_traversal x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__hm_str_mms_option (`Field "final_state" :: path) x.final_state with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties)) -;; - -let validate__edge_traversal_list = - Atdgen_runtime.Ov_run.validate_list validate_edge_traversal -;; - -let validate__edge_traversal_list_option = - Atdgen_runtime.Ov_run.validate_option validate__edge_traversal_list -;; - -let validate_graph_traversal_variant0 : _ -> graph_traversal_variant0 -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact_location" in + if (Sarif_v_2_1_0_util.validate_artifact_location) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__artifact_location_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_artifact_location + ) +) +let validate__artifact_location_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__artifact_location_list + ) +) +let validate__artifact_location_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_artifact_location + ) +) +let validate_edge : _ -> edge -> _ = ( + fun path x -> + match + ( + validate__message_option + ) (`Field "label" :: path) x.label + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__edge_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_edge + ) +) +let validate__edge_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__edge_list + ) +) +let validate_location_relationship : _ -> location_relationship -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph_traversal_variant0" in - if Sarif_v_2_1_0_util.validate_graph_traversal_variant0 x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__edge_traversal_list_option - (`Field "edge_traversals" :: path) - x.edge_traversals + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_location_relationship" in + if (Sarif_v_2_1_0_util.validate_location_relationship) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "immutable_state" :: path) - x.immutable_state - with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "initial_state" :: path) - x.initial_state - with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__location_relationship_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_location_relationship + ) +) +let validate__location_relationship_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__location_relationship_list + ) +) +let validate_multiformat_message_string : _ -> multiformat_message_string -> _ = ( + fun path x -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__multiformat_message_string_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_multiformat_message_string + ) +) +let validate__x_a05fe6a = ( + Atdgen_runtime.Ov_run.validate_list ( + fun path x -> + (let _, x = x in + ( + validate_multiformat_message_string + ) (`Index 1 :: path) x + ) + ) +) +let validate_artifact_content : _ -> artifact_content -> _ = ( + fun path x -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__multiformat_message_string_option + ) (`Field "rendered" :: path) x.rendered +) +let validate__artifact_content_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_artifact_content + ) +) +let validate_hm_str_mms = ( + validate__x_a05fe6a +) +let validate__hm_str_mms_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_hm_str_mms + ) +) +let validate_edge_traversal : _ -> edge_traversal -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_edge_traversal" in + if (Sarif_v_2_1_0_util.validate_edge_traversal) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "final_state" :: path) x.final_state + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with | Some _ as err -> err | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties)))) -;; - -let validate_graph_traversal_variant1 : _ -> graph_traversal_variant1 -> _ = + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__edge_traversal_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_edge_traversal + ) +) +let validate__edge_traversal_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__edge_traversal_list + ) +) +let validate_graph_traversal_variant0 : _ -> graph_traversal_variant0 -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph_traversal_variant1" in - if Sarif_v_2_1_0_util.validate_graph_traversal_variant1 x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__edge_traversal_list_option - (`Field "edge_traversals" :: path) - x.edge_traversals + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph_traversal_variant0" in + if (Sarif_v_2_1_0_util.validate_graph_traversal_variant0) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "immutable_state" :: path) - x.immutable_state - with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "initial_state" :: path) - x.initial_state - with + | Some _ as err -> err + | None -> + match + ( + validate__edge_traversal_list_option + ) (`Field "edge_traversals" :: path) x.edge_traversals + with | Some _ as err -> err | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties)))) -;; - -let validate_graph_traversal path x = - match x with - | `Variant0 x -> validate_graph_traversal_variant0 path x - | `Variant1 x -> validate_graph_traversal_variant1 path x -;; - -let validate__graph_traversal_list = - Atdgen_runtime.Ov_run.validate_list validate_graph_traversal -;; - -let validate__graph_traversal_list_option = - Atdgen_runtime.Ov_run.validate_option validate__graph_traversal_list -;; - -let validate_rectangle : _ -> rectangle -> _ = + match + ( + validate__hm_str_mms_option + ) (`Field "immutable_state" :: path) x.immutable_state + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "initial_state" :: path) x.initial_state + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate_graph_traversal_variant1 : _ -> graph_traversal_variant1 -> _ = ( fun path x -> - match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__rectangle_list = Atdgen_runtime.Ov_run.validate_list validate_rectangle - -let validate__rectangle_list_option = - Atdgen_runtime.Ov_run.validate_option validate__rectangle_list -;; - -let validate_region : _ -> region -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph_traversal_variant1" in + if (Sarif_v_2_1_0_util.validate_graph_traversal_variant1) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + match + ( + validate__edge_traversal_list_option + ) (`Field "edge_traversals" :: path) x.edge_traversals + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "immutable_state" :: path) x.immutable_state + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "initial_state" :: path) x.initial_state + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate_graph_traversal = ( + fun path x -> + match x with + | `Variant0 x -> + ( + validate_graph_traversal_variant0 + ) path x + | `Variant1 x -> + ( + validate_graph_traversal_variant1 + ) path x +) +let validate__graph_traversal_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_graph_traversal + ) +) +let validate__graph_traversal_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__graph_traversal_list + ) +) +let validate_rectangle : _ -> rectangle -> _ = ( + fun path x -> + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__rectangle_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_rectangle + ) +) +let validate__rectangle_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__rectangle_list + ) +) +let validate_region : _ -> region -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_region" in - if Sarif_v_2_1_0_util.validate_region x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_region" in + if (Sarif_v_2_1_0_util.validate_region) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> validate__artifact_content_option (`Field "snippet" :: path) x.snippet)) -;; - -let validate__region_list = Atdgen_runtime.Ov_run.validate_list validate_region - -let validate__region_list_option = - Atdgen_runtime.Ov_run.validate_option validate__region_list -;; - -let validate__region_option = Atdgen_runtime.Ov_run.validate_option validate_region - -let validate_attachment : _ -> attachment -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__artifact_content_option + ) (`Field "snippet" :: path) x.snippet +) +let validate__region_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_region + ) +) +let validate__region_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__region_list + ) +) +let validate__region_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_region + ) +) +let validate_attachment : _ -> attachment -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_attachment" in - if Sarif_v_2_1_0_util.validate_attachment x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate_artifact_location (`Field "artifact_location" :: path) x.artifact_location - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties - with - | Some _ as err -> err - | None -> - (match - validate__rectangle_list_option (`Field "rectangles" :: path) x.rectangles - with + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_attachment" in + if (Sarif_v_2_1_0_util.validate_attachment) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate_artifact_location + ) (`Field "artifact_location" :: path) x.artifact_location + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with | Some _ as err -> err - | None -> validate__region_list_option (`Field "regions" :: path) x.regions)))) -;; - -let validate__attachment_list = Atdgen_runtime.Ov_run.validate_list validate_attachment - -let validate__attachment_list_option = - Atdgen_runtime.Ov_run.validate_option validate__attachment_list -;; - -let validate_physical_location : _ -> physical_location -> _ = + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + match + ( + validate__rectangle_list_option + ) (`Field "rectangles" :: path) x.rectangles + with + | Some _ as err -> err + | None -> + ( + validate__region_list_option + ) (`Field "regions" :: path) x.regions +) +let validate__attachment_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_attachment + ) +) +let validate__attachment_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__attachment_list + ) +) +let validate_physical_location : _ -> physical_location -> _ = ( fun path x -> - match validate__address_option (`Field "address" :: path) x.address with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "artifact_location" :: path) - x.artifact_location - with - | Some _ as err -> err - | None -> - (match - validate__region_option (`Field "context_region" :: path) x.context_region + match + ( + validate__address_option + ) (`Field "address" :: path) x.address + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "artifact_location" :: path) x.artifact_location with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties - with - | Some _ as err -> err - | None -> validate__region_option (`Field "region" :: path) x.region))) -;; - -let validate__physical_location_list = - Atdgen_runtime.Ov_run.validate_list validate_physical_location -;; - -let validate__physical_location_list_option = - Atdgen_runtime.Ov_run.validate_option validate__physical_location_list -;; - -let validate__physical_location_option = - Atdgen_runtime.Ov_run.validate_option validate_physical_location -;; - -let validate_location : _ -> location -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__region_option + ) (`Field "context_region" :: path) x.context_region + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__region_option + ) (`Field "region" :: path) x.region +) +let validate__physical_location_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_physical_location + ) +) +let validate__physical_location_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__physical_location_list + ) +) +let validate__physical_location_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_physical_location + ) +) +let validate_location : _ -> location -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_location" in - if Sarif_v_2_1_0_util.validate_location x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__region_list_option (`Field "annotations" :: path) x.annotations with - | Some _ as err -> err - | None -> - (match - validate__logical_location_list_option - (`Field "logical_locations" :: path) - x.logical_locations + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_location" in + if (Sarif_v_2_1_0_util.validate_location) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__region_list_option + ) (`Field "annotations" :: path) x.annotations with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - (match - validate__physical_location_option - (`Field "physical_location" :: path) - x.physical_location - with + | Some _ as err -> err + | None -> + match + ( + validate__logical_location_list_option + ) (`Field "logical_locations" :: path) x.logical_locations + with | Some _ as err -> err | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - validate__location_relationship_list_option - (`Field "relationships" :: path) - x.relationships))))) -;; - -let validate__location_list = Atdgen_runtime.Ov_run.validate_list validate_location - -let validate__location_list_option = - Atdgen_runtime.Ov_run.validate_option validate__location_list -;; - -let validate__location_option = Atdgen_runtime.Ov_run.validate_option validate_location - -let validate_replacement : _ -> replacement -> _ = + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + match + ( + validate__physical_location_option + ) (`Field "physical_location" :: path) x.physical_location + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__location_relationship_list_option + ) (`Field "relationships" :: path) x.relationships +) +let validate__location_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_location + ) +) +let validate__location_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__location_list + ) +) +let validate__location_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_location + ) +) +let validate_replacement : _ -> replacement -> _ = ( fun path x -> - match validate_region (`Field "deleted_region" :: path) x.deleted_region with - | Some _ as err -> err - | None -> - (match - validate__artifact_content_option - (`Field "inserted_content" :: path) - x.inserted_content - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__replacement_list = Atdgen_runtime.Ov_run.validate_list validate_replacement - -let validate_artifact_change : _ -> artifact_change -> _ = + match + ( + validate_region + ) (`Field "deleted_region" :: path) x.deleted_region + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_content_option + ) (`Field "inserted_content" :: path) x.inserted_content + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__replacement_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_replacement + ) +) +let validate_artifact_change : _ -> artifact_change -> _ = ( fun path x -> - match - validate_artifact_location (`Field "artifact_location" :: path) x.artifact_location - with - | Some _ as err -> err - | None -> - (match validate__property_bag_option (`Field "properties" :: path) x.properties with - | Some _ as err -> err - | None -> validate__replacement_list (`Field "replacements" :: path) x.replacements) -;; - -let validate__artifact_change_list = - Atdgen_runtime.Ov_run.validate_list validate_artifact_change -;; - -let validate_fix : _ -> fix -> _ = + match + ( + validate_artifact_location + ) (`Field "artifact_location" :: path) x.artifact_location + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__replacement_list + ) (`Field "replacements" :: path) x.replacements +) +let validate__artifact_change_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_artifact_change + ) +) +let validate_fix : _ -> fix -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_fix" in - if Sarif_v_2_1_0_util.validate_fix x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__artifact_change_list - (`Field "artifact_changes" :: path) - x.artifact_changes - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties)) -;; - -let validate__fix_list = Atdgen_runtime.Ov_run.validate_list validate_fix -let validate__fix_list_option = Atdgen_runtime.Ov_run.validate_option validate__fix_list -let validate_reporting_configuration_level _ _ = None -let validate__reporting_configuration_level_option _ _ = None - -let validate_reporting_configuration : _ -> reporting_configuration -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_fix" in + if (Sarif_v_2_1_0_util.validate_fix) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_change_list + ) (`Field "artifact_changes" :: path) x.artifact_changes + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__fix_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_fix + ) +) +let validate__fix_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__fix_list + ) +) +let validate_reporting_configuration_level = ( + fun _ _ -> None +) +let validate__reporting_configuration_level_option = ( + fun _ _ -> None +) +let validate_reporting_configuration : _ -> reporting_configuration -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_configuration" in - if Sarif_v_2_1_0_util.validate_reporting_configuration x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__property_bag_option (`Field "parameters" :: path) x.parameters with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__reporting_configuration_option = - Atdgen_runtime.Ov_run.validate_option validate_reporting_configuration -;; - -let validate_reporting_descriptor_deprecated_guids_item path x = - let msg = - "Failed check by \ - Sarif_v_2_1_0_util.validate_reporting_descriptor_deprecated_guids_item" - in - if Sarif_v_2_1_0_util.validate_reporting_descriptor_deprecated_guids_item x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__list_2041d89 = - Atdgen_runtime.Ov_run.validate_list validate_reporting_descriptor_deprecated_guids_item -;; - -let validate__option_aa202c3 = - Atdgen_runtime.Ov_run.validate_option validate__list_2041d89 -;; - -let validate_reporting_descriptor_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_guid" in - if Sarif_v_2_1_0_util.validate_reporting_descriptor_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__reporting_descriptor_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_reporting_descriptor_guid -;; - -let validate_reporting_descriptor_reference_guid path x = - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_reference_guid" - in - if Sarif_v_2_1_0_util.validate_reporting_descriptor_reference_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__reporting_descriptor_reference_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_reporting_descriptor_reference_guid -;; - -let validate_result_baseline_state _ _ = None -let validate__result_baseline_state_option _ _ = None - -let validate_result_correlation_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_correlation_guid" in - if Sarif_v_2_1_0_util.validate_result_correlation_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__result_correlation_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_result_correlation_guid -;; - -let validate_result_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_guid" in - if Sarif_v_2_1_0_util.validate_result_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__result_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_result_guid -;; - -let validate_result_kind _ _ = None -let validate__result_kind_option _ _ = None -let validate_result_level _ _ = None -let validate__result_level_option _ _ = None - -let validate_result_provenance_first_detection_run_guid path x = - let msg = - "Failed check by \ - Sarif_v_2_1_0_util.validate_result_provenance_first_detection_run_guid" - in - if Sarif_v_2_1_0_util.validate_result_provenance_first_detection_run_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__option_60f83e5 = - Atdgen_runtime.Ov_run.validate_option + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_configuration" in + if (Sarif_v_2_1_0_util.validate_reporting_configuration) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "parameters" :: path) x.parameters + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__reporting_configuration_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_reporting_configuration + ) +) +let validate_reporting_descriptor_deprecated_guids_item = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_deprecated_guids_item" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor_deprecated_guids_item) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__list_2041d89 = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_reporting_descriptor_deprecated_guids_item + ) +) +let validate__option_aa202c3 = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__list_2041d89 + ) +) +let validate_reporting_descriptor_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_guid" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__reporting_descriptor_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_reporting_descriptor_guid + ) +) +let validate_reporting_descriptor_reference_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_reference_guid" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor_reference_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__reporting_descriptor_reference_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_reporting_descriptor_reference_guid + ) +) +let validate_result_baseline_state = ( + fun _ _ -> None +) +let validate__result_baseline_state_option = ( + fun _ _ -> None +) +let validate_result_correlation_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_correlation_guid" in + if (Sarif_v_2_1_0_util.validate_result_correlation_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__result_correlation_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_result_correlation_guid + ) +) +let validate_result_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_guid" in + if (Sarif_v_2_1_0_util.validate_result_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__result_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_result_guid + ) +) +let validate_result_kind = ( + fun _ _ -> None +) +let validate__result_kind_option = ( + fun _ _ -> None +) +let validate_result_level = ( + fun _ _ -> None +) +let validate__result_level_option = ( + fun _ _ -> None +) +let validate_result_provenance_first_detection_run_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_provenance_first_detection_run_guid" in + if (Sarif_v_2_1_0_util.validate_result_provenance_first_detection_run_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__option_60f83e5 = ( + Atdgen_runtime.Ov_run.validate_option ( validate_result_provenance_first_detection_run_guid -;; - -let validate_result_provenance_last_detection_run_guid path x = - let msg = - "Failed check by \ - Sarif_v_2_1_0_util.validate_result_provenance_last_detection_run_guid" - in - if Sarif_v_2_1_0_util.validate_result_provenance_last_detection_run_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__option_0fcda76 = - Atdgen_runtime.Ov_run.validate_option validate_result_provenance_last_detection_run_guid -;; - -let validate_result_provenance : _ -> result_provenance -> _ = + ) +) +let validate_result_provenance_last_detection_run_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_provenance_last_detection_run_guid" in + if (Sarif_v_2_1_0_util.validate_result_provenance_last_detection_run_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__option_0fcda76 = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_result_provenance_last_detection_run_guid + ) +) +let validate_result_provenance : _ -> result_provenance -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_provenance" in - if Sarif_v_2_1_0_util.validate_result_provenance x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__physical_location_list_option - (`Field "conversion_sources" :: path) - x.conversion_sources - with - | Some _ as err -> err - | None -> - (match - validate__option_60f83e5 - (`Field "first_detection_run_guid" :: path) - x.first_detection_run_guid + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result_provenance" in + if (Sarif_v_2_1_0_util.validate_result_provenance) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__physical_location_list_option + ) (`Field "conversion_sources" :: path) x.conversion_sources with - | Some _ as err -> err - | None -> - (match - validate__option_0fcda76 - (`Field "last_detection_run_guid" :: path) - x.last_detection_run_guid - with - | Some _ as err -> err - | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties))) -;; - -let validate__result_provenance_option = - Atdgen_runtime.Ov_run.validate_option validate_result_provenance -;; - -let validate_stack_frame : _ -> stack_frame -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__option_60f83e5 + ) (`Field "first_detection_run_guid" :: path) x.first_detection_run_guid + with + | Some _ as err -> err + | None -> + match + ( + validate__option_0fcda76 + ) (`Field "last_detection_run_guid" :: path) x.last_detection_run_guid + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__result_provenance_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_result_provenance + ) +) +let validate_stack_frame : _ -> stack_frame -> _ = ( fun path x -> - match validate__location_option (`Field "location" :: path) x.location with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate__stack_frame_list = Atdgen_runtime.Ov_run.validate_list validate_stack_frame - -let validate_stack : _ -> stack -> _ = + match + ( + validate__location_option + ) (`Field "location" :: path) x.location + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__stack_frame_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_stack_frame + ) +) +let validate_stack : _ -> stack -> _ = ( fun path x -> - match validate__stack_frame_list (`Field "frames" :: path) x.frames with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__stack_list = Atdgen_runtime.Ov_run.validate_list validate_stack - -let validate__stack_list_option = - Atdgen_runtime.Ov_run.validate_option validate__stack_list -;; - -let validate__stack_option = Atdgen_runtime.Ov_run.validate_option validate_stack - -let validate_suppression_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_suppression_guid" in - if Sarif_v_2_1_0_util.validate_suppression_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__suppression_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_suppression_guid -;; - -let validate_suppression_kind _ _ = None -let validate_suppression_status _ _ = None -let validate__suppression_status_option _ _ = None - -let validate_suppression : _ -> suppression -> _ = + match + ( + validate__stack_frame_list + ) (`Field "frames" :: path) x.frames + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__stack_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_stack + ) +) +let validate__stack_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__stack_list + ) +) +let validate__stack_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_stack + ) +) +let validate_suppression_guid = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_suppression" in - if Sarif_v_2_1_0_util.validate_suppression x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__suppression_guid_option (`Field "guid" :: path) x.guid with - | Some _ as err -> err - | None -> - (match validate__location_option (`Field "location" :: path) x.location with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties)) -;; - -let validate__suppression_list = Atdgen_runtime.Ov_run.validate_list validate_suppression - -let validate__suppression_list_option = - Atdgen_runtime.Ov_run.validate_option validate__suppression_list -;; - -let validate_thread_flow_location_importance _ _ = None -let validate__thread_flow_location_importance_option _ _ = None -let validate_tool_component_contents_item _ _ = None -let validate__tool_component_contents_item_list _ _ = None -let validate__option_0ba29ed _ _ = None - -let validate_tool_component_dotted_quad_file_version path x = - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_tool_component_dotted_quad_file_version" - in - if Sarif_v_2_1_0_util.validate_tool_component_dotted_quad_file_version x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__option_d07cfb1 = - Atdgen_runtime.Ov_run.validate_option validate_tool_component_dotted_quad_file_version -;; - -let validate_tool_component_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_guid" in - if Sarif_v_2_1_0_util.validate_tool_component_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__tool_component_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_tool_component_guid -;; - -let validate_tool_component_language path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_language" in - if Sarif_v_2_1_0_util.validate_tool_component_language x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__tool_component_language_option = - Atdgen_runtime.Ov_run.validate_option validate_tool_component_language -;; - -let validate_tool_component_reference_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_reference_guid" in - if Sarif_v_2_1_0_util.validate_tool_component_reference_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__tool_component_reference_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_tool_component_reference_guid -;; - -let validate_tool_component_reference : _ -> tool_component_reference -> _ = + let msg = "Failed check by Sarif_v_2_1_0_util.validate_suppression_guid" in + if (Sarif_v_2_1_0_util.validate_suppression_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__suppression_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_suppression_guid + ) +) +let validate_suppression_kind = ( + fun _ _ -> None +) +let validate_suppression_status = ( + fun _ _ -> None +) +let validate__suppression_status_option = ( + fun _ _ -> None +) +let validate_suppression : _ -> suppression -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_reference" in - if Sarif_v_2_1_0_util.validate_tool_component_reference x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_reference_guid_option (`Field "guid" :: path) x.guid - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__tool_component_reference_list = - Atdgen_runtime.Ov_run.validate_list validate_tool_component_reference -;; - -let validate__tool_component_reference_list_option = - Atdgen_runtime.Ov_run.validate_option validate__tool_component_reference_list -;; - -let validate__tool_component_reference_option = - Atdgen_runtime.Ov_run.validate_option validate_tool_component_reference -;; - -let validate_reporting_descriptor_reference : _ -> reporting_descriptor_reference -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_suppression" in + if (Sarif_v_2_1_0_util.validate_suppression) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__suppression_guid_option + ) (`Field "guid" :: path) x.guid + with + | Some _ as err -> err + | None -> + match + ( + validate__location_option + ) (`Field "location" :: path) x.location + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__suppression_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_suppression + ) +) +let validate__suppression_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__suppression_list + ) +) +let validate_thread_flow_location_importance = ( + fun _ _ -> None +) +let validate__thread_flow_location_importance_option = ( + fun _ _ -> None +) +let validate_tool_component_contents_item = ( + fun _ _ -> None +) +let validate__tool_component_contents_item_list = ( + fun _ _ -> None +) +let validate__option_0ba29ed = ( + fun _ _ -> None +) +let validate_tool_component_dotted_quad_file_version = ( fun path x -> - match - (fun path x -> - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_reference" - in - if Sarif_v_2_1_0_util.validate_reporting_descriptor_reference x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_reference_guid_option (`Field "guid" :: path) x.guid - with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_dotted_quad_file_version" in + if (Sarif_v_2_1_0_util.validate_tool_component_dotted_quad_file_version) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__option_d07cfb1 = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component_dotted_quad_file_version + ) +) +let validate_tool_component_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_guid" in + if (Sarif_v_2_1_0_util.validate_tool_component_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__tool_component_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component_guid + ) +) +let validate_tool_component_language = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_language" in + if (Sarif_v_2_1_0_util.validate_tool_component_language) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__tool_component_language_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component_language + ) +) +let validate_tool_component_reference_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_reference_guid" in + if (Sarif_v_2_1_0_util.validate_tool_component_reference_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__tool_component_reference_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component_reference_guid + ) +) +let validate_tool_component_reference : _ -> tool_component_reference -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component_reference" in + if (Sarif_v_2_1_0_util.validate_tool_component_reference) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_reference_guid_option + ) (`Field "guid" :: path) x.guid with - | Some _ as err -> err - | None -> - validate__tool_component_reference_option - (`Field "tool_component" :: path) - x.tool_component)) -;; - -let validate__reporting_descriptor_reference_list = - Atdgen_runtime.Ov_run.validate_list validate_reporting_descriptor_reference -;; - -let validate__reporting_descriptor_reference_list_option = - Atdgen_runtime.Ov_run.validate_option validate__reporting_descriptor_reference_list -;; - -let validate__reporting_descriptor_reference_option = - Atdgen_runtime.Ov_run.validate_option validate_reporting_descriptor_reference -;; - -let validate_configuration_override : _ -> configuration_override -> _ = + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__tool_component_reference_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_tool_component_reference + ) +) +let validate__tool_component_reference_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__tool_component_reference_list + ) +) +let validate__tool_component_reference_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component_reference + ) +) +let validate_reporting_descriptor_reference : _ -> reporting_descriptor_reference -> _ = ( fun path x -> - match - validate_reporting_configuration (`Field "configuration" :: path) x.configuration - with - | Some _ as err -> err - | None -> - (match - validate_reporting_descriptor_reference (`Field "descriptor" :: path) x.descriptor - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__configuration_override_list = - Atdgen_runtime.Ov_run.validate_list validate_configuration_override -;; - -let validate__configuration_override_list_option = - Atdgen_runtime.Ov_run.validate_option validate__configuration_override_list -;; - -let validate_reporting_descriptor_relationship - : _ -> reporting_descriptor_relationship -> _ - = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_reference" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor_reference) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_guid_option + ) (`Field "guid" :: path) x.guid + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__tool_component_reference_option + ) (`Field "tool_component" :: path) x.tool_component +) +let validate__reporting_descriptor_reference_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_reporting_descriptor_reference + ) +) +let validate__reporting_descriptor_reference_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__reporting_descriptor_reference_list + ) +) +let validate__reporting_descriptor_reference_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_reporting_descriptor_reference + ) +) +let validate_configuration_override : _ -> configuration_override -> _ = ( fun path x -> - match - (fun path x -> - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_relationship" - in - if Sarif_v_2_1_0_util.validate_reporting_descriptor_relationship x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + match + ( + validate_reporting_configuration + ) (`Field "configuration" :: path) x.configuration + with + | Some _ as err -> err + | None -> + match + ( + validate_reporting_descriptor_reference + ) (`Field "descriptor" :: path) x.descriptor with - | Some _ as err -> err - | None -> - validate_reporting_descriptor_reference (`Field "target" :: path) x.target)) -;; - -let validate__reporting_descriptor_relationship_list = - Atdgen_runtime.Ov_run.validate_list validate_reporting_descriptor_relationship -;; - -let validate__reporting_descriptor_relationship_list_option = - Atdgen_runtime.Ov_run.validate_option validate__reporting_descriptor_relationship_list -;; - -let validate_reporting_descriptor : _ -> reporting_descriptor -> _ = + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__configuration_override_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_configuration_override + ) +) +let validate__configuration_override_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__configuration_override_list + ) +) +let validate_reporting_descriptor_relationship : _ -> reporting_descriptor_relationship -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor_relationship" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor_relationship) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate_reporting_descriptor_reference + ) (`Field "target" :: path) x.target +) +let validate__reporting_descriptor_relationship_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_reporting_descriptor_relationship + ) +) +let validate__reporting_descriptor_relationship_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__reporting_descriptor_relationship_list + ) +) +let validate_reporting_descriptor : _ -> reporting_descriptor -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor" in - if Sarif_v_2_1_0_util.validate_reporting_descriptor x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__reporting_configuration_option - (`Field "default_configuration" :: path) - x.default_configuration - with - | Some _ as err -> err - | None -> - (match - validate__option_aa202c3 (`Field "deprecated_guids" :: path) x.deprecated_guids + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_reporting_descriptor" in + if (Sarif_v_2_1_0_util.validate_reporting_descriptor) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_configuration_option + ) (`Field "default_configuration" :: path) x.default_configuration with - | Some _ as err -> err - | None -> - (match - validate__multiformat_message_string_option - (`Field "full_description" :: path) - x.full_description - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_guid_option (`Field "guid" :: path) x.guid - with + | Some _ as err -> err + | None -> + match + ( + validate__option_aa202c3 + ) (`Field "deprecated_guids" :: path) x.deprecated_guids + with | Some _ as err -> err | None -> - (match - validate__multiformat_message_string_option - (`Field "help" :: path) - x.help - with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "message_strings" :: path) - x.message_strings + match + ( + validate__multiformat_message_string_option + ) (`Field "full_description" :: path) x.full_description + with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_guid_option + ) (`Field "guid" :: path) x.guid with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_relationship_list_option - (`Field "relationships" :: path) - x.relationships - with + | Some _ as err -> err + | None -> + match + ( + validate__multiformat_message_string_option + ) (`Field "help" :: path) x.help + with | Some _ as err -> err | None -> - validate__multiformat_message_string_option - (`Field "short_description" :: path) - x.short_description)))))))) -;; - -let validate__reporting_descriptor_list = - Atdgen_runtime.Ov_run.validate_list validate_reporting_descriptor -;; - -let validate__reporting_descriptor_list_option = - Atdgen_runtime.Ov_run.validate_option validate__reporting_descriptor_list -;; - -let validate_translation_metadata : _ -> translation_metadata -> _ = + match + ( + validate__hm_str_mms_option + ) (`Field "message_strings" :: path) x.message_strings + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_relationship_list_option + ) (`Field "relationships" :: path) x.relationships + with + | Some _ as err -> err + | None -> + ( + validate__multiformat_message_string_option + ) (`Field "short_description" :: path) x.short_description +) +let validate__reporting_descriptor_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_reporting_descriptor + ) +) +let validate__reporting_descriptor_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__reporting_descriptor_list + ) +) +let validate_translation_metadata : _ -> translation_metadata -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_translation_metadata" in - if Sarif_v_2_1_0_util.validate_translation_metadata x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__multiformat_message_string_option - (`Field "full_description" :: path) - x.full_description - with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_translation_metadata" in + if (Sarif_v_2_1_0_util.validate_translation_metadata) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__multiformat_message_string_option + ) (`Field "full_description" :: path) x.full_description with - | Some _ as err -> err - | None -> - validate__multiformat_message_string_option - (`Field "short_description" :: path) - x.short_description)) -;; - -let validate__translation_metadata_option = - Atdgen_runtime.Ov_run.validate_option validate_translation_metadata -;; - -let validate_tool_component : _ -> tool_component -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__multiformat_message_string_option + ) (`Field "short_description" :: path) x.short_description +) +let validate__translation_metadata_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_translation_metadata + ) +) +let validate_tool_component : _ -> tool_component -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component" in - if Sarif_v_2_1_0_util.validate_tool_component x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_reference_option - (`Field "associated_component" :: path) - x.associated_component - with - | Some _ as err -> err - | None -> - (match - validate__option_d07cfb1 - (`Field "dotted_quad_file_version" :: path) - x.dotted_quad_file_version + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool_component" in + if (Sarif_v_2_1_0_util.validate_tool_component) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_reference_option + ) (`Field "associated_component" :: path) x.associated_component with - | Some _ as err -> err - | None -> - (match - validate__multiformat_message_string_option - (`Field "full_description" :: path) - x.full_description - with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option - (`Field "global_message_strings" :: path) - x.global_message_strings - with + | Some _ as err -> err + | None -> + match + ( + validate__option_d07cfb1 + ) (`Field "dotted_quad_file_version" :: path) x.dotted_quad_file_version + with | Some _ as err -> err | None -> - (match - validate__tool_component_guid_option (`Field "guid" :: path) x.guid - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_language_option - (`Field "language" :: path) - x.language + match + ( + validate__multiformat_message_string_option + ) (`Field "full_description" :: path) x.full_description + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "global_message_strings" :: path) x.global_message_strings with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_list_option - (`Field "locations" :: path) - x.locations - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_list_option - (`Field "notifications" :: path) - x.notifications - with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_guid_option + ) (`Field "guid" :: path) x.guid + with | Some _ as err -> err | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_list_option - (`Field "rules" :: path) - x.rules + match + ( + validate__tool_component_language_option + ) (`Field "language" :: path) x.language + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_list_option + ) (`Field "locations" :: path) x.locations with - | Some _ as err -> err - | None -> - (match - validate__multiformat_message_string_option - (`Field "short_description" :: path) - x.short_description - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_reference_list_option - (`Field "supported_taxonomies" :: path) - x.supported_taxonomies - with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_list_option + ) (`Field "notifications" :: path) x.notifications + with | Some _ as err -> err | None -> - (match - validate__reporting_descriptor_list_option - (`Field "taxa" :: path) - x.taxa - with - | Some _ as err -> err - | None -> - validate__translation_metadata_option - (`Field "translation_metadata" :: path) - x.translation_metadata))))))))))))) -;; - -let validate__tool_component_list = - Atdgen_runtime.Ov_run.validate_list validate_tool_component -;; - -let validate__tool_component_list_option = - Atdgen_runtime.Ov_run.validate_option validate__tool_component_list -;; - -let validate__tool_component_option = - Atdgen_runtime.Ov_run.validate_option validate_tool_component -;; - -let validate_tool : _ -> tool -> _ = + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_list_option + ) (`Field "rules" :: path) x.rules + with + | Some _ as err -> err + | None -> + match + ( + validate__multiformat_message_string_option + ) (`Field "short_description" :: path) x.short_description + with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_reference_list_option + ) (`Field "supported_taxonomies" :: path) x.supported_taxonomies + with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_list_option + ) (`Field "taxa" :: path) x.taxa + with + | Some _ as err -> err + | None -> + ( + validate__translation_metadata_option + ) (`Field "translation_metadata" :: path) x.translation_metadata +) +let validate__tool_component_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_tool_component + ) +) +let validate__tool_component_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__tool_component_list + ) +) +let validate__tool_component_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_tool_component + ) +) +let validate_tool : _ -> tool -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool" in - if Sarif_v_2_1_0_util.validate_tool x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate_tool_component (`Field "driver" :: path) x.driver with - | Some _ as err -> err - | None -> - (match - validate__tool_component_list_option (`Field "extensions" :: path) x.extensions + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_tool" in + if (Sarif_v_2_1_0_util.validate_tool) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate_tool_component + ) (`Field "driver" :: path) x.driver with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties)) -;; - -let validate_web_request : _ -> web_request -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "extensions" :: path) x.extensions + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate_web_request : _ -> web_request -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_web_request" in - if Sarif_v_2_1_0_util.validate_web_request x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__artifact_content_option (`Field "body" :: path) x.body with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__web_request_list = Atdgen_runtime.Ov_run.validate_list validate_web_request - -let validate__web_request_list_option = - Atdgen_runtime.Ov_run.validate_option validate__web_request_list -;; - -let validate__web_request_option = - Atdgen_runtime.Ov_run.validate_option validate_web_request -;; - -let validate_web_response : _ -> web_response -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_web_request" in + if (Sarif_v_2_1_0_util.validate_web_request) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_content_option + ) (`Field "body" :: path) x.body + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__web_request_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_web_request + ) +) +let validate__web_request_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__web_request_list + ) +) +let validate__web_request_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_web_request + ) +) +let validate_web_response : _ -> web_response -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_web_response" in - if Sarif_v_2_1_0_util.validate_web_response x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__artifact_content_option (`Field "body" :: path) x.body with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate__web_response_list = - Atdgen_runtime.Ov_run.validate_list validate_web_response -;; - -let validate__web_response_list_option = - Atdgen_runtime.Ov_run.validate_option validate__web_response_list -;; - -let validate__web_response_option = - Atdgen_runtime.Ov_run.validate_option validate_web_response -;; - -let validate_thread_flow_location : _ -> thread_flow_location -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_web_response" in + if (Sarif_v_2_1_0_util.validate_web_response) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_content_option + ) (`Field "body" :: path) x.body + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__web_response_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_web_response + ) +) +let validate__web_response_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__web_response_list + ) +) +let validate__web_response_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_web_response + ) +) +let validate_thread_flow_location : _ -> thread_flow_location -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_thread_flow_location" in - if Sarif_v_2_1_0_util.validate_thread_flow_location x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__location_option (`Field "location" :: path) x.location with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_thread_flow_location" in + if (Sarif_v_2_1_0_util.validate_thread_flow_location) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__location_option + ) (`Field "location" :: path) x.location with - | Some _ as err -> err - | None -> - (match validate__stack_option (`Field "stack" :: path) x.stack with - | Some _ as err -> err - | None -> - (match validate__hm_str_mms_option (`Field "state" :: path) x.state with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with | Some _ as err -> err | None -> - (match - validate__reporting_descriptor_reference_list_option - (`Field "taxa" :: path) - x.taxa - with - | Some _ as err -> err - | None -> - (match - validate__web_request_option - (`Field "web_request" :: path) - x.web_request + match + ( + validate__stack_option + ) (`Field "stack" :: path) x.stack + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "state" :: path) x.state with - | Some _ as err -> err - | None -> - validate__web_response_option - (`Field "web_response" :: path) - x.web_response)))))) -;; - -let validate__thread_flow_location_list = - Atdgen_runtime.Ov_run.validate_list validate_thread_flow_location -;; - -let validate__thread_flow_location_list_option = - Atdgen_runtime.Ov_run.validate_option validate__thread_flow_location_list -;; - -let validate_thread_flow : _ -> thread_flow -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_list_option + ) (`Field "taxa" :: path) x.taxa + with + | Some _ as err -> err + | None -> + match + ( + validate__web_request_option + ) (`Field "web_request" :: path) x.web_request + with + | Some _ as err -> err + | None -> + ( + validate__web_response_option + ) (`Field "web_response" :: path) x.web_response +) +let validate__thread_flow_location_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_thread_flow_location + ) +) +let validate__thread_flow_location_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__thread_flow_location_list + ) +) +let validate_thread_flow : _ -> thread_flow -> _ = ( fun path x -> - match - validate__hm_str_mms_option (`Field "immutable_state" :: path) x.immutable_state - with - | Some _ as err -> err - | None -> - (match - validate__hm_str_mms_option (`Field "initial_state" :: path) x.initial_state - with - | Some _ as err -> err - | None -> - (match - validate__thread_flow_location_list (`Field "locations" :: path) x.locations + match + ( + validate__hm_str_mms_option + ) (`Field "immutable_state" :: path) x.immutable_state + with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_mms_option + ) (`Field "initial_state" :: path) x.initial_state with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties))) -;; - -let validate__thread_flow_list = Atdgen_runtime.Ov_run.validate_list validate_thread_flow - -let validate_code_flow : _ -> code_flow -> _ = - fun path x -> - match validate__message_option (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - (match validate__property_bag_option (`Field "properties" :: path) x.properties with - | Some _ as err -> err - | None -> validate__thread_flow_list (`Field "thread_flows" :: path) x.thread_flows) -;; - -let validate__code_flow_list = Atdgen_runtime.Ov_run.validate_list validate_code_flow - -let validate__code_flow_list_option = - Atdgen_runtime.Ov_run.validate_option validate__code_flow_list -;; - -let rec validate__node_list path x = - (Atdgen_runtime.Ov_run.validate_list validate_node) path x - -and validate__node_list_option path x = - (Atdgen_runtime.Ov_run.validate_option validate__node_list) path x - -and validate_node : _ -> node -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__thread_flow_location_list + ) (`Field "locations" :: path) x.locations + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__thread_flow_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_thread_flow + ) +) +let validate_code_flow : _ -> code_flow -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_node" in - if Sarif_v_2_1_0_util.validate_node x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__node_list_option (`Field "children" :: path) x.children with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "label" :: path) x.label with - | Some _ as err -> err - | None -> - (match validate__location_option (`Field "location" :: path) x.location with - | Some _ as err -> err - | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties))) -;; - -let rec validate__exception_list path x = - (Atdgen_runtime.Ov_run.validate_list validate_exception_) path x - -and validate__exception_list_option path x = - (Atdgen_runtime.Ov_run.validate_option validate__exception_list) path x - -and validate_exception_ : _ -> exception_ -> _ = + match + ( + validate__message_option + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__thread_flow_list + ) (`Field "thread_flows" :: path) x.thread_flows +) +let validate__code_flow_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_code_flow + ) +) +let validate__code_flow_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__code_flow_list + ) +) +let rec validate__node_list path x = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_node + ) +) path x +and validate__node_list_option path x = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__node_list + ) +) path x +and validate_node : _ -> node -> _ = ( fun path x -> - match - validate__exception_list_option (`Field "inner_exceptions" :: path) x.inner_exceptions - with - | Some _ as err -> err - | None -> - (match validate__property_bag_option (`Field "properties" :: path) x.properties with - | Some _ as err -> err - | None -> validate__stack_option (`Field "stack" :: path) x.stack) -;; - -let validate_graph : _ -> graph -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_node" in + if (Sarif_v_2_1_0_util.validate_node) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__node_list_option + ) (`Field "children" :: path) x.children + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "label" :: path) x.label + with + | Some _ as err -> err + | None -> + match + ( + validate__location_option + ) (`Field "location" :: path) x.location + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let rec validate__exception_list path x = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_exception_ + ) +) path x +and validate__exception_list_option path x = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__exception_list + ) +) path x +and validate_exception_ : _ -> exception_ -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph" in - if Sarif_v_2_1_0_util.validate_graph x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match validate__edge_list_option (`Field "edges" :: path) x.edges with - | Some _ as err -> err - | None -> - (match validate__node_list_option (`Field "nodes" :: path) x.nodes with - | Some _ as err -> err - | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties))) -;; - -let validate__graph_list = Atdgen_runtime.Ov_run.validate_list validate_graph - -let validate__graph_list_option = - Atdgen_runtime.Ov_run.validate_option validate__graph_list -;; - -let validate_result : _ -> result -> _ = + match + ( + validate__exception_list_option + ) (`Field "inner_exceptions" :: path) x.inner_exceptions + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__stack_option + ) (`Field "stack" :: path) x.stack +) +let validate_graph : _ -> graph -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_graph" in + if (Sarif_v_2_1_0_util.validate_graph) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + match + ( + validate__edge_list_option + ) (`Field "edges" :: path) x.edges + with + | Some _ as err -> err + | None -> + match + ( + validate__node_list_option + ) (`Field "nodes" :: path) x.nodes + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__graph_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_graph + ) +) +let validate__graph_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__graph_list + ) +) +let validate_result : _ -> result -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_result" in - if Sarif_v_2_1_0_util.validate_result x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "analysis_target" :: path) - x.analysis_target - with - | Some _ as err -> err - | None -> - (match - validate__attachment_list_option (`Field "attachments" :: path) x.attachments + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_result" in + if (Sarif_v_2_1_0_util.validate_result) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "analysis_target" :: path) x.analysis_target with - | Some _ as err -> err - | None -> - (match - validate__code_flow_list_option (`Field "code_flows" :: path) x.code_flows - with - | Some _ as err -> err - | None -> - (match - validate__result_correlation_guid_option - (`Field "correlation_guid" :: path) - x.correlation_guid - with + | Some _ as err -> err + | None -> + match + ( + validate__attachment_list_option + ) (`Field "attachments" :: path) x.attachments + with | Some _ as err -> err | None -> - (match validate__fix_list_option (`Field "fixes" :: path) x.fixes with - | Some _ as err -> err - | None -> - (match - validate__graph_traversal_list_option - (`Field "graph_traversals" :: path) - x.graph_traversals + match + ( + validate__code_flow_list_option + ) (`Field "code_flows" :: path) x.code_flows + with + | Some _ as err -> err + | None -> + match + ( + validate__result_correlation_guid_option + ) (`Field "correlation_guid" :: path) x.correlation_guid with - | Some _ as err -> err - | None -> - (match - validate__graph_list_option (`Field "graphs" :: path) x.graphs - with - | Some _ as err -> err - | None -> - (match - validate__result_guid_option (`Field "guid" :: path) x.guid - with + | Some _ as err -> err + | None -> + match + ( + validate__fix_list_option + ) (`Field "fixes" :: path) x.fixes + with | Some _ as err -> err | None -> - (match - validate__location_list_option - (`Field "locations" :: path) - x.locations - with - | Some _ as err -> err - | None -> - (match - validate_message (`Field "message" :: path) x.message + match + ( + validate__graph_traversal_list_option + ) (`Field "graph_traversals" :: path) x.graph_traversals + with + | Some _ as err -> err + | None -> + match + ( + validate__graph_list_option + ) (`Field "graphs" :: path) x.graphs with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - (match - validate__result_provenance_option - (`Field "provenance" :: path) - x.provenance - with + | Some _ as err -> err + | None -> + match + ( + validate__result_guid_option + ) (`Field "guid" :: path) x.guid + with | Some _ as err -> err | None -> - (match - validate__location_list_option - (`Field "related_locations" :: path) - x.related_locations - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_reference_option - (`Field "rule" :: path) - x.rule + match + ( + validate__location_list_option + ) (`Field "locations" :: path) x.locations + with + | Some _ as err -> err + | None -> + match + ( + validate_message + ) (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - (match - validate__stack_list_option - (`Field "stacks" :: path) - x.stacks - with - | Some _ as err -> err - | None -> - (match - validate__suppression_list_option - (`Field "suppressions" :: path) - x.suppressions - with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with | Some _ as err -> err | None -> - (match - validate__reporting_descriptor_reference_list_option - (`Field "taxa" :: path) - x.taxa - with - | Some _ as err -> err - | None -> - (match - validate__web_request_option - (`Field "web_request" :: path) - x.web_request + match + ( + validate__result_provenance_option + ) (`Field "provenance" :: path) x.provenance + with + | Some _ as err -> err + | None -> + match + ( + validate__location_list_option + ) (`Field "related_locations" :: path) x.related_locations with - | Some _ as err -> err - | None -> - validate__web_response_option - (`Field "web_response" :: path) - x.web_response)))))))))))))))))) -;; - -let validate__exception_option = Atdgen_runtime.Ov_run.validate_option validate_exception_ - -let validate_notification : _ -> notification -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_option + ) (`Field "rule" :: path) x.rule + with + | Some _ as err -> err + | None -> + match + ( + validate__stack_list_option + ) (`Field "stacks" :: path) x.stacks + with + | Some _ as err -> err + | None -> + match + ( + validate__suppression_list_option + ) (`Field "suppressions" :: path) x.suppressions + with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_list_option + ) (`Field "taxa" :: path) x.taxa + with + | Some _ as err -> err + | None -> + match + ( + validate__web_request_option + ) (`Field "web_request" :: path) x.web_request + with + | Some _ as err -> err + | None -> + ( + validate__web_response_option + ) (`Field "web_response" :: path) x.web_response +) +let validate__exception_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_exception_ + ) +) +let validate_notification : _ -> notification -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_notification" in - if Sarif_v_2_1_0_util.validate_notification x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_reference_option - (`Field "associated_rule" :: path) - x.associated_rule - with - | Some _ as err -> err - | None -> - (match - validate__reporting_descriptor_reference_option - (`Field "descriptor" :: path) - x.descriptor + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_notification" in + if (Sarif_v_2_1_0_util.validate_notification) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_option + ) (`Field "associated_rule" :: path) x.associated_rule with - | Some _ as err -> err - | None -> - (match - validate__exception_option (`Field "exception_" :: path) x.exception_ - with - | Some _ as err -> err - | None -> - (match - validate__location_list_option (`Field "locations" :: path) x.locations - with + | Some _ as err -> err + | None -> + match + ( + validate__reporting_descriptor_reference_option + ) (`Field "descriptor" :: path) x.descriptor + with | Some _ as err -> err | None -> - (match validate_message (`Field "message" :: path) x.message with - | Some _ as err -> err - | None -> - validate__property_bag_option - (`Field "properties" :: path) - x.properties))))) -;; - -let validate__notification_list = - Atdgen_runtime.Ov_run.validate_list validate_notification -;; - -let validate__notification_list_option = - Atdgen_runtime.Ov_run.validate_option validate__notification_list -;; - -let validate_invocation : _ -> invocation -> _ = + match + ( + validate__exception_option + ) (`Field "exception_" :: path) x.exception_ + with + | Some _ as err -> err + | None -> + match + ( + validate__location_list_option + ) (`Field "locations" :: path) x.locations + with + | Some _ as err -> err + | None -> + match + ( + validate_message + ) (`Field "message" :: path) x.message + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__notification_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_notification + ) +) +let validate__notification_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__notification_list + ) +) +let validate_invocation : _ -> invocation -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_invocation" in - if Sarif_v_2_1_0_util.validate_invocation x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "executable_location" :: path) - x.executable_location - with - | Some _ as err -> err - | None -> - (match - validate__configuration_override_list_option - (`Field "notification_configuration_overrides" :: path) - x.notification_configuration_overrides + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_invocation" in + if (Sarif_v_2_1_0_util.validate_invocation) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "executable_location" :: path) x.executable_location with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_list_option - (`Field "response_files" :: path) - x.response_files - with + | Some _ as err -> err + | None -> + match + ( + validate__configuration_override_list_option + ) (`Field "notification_configuration_overrides" :: path) x.notification_configuration_overrides + with | Some _ as err -> err | None -> - (match - validate__configuration_override_list_option - (`Field "rule_configuration_overrides" :: path) - x.rule_configuration_overrides - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "stderr" :: path) - x.stderr + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_list_option + ) (`Field "response_files" :: path) x.response_files with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "stdin" :: path) - x.stdin - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option - (`Field "stdout" :: path) - x.stdout - with + | Some _ as err -> err + | None -> + match + ( + validate__configuration_override_list_option + ) (`Field "rule_configuration_overrides" :: path) x.rule_configuration_overrides + with | Some _ as err -> err | None -> - (match - validate__artifact_location_option - (`Field "stdout_stderr" :: path) - x.stdout_stderr - with - | Some _ as err -> err - | None -> - (match - validate__notification_list_option - (`Field "tool_configuration_notifications" :: path) - x.tool_configuration_notifications + match + ( + validate__artifact_location_option + ) (`Field "stderr" :: path) x.stderr + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "stdin" :: path) x.stdin with - | Some _ as err -> err - | None -> - (match - validate__notification_list_option - (`Field "tool_execution_notifications" :: path) - x.tool_execution_notifications - with - | Some _ as err -> err - | None -> - validate__artifact_location_option - (`Field "working_directory" :: path) - x.working_directory))))))))))) -;; - -let validate__invocation_option = - Atdgen_runtime.Ov_run.validate_option validate_invocation -;; - -let validate_conversion : _ -> conversion -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "stdout" :: path) x.stdout + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "stdout_stderr" :: path) x.stdout_stderr + with + | Some _ as err -> err + | None -> + match + ( + validate__notification_list_option + ) (`Field "tool_configuration_notifications" :: path) x.tool_configuration_notifications + with + | Some _ as err -> err + | None -> + match + ( + validate__notification_list_option + ) (`Field "tool_execution_notifications" :: path) x.tool_execution_notifications + with + | Some _ as err -> err + | None -> + ( + validate__artifact_location_option + ) (`Field "working_directory" :: path) x.working_directory +) +let validate__invocation_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_invocation + ) +) +let validate_conversion : _ -> conversion -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_conversion" in - if Sarif_v_2_1_0_util.validate_conversion x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_list_option - (`Field "analysis_tool_log_files" :: path) - x.analysis_tool_log_files - with - | Some _ as err -> err - | None -> - (match validate__invocation_option (`Field "invocation" :: path) x.invocation with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties - with - | Some _ as err -> err - | None -> validate_tool (`Field "tool" :: path) x.tool))) -;; - -let validate__result_option = Atdgen_runtime.Ov_run.validate_option validate_result - -let validate__conversion_option = - Atdgen_runtime.Ov_run.validate_option validate_conversion -;; - -let rec validate__artifact_list path x = - (Atdgen_runtime.Ov_run.validate_list validate_artifact) path x - -and validate__artifact_list_option path x = - (Atdgen_runtime.Ov_run.validate_option validate__artifact_list) path x - -and validate__external_properties_option path x = - (Atdgen_runtime.Ov_run.validate_option validate_external_properties) path x - -and validate_artifact : _ -> artifact -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_conversion" in + if (Sarif_v_2_1_0_util.validate_conversion) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_list_option + ) (`Field "analysis_tool_log_files" :: path) x.analysis_tool_log_files + with + | Some _ as err -> err + | None -> + match + ( + validate__invocation_option + ) (`Field "invocation" :: path) x.invocation + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate_tool + ) (`Field "tool" :: path) x.tool +) +let validate__result_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_result + ) +) +let validate__conversion_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_conversion + ) +) +let rec validate__artifact_list path x = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_artifact + ) +) path x +and validate__artifact_list_option path x = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__artifact_list + ) +) path x +and validate__external_properties_option path x = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_properties + ) +) path x +and validate_artifact : _ -> artifact -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact" in - if Sarif_v_2_1_0_util.validate_artifact x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__artifact_content_option (`Field "contents" :: path) x.contents with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option (`Field "location" :: path) x.location - with - | Some _ as err -> err - | None -> - (match - validate__artifact_mimetype_option - (`Field "mime_type" :: path) - x.mime_type - with + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_artifact" in + if (Sarif_v_2_1_0_util.validate_artifact) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_content_option + ) (`Field "contents" :: path) x.contents + with + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with | Some _ as err -> err | None -> - validate__external_properties_option - (`Field "properties" :: path) - x.properties)))) - -and validate_external_properties : _ -> external_properties -> _ = + match + ( + validate__artifact_location_option + ) (`Field "location" :: path) x.location + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_mimetype_option + ) (`Field "mime_type" :: path) x.mime_type + with + | Some _ as err -> err + | None -> + ( + validate__external_properties_option + ) (`Field "properties" :: path) x.properties +) +and validate_external_properties : _ -> external_properties -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties" in - if Sarif_v_2_1_0_util.validate_external_properties x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__address_list_option (`Field "addresses" :: path) x.addresses with - | Some _ as err -> err - | None -> - (match validate__artifact_list_option (`Field "artifacts" :: path) x.artifacts with - | Some _ as err -> err - | None -> - (match - validate__conversion_option (`Field "conversion" :: path) x.conversion - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_option (`Field "driver" :: path) x.driver - with + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_properties" in + if (Sarif_v_2_1_0_util.validate_external_properties) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__address_list_option + ) (`Field "addresses" :: path) x.addresses + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_list_option + ) (`Field "artifacts" :: path) x.artifacts + with | Some _ as err -> err | None -> - (match - validate__tool_component_list_option - (`Field "extensions" :: path) - x.extensions - with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option - (`Field "externalized_properties" :: path) - x.externalized_properties + match + ( + validate__conversion_option + ) (`Field "conversion" :: path) x.conversion + with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_option + ) (`Field "driver" :: path) x.driver with - | Some _ as err -> err - | None -> - (match - validate__graph_list_option (`Field "graph" :: path) x.graph - with - | Some _ as err -> err - | None -> - (match - validate__external_properties_guid_option - (`Field "guid" :: path) - x.guid - with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "extensions" :: path) x.extensions + with | Some _ as err -> err | None -> - (match - validate__invocation_option - (`Field "invocations" :: path) - x.invocations - with - | Some _ as err -> err - | None -> - (match - validate__logical_location_list_option - (`Field "logical_locations" :: path) - x.logical_locations + match + ( + validate__property_bag_option + ) (`Field "externalized_properties" :: path) x.externalized_properties + with + | Some _ as err -> err + | None -> + match + ( + validate__graph_list_option + ) (`Field "graph" :: path) x.graph with - | Some _ as err -> err - | None -> - (match - validate__tool_component_list_option - (`Field "policies" :: path) - x.policies - with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with + | Some _ as err -> err + | None -> + match + ( + validate__external_properties_guid_option + ) (`Field "guid" :: path) x.guid + with | Some _ as err -> err | None -> - (match - validate__result_option - (`Field "results" :: path) - x.results - with - | Some _ as err -> err - | None -> - (match - validate__external_properties_run_guid_option - (`Field "run_guid" :: path) - x.run_guid + match + ( + validate__invocation_option + ) (`Field "invocations" :: path) x.invocations + with + | Some _ as err -> err + | None -> + match + ( + validate__logical_location_list_option + ) (`Field "logical_locations" :: path) x.logical_locations with - | Some _ as err -> err - | None -> - (match - validate__tool_component_list_option - (`Field "taxonomies" :: path) - x.taxonomies - with - | Some _ as err -> err - | None -> - (match - validate__thread_flow_location_list_option - (`Field "thread_flow_locations" - :: path) - x.thread_flow_locations - with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "policies" :: path) x.policies + with | Some _ as err -> err | None -> - (match - validate__tool_component_list_option - (`Field "translations" :: path) - x.translations - with - | Some _ as err -> err - | None -> - (match - validate__web_request_list_option - (`Field "web_requests" :: path) - x.web_requests + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + match + ( + validate__result_option + ) (`Field "results" :: path) x.results with - | Some _ as err -> err - | None -> - validate__web_response_list_option - (`Field "web_responses" - :: path) - x.web_responses)))))))))))))))))) -;; - -let validate_version_control_details : _ -> version_control_details -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__external_properties_run_guid_option + ) (`Field "run_guid" :: path) x.run_guid + with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "taxonomies" :: path) x.taxonomies + with + | Some _ as err -> err + | None -> + match + ( + validate__thread_flow_location_list_option + ) (`Field "thread_flow_locations" :: path) x.thread_flow_locations + with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "translations" :: path) x.translations + with + | Some _ as err -> err + | None -> + match + ( + validate__web_request_list_option + ) (`Field "web_requests" :: path) x.web_requests + with + | Some _ as err -> err + | None -> + ( + validate__web_response_list_option + ) (`Field "web_responses" :: path) x.web_responses +) +let validate_version_control_details : _ -> version_control_details -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_version_control_details" in - if Sarif_v_2_1_0_util.validate_version_control_details x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option (`Field "mapped_to" :: path) x.mapped_to - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties) -;; - -let validate_special_locations : _ -> special_locations -> _ = + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_version_control_details" in + if (Sarif_v_2_1_0_util.validate_version_control_details) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "mapped_to" :: path) x.mapped_to + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate_special_locations : _ -> special_locations -> _ = ( fun path x -> - match - validate__artifact_location_option (`Field "display_base" :: path) x.display_base - with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties -;; - -let validate_sarif_version _ _ = None - -let validate_run_language path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_language" in - if Sarif_v_2_1_0_util.validate_run_language x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate_run_column_kind _ _ = None - -let validate_run_baseline_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_baseline_guid" in - if Sarif_v_2_1_0_util.validate_run_baseline_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate_run_automation_details_guid path x = - let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details_guid" in - if Sarif_v_2_1_0_util.validate_run_automation_details_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate_run_automation_details_correlation_guid path x = - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details_correlation_guid" - in - if Sarif_v_2_1_0_util.validate_run_automation_details_correlation_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__run_automation_details_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_run_automation_details_guid -;; - -let validate__option_46715fb = - Atdgen_runtime.Ov_run.validate_option validate_run_automation_details_correlation_guid -;; - -let validate_run_automation_details : _ -> run_automation_details -> _ = + match + ( + validate__artifact_location_option + ) (`Field "display_base" :: path) x.display_base + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate_sarif_version = ( + fun _ _ -> None +) +let validate_run_language = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details" in - if Sarif_v_2_1_0_util.validate_run_automation_details x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__option_46715fb (`Field "correlation_guid" :: path) x.correlation_guid - with - | Some _ as err -> err - | None -> - (match validate__message_option (`Field "description" :: path) x.description with - | Some _ as err -> err - | None -> - (match - validate__run_automation_details_guid_option (`Field "guid" :: path) x.guid - with - | Some _ as err -> err - | None -> - validate__property_bag_option (`Field "properties" :: path) x.properties))) -;; - -let validate__x_9eb6bac = - Atdgen_runtime.Ov_run.validate_list (fun path x -> - let _, x = x in - validate_artifact_location (`Index 1 :: path) x) -;; - -let validate_hm_str_al = validate__x_9eb6bac - -let validate_external_property_file_reference_guid path x = - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_reference_guid" - in - if Sarif_v_2_1_0_util.validate_external_property_file_reference_guid x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path) -;; - -let validate__option_9c938c9 = - Atdgen_runtime.Ov_run.validate_option validate_external_property_file_reference_guid -;; - -let validate_external_property_file_reference : _ -> external_property_file_reference -> _ - = + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_language" in + if (Sarif_v_2_1_0_util.validate_run_language) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate_run_column_kind = ( + fun _ _ -> None +) +let validate_run_baseline_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_baseline_guid" in + if (Sarif_v_2_1_0_util.validate_run_baseline_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate_run_automation_details_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details_guid" in + if (Sarif_v_2_1_0_util.validate_run_automation_details_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate_run_automation_details_correlation_guid = ( fun path x -> - match - (fun path x -> - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_reference" - in - if Sarif_v_2_1_0_util.validate_external_property_file_reference x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__option_9c938c9 (`Field "guid" :: path) x.guid with - | Some _ as err -> err - | None -> - (match - validate__artifact_location_option (`Field "location" :: path) x.location + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details_correlation_guid" in + if (Sarif_v_2_1_0_util.validate_run_automation_details_correlation_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__run_automation_details_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_run_automation_details_guid + ) +) +let validate__option_46715fb = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_run_automation_details_correlation_guid + ) +) +let validate_run_automation_details : _ -> run_automation_details -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run_automation_details" in + if (Sarif_v_2_1_0_util.validate_run_automation_details) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__option_46715fb + ) (`Field "correlation_guid" :: path) x.correlation_guid with - | Some _ as err -> err - | None -> validate__property_bag_option (`Field "properties" :: path) x.properties)) -;; - -let validate__external_property_file_reference_list = - Atdgen_runtime.Ov_run.validate_list validate_external_property_file_reference -;; - -let validate__option_927609b = - Atdgen_runtime.Ov_run.validate_option validate__external_property_file_reference_list -;; - -let validate__external_property_file_reference_option = - Atdgen_runtime.Ov_run.validate_option validate_external_property_file_reference -;; - -let validate_external_property_file_references - : _ -> external_property_file_references -> _ - = + | Some _ as err -> err + | None -> + match + ( + validate__message_option + ) (`Field "description" :: path) x.description + with + | Some _ as err -> err + | None -> + match + ( + validate__run_automation_details_guid_option + ) (`Field "guid" :: path) x.guid + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__x_9eb6bac = ( + Atdgen_runtime.Ov_run.validate_list ( + fun path x -> + (let _, x = x in + ( + validate_artifact_location + ) (`Index 1 :: path) x + ) + ) +) +let validate_hm_str_al = ( + validate__x_9eb6bac +) +let validate_external_property_file_reference_guid = ( + fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_reference_guid" in + if (Sarif_v_2_1_0_util.validate_external_property_file_reference_guid) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) +) +let validate__option_9c938c9 = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_property_file_reference_guid + ) +) +let validate_external_property_file_reference : _ -> external_property_file_reference -> _ = ( + fun path x -> + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_reference" in + if (Sarif_v_2_1_0_util.validate_external_property_file_reference) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__option_9c938c9 + ) (`Field "guid" :: path) x.guid + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_location_option + ) (`Field "location" :: path) x.location + with + | Some _ as err -> err + | None -> + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties +) +let validate__external_property_file_reference_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_external_property_file_reference + ) +) +let validate__option_927609b = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__external_property_file_reference_list + ) +) +let validate__external_property_file_reference_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_property_file_reference + ) +) +let validate_external_property_file_references : _ -> external_property_file_references -> _ = ( fun path x -> - match - (fun path x -> - let msg = - "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_references" - in - if Sarif_v_2_1_0_util.validate_external_property_file_references x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__option_927609b (`Field "addresses" :: path) x.addresses with - | Some _ as err -> err - | None -> - (match validate__option_927609b (`Field "artifacts" :: path) x.artifacts with - | Some _ as err -> err - | None -> - (match - validate__external_property_file_reference_option - (`Field "conversion" :: path) - x.conversion - with - | Some _ as err -> err - | None -> - (match - validate__external_property_file_reference_option - (`Field "driver" :: path) - x.driver - with + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_external_property_file_references" in + if (Sarif_v_2_1_0_util.validate_external_property_file_references) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "addresses" :: path) x.addresses + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "artifacts" :: path) x.artifacts + with | Some _ as err -> err | None -> - (match - validate__option_927609b (`Field "extensions" :: path) x.extensions - with - | Some _ as err -> err - | None -> - (match - validate__external_property_file_reference_option - (`Field "externalized_properties" :: path) - x.externalized_properties + match + ( + validate__external_property_file_reference_option + ) (`Field "conversion" :: path) x.conversion + with + | Some _ as err -> err + | None -> + match + ( + validate__external_property_file_reference_option + ) (`Field "driver" :: path) x.driver with - | Some _ as err -> err - | None -> - (match - validate__option_927609b (`Field "graphs" :: path) x.graphs - with - | Some _ as err -> err - | None -> - (match + | Some _ as err -> err + | None -> + match + ( validate__option_927609b - (`Field "invocations" :: path) - x.invocations - with + ) (`Field "extensions" :: path) x.extensions + with | Some _ as err -> err | None -> - (match - validate__option_927609b - (`Field "logical_locations" :: path) - x.logical_locations - with - | Some _ as err -> err - | None -> - (match - validate__option_927609b - (`Field "policies" :: path) - x.policies + match + ( + validate__external_property_file_reference_option + ) (`Field "externalized_properties" :: path) x.externalized_properties + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "graphs" :: path) x.graphs with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - (match + | Some _ as err -> err + | None -> + match + ( validate__option_927609b - (`Field "results" :: path) - x.results - with + ) (`Field "invocations" :: path) x.invocations + with | Some _ as err -> err | None -> - (match - validate__option_927609b - (`Field "taxonomies" :: path) - x.taxonomies - with - | Some _ as err -> err - | None -> - (match - validate__option_927609b - (`Field "thread_flow_locations" :: path) - x.thread_flow_locations + match + ( + validate__option_927609b + ) (`Field "logical_locations" :: path) x.logical_locations + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "policies" :: path) x.policies with - | Some _ as err -> err - | None -> - (match - validate__option_927609b - (`Field "translations" :: path) - x.translations - with - | Some _ as err -> err - | None -> - (match - validate__option_927609b - (`Field "web_requests" :: path) - x.web_requests - with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with | Some _ as err -> err | None -> - validate__option_927609b - (`Field "web_responses" :: path) - x.web_responses)))))))))))))))) -;; - -let validate__version_control_details_list = - Atdgen_runtime.Ov_run.validate_list validate_version_control_details -;; - -let validate__version_control_details_list_option = - Atdgen_runtime.Ov_run.validate_option validate__version_control_details_list -;; - -let validate__special_locations_option = - Atdgen_runtime.Ov_run.validate_option validate_special_locations -;; - -let validate__run_language_option = - Atdgen_runtime.Ov_run.validate_option validate_run_language -;; - -let validate__run_column_kind_option _ _ = None - -let validate__run_baseline_guid_option = - Atdgen_runtime.Ov_run.validate_option validate_run_baseline_guid -;; - -let validate__run_automation_details_option = - Atdgen_runtime.Ov_run.validate_option validate_run_automation_details -;; - -let validate__run_automation_details_list = - Atdgen_runtime.Ov_run.validate_list validate_run_automation_details -;; - -let validate__run_automation_details_list_option = - Atdgen_runtime.Ov_run.validate_option validate__run_automation_details_list -;; - -let validate__result_list = Atdgen_runtime.Ov_run.validate_list validate_result - -let validate__result_list_option = - Atdgen_runtime.Ov_run.validate_option validate__result_list -;; - -let validate__invocation_list = Atdgen_runtime.Ov_run.validate_list validate_invocation - -let validate__invocation_list_option = - Atdgen_runtime.Ov_run.validate_option validate__invocation_list -;; - -let validate__hm_str_al_option = Atdgen_runtime.Ov_run.validate_option validate_hm_str_al - -let validate__external_property_file_references_option = - Atdgen_runtime.Ov_run.validate_option validate_external_property_file_references -;; - -let validate_run : _ -> run -> _ = + match + ( + validate__option_927609b + ) (`Field "results" :: path) x.results + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "taxonomies" :: path) x.taxonomies + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "thread_flow_locations" :: path) x.thread_flow_locations + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "translations" :: path) x.translations + with + | Some _ as err -> err + | None -> + match + ( + validate__option_927609b + ) (`Field "web_requests" :: path) x.web_requests + with + | Some _ as err -> err + | None -> + ( + validate__option_927609b + ) (`Field "web_responses" :: path) x.web_responses +) +let validate__version_control_details_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_version_control_details + ) +) +let validate__version_control_details_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__version_control_details_list + ) +) +let validate__special_locations_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_special_locations + ) +) +let validate__run_language_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_run_language + ) +) +let validate__run_column_kind_option = ( + fun _ _ -> None +) +let validate__run_baseline_guid_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_run_baseline_guid + ) +) +let validate__run_automation_details_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_run_automation_details + ) +) +let validate__run_automation_details_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_run_automation_details + ) +) +let validate__run_automation_details_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__run_automation_details_list + ) +) +let validate__result_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_result + ) +) +let validate__result_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__result_list + ) +) +let validate__invocation_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_invocation + ) +) +let validate__invocation_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__invocation_list + ) +) +let validate__hm_str_al_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_hm_str_al + ) +) +let validate__external_property_file_references_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate_external_property_file_references + ) +) +let validate_run : _ -> run -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_run" in - if Sarif_v_2_1_0_util.validate_run x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match validate__address_list_option (`Field "addresses" :: path) x.addresses with - | Some _ as err -> err - | None -> - (match validate__artifact_list_option (`Field "artifacts" :: path) x.artifacts with - | Some _ as err -> err - | None -> - (match - validate__run_automation_details_option - (`Field "automation_details" :: path) - x.automation_details - with - | Some _ as err -> err - | None -> - (match - validate__run_baseline_guid_option - (`Field "baseline_guid" :: path) - x.baseline_guid - with + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_run" in + if (Sarif_v_2_1_0_util.validate_run) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__address_list_option + ) (`Field "addresses" :: path) x.addresses + with + | Some _ as err -> err + | None -> + match + ( + validate__artifact_list_option + ) (`Field "artifacts" :: path) x.artifacts + with | Some _ as err -> err | None -> - (match - validate__conversion_option (`Field "conversion" :: path) x.conversion - with - | Some _ as err -> err - | None -> - (match - validate__external_property_file_references_option - (`Field "external_property_file_references" :: path) - x.external_property_file_references + match + ( + validate__run_automation_details_option + ) (`Field "automation_details" :: path) x.automation_details + with + | Some _ as err -> err + | None -> + match + ( + validate__run_baseline_guid_option + ) (`Field "baseline_guid" :: path) x.baseline_guid with - | Some _ as err -> err - | None -> - (match - validate__graph_list_option (`Field "graphs" :: path) x.graphs - with - | Some _ as err -> err - | None -> - (match - validate__invocation_list_option - (`Field "invocations" :: path) - x.invocations - with + | Some _ as err -> err + | None -> + match + ( + validate__conversion_option + ) (`Field "conversion" :: path) x.conversion + with | Some _ as err -> err | None -> - (match - validate__run_language_option - (`Field "language" :: path) - x.language - with - | Some _ as err -> err - | None -> - (match - validate__logical_location_list_option - (`Field "logical_locations" :: path) - x.logical_locations + match + ( + validate__external_property_file_references_option + ) (`Field "external_property_file_references" :: path) x.external_property_file_references + with + | Some _ as err -> err + | None -> + match + ( + validate__graph_list_option + ) (`Field "graphs" :: path) x.graphs with - | Some _ as err -> err - | None -> - (match - validate__hm_str_al_option - (`Field "original_uri_base_ids" :: path) - x.original_uri_base_ids - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_list_option - (`Field "policies" :: path) - x.policies - with + | Some _ as err -> err + | None -> + match + ( + validate__invocation_list_option + ) (`Field "invocations" :: path) x.invocations + with | Some _ as err -> err | None -> - (match - validate__property_bag_option - (`Field "properties" :: path) - x.properties - with - | Some _ as err -> err - | None -> - (match - validate__result_list_option - (`Field "results" :: path) - x.results + match + ( + validate__run_language_option + ) (`Field "language" :: path) x.language + with + | Some _ as err -> err + | None -> + match + ( + validate__logical_location_list_option + ) (`Field "logical_locations" :: path) x.logical_locations with - | Some _ as err -> err - | None -> - (match - validate__run_automation_details_list_option - (`Field "run_aggregates" :: path) - x.run_aggregates - with - | Some _ as err -> err - | None -> - (match - validate__special_locations_option - (`Field "special_locations" :: path) - x.special_locations - with + | Some _ as err -> err + | None -> + match + ( + validate__hm_str_al_option + ) (`Field "original_uri_base_ids" :: path) x.original_uri_base_ids + with | Some _ as err -> err | None -> - (match - validate__tool_component_list_option - (`Field "taxonomies" :: path) - x.taxonomies - with - | Some _ as err -> err - | None -> - (match - validate__thread_flow_location_list_option - (`Field - "thread_flow_locations" - :: path) - x.thread_flow_locations + match + ( + validate__tool_component_list_option + ) (`Field "policies" :: path) x.policies + with + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties with - | Some _ as err -> err - | None -> - (match - validate_tool - (`Field "tool" :: path) - x.tool - with - | Some _ as err -> err - | None -> - (match - validate__tool_component_list_option - (`Field "translations" - :: path) - x.translations - with + | Some _ as err -> err + | None -> + match + ( + validate__result_list_option + ) (`Field "results" :: path) x.results + with | Some _ as err -> err | None -> - (match - validate__version_control_details_list_option - (`Field - "version_control_provenance" - :: path) - x - .version_control_provenance - with - | Some _ as err -> err - | None -> - (match - validate__web_request_list_option - (`Field - "web_requests" - :: path) - x.web_requests + match + ( + validate__run_automation_details_list_option + ) (`Field "run_aggregates" :: path) x.run_aggregates + with + | Some _ as err -> err + | None -> + match + ( + validate__special_locations_option + ) (`Field "special_locations" :: path) x.special_locations with - | Some _ as err -> err - | None -> - validate__web_response_list_option - (`Field - "web_responses" - :: path) - x.web_responses)))))))))))))))))))))) -;; - -let validate__run_list = Atdgen_runtime.Ov_run.validate_list validate_run - -let validate__external_properties_list = - Atdgen_runtime.Ov_run.validate_list validate_external_properties -;; - -let validate__external_properties_list_option = - Atdgen_runtime.Ov_run.validate_option validate__external_properties_list -;; - -let validate_sarif_json_schema : _ -> sarif_json_schema -> _ = + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "taxonomies" :: path) x.taxonomies + with + | Some _ as err -> err + | None -> + match + ( + validate__thread_flow_location_list_option + ) (`Field "thread_flow_locations" :: path) x.thread_flow_locations + with + | Some _ as err -> err + | None -> + match + ( + validate_tool + ) (`Field "tool" :: path) x.tool + with + | Some _ as err -> err + | None -> + match + ( + validate__tool_component_list_option + ) (`Field "translations" :: path) x.translations + with + | Some _ as err -> err + | None -> + match + ( + validate__version_control_details_list_option + ) (`Field "version_control_provenance" :: path) x.version_control_provenance + with + | Some _ as err -> err + | None -> + match + ( + validate__web_request_list_option + ) (`Field "web_requests" :: path) x.web_requests + with + | Some _ as err -> err + | None -> + ( + validate__web_response_list_option + ) (`Field "web_responses" :: path) x.web_responses +) +let validate__run_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_run + ) +) +let validate__external_properties_list = ( + Atdgen_runtime.Ov_run.validate_list ( + validate_external_properties + ) +) +let validate__external_properties_list_option = ( + Atdgen_runtime.Ov_run.validate_option ( + validate__external_properties_list + ) +) +let validate_sarif_json_schema : _ -> sarif_json_schema -> _ = ( fun path x -> - match - (fun path x -> - let msg = "Failed check by Sarif_v_2_1_0_util.validate_sarif_json_schema" in - if Sarif_v_2_1_0_util.validate_sarif_json_schema x - then None - else Some (Atdgen_runtime.Util.Validation.error ~msg path)) - path - x - with - | Some _ as err -> err - | None -> - (match - validate__external_properties_list_option - (`Field "inline_external_properties" :: path) - x.inline_external_properties - with - | Some _ as err -> err - | None -> - (match - validate__property_bag_option (`Field "properties" :: path) x.properties + match ( fun path x -> + let msg = "Failed check by Sarif_v_2_1_0_util.validate_sarif_json_schema" in + if (Sarif_v_2_1_0_util.validate_sarif_json_schema) x then + None + else + Some (Atdgen_runtime.Util.Validation.error ~msg path) ) path x with + | Some _ as err -> err + | None -> + match + ( + validate__external_properties_list_option + ) (`Field "inline_external_properties" :: path) x.inline_external_properties with - | Some _ as err -> err - | None -> validate__run_list (`Field "runs" :: path) x.runs)) -;; - -let create_address + | Some _ as err -> err + | None -> + match + ( + validate__property_bag_option + ) (`Field "properties" :: path) x.properties + with + | Some _ as err -> err + | None -> + ( + validate__run_list + ) (`Field "runs" :: path) x.runs +) +let create_address ?(absolute_address = -1L) ?fully_qualified_name ?(index = -1L) @@ -3985,23 +5098,20 @@ let create_address ?(parent_index = -1L) ?properties ?relative_address - () - : address - = - { absolute_address - ; fully_qualified_name - ; index - ; kind - ; length - ; name - ; offset_from_parent - ; parent_index - ; properties - ; relative_address + () : address = + { + absolute_address = absolute_address; + fully_qualified_name = fully_qualified_name; + index = index; + kind = kind; + length = length; + name = name; + offset_from_parent = offset_from_parent; + parent_index = parent_index; + properties = properties; + relative_address = relative_address; } -;; - -let create_logical_location +let create_logical_location ?decorated_name ?fully_qualified_name ?(index = -1L) @@ -4009,55 +5119,107 @@ let create_logical_location ?name ?(parent_index = -1L) ?properties - () - : logical_location - = - { decorated_name; fully_qualified_name; index; kind; name; parent_index; properties } -;; - -let create_message ?arguments ?id ?markdown ?properties ?text () : message = - { arguments; id; markdown; properties; text } -;; - -let create_artifact_location ?description ?(index = -1L) ?properties ?uri ?uri_base_id () - : artifact_location - = - { description; index; properties; uri; uri_base_id } -;; - -let create_edge ~id ?label ?properties ~source_node_id ~target_node_id () : edge = - { id; label; properties; source_node_id; target_node_id } -;; - -let create_location_relationship ?description ?kinds ?properties ~target () - : location_relationship - = - { description; kinds; properties; target } -;; - -let create_multiformat_message_string ?markdown ?properties ~text () - : multiformat_message_string - = - { markdown; properties; text } -;; - -let create_artifact_content ?binary ?properties ?rendered ?text () : artifact_content = - { binary; properties; rendered; text } -;; - -let create_edge_traversal + () : logical_location = + { + decorated_name = decorated_name; + fully_qualified_name = fully_qualified_name; + index = index; + kind = kind; + name = name; + parent_index = parent_index; + properties = properties; + } +let create_message + ?arguments + ?id + ?markdown + ?properties + ?text + () : message = + { + arguments = arguments; + id = id; + markdown = markdown; + properties = properties; + text = text; + } +let create_artifact_location + ?description + ?(index = -1L) + ?properties + ?uri + ?uri_base_id + () : artifact_location = + { + description = description; + index = index; + properties = properties; + uri = uri; + uri_base_id = uri_base_id; + } +let create_edge + ~id + ?label + ?properties + ~source_node_id + ~target_node_id + () : edge = + { + id = id; + label = label; + properties = properties; + source_node_id = source_node_id; + target_node_id = target_node_id; + } +let create_location_relationship + ?description + ?kinds + ?properties + ~target + () : location_relationship = + { + description = description; + kinds = kinds; + properties = properties; + target = target; + } +let create_multiformat_message_string + ?markdown + ?properties + ~text + () : multiformat_message_string = + { + markdown = markdown; + properties = properties; + text = text; + } +let create_artifact_content + ?binary + ?properties + ?rendered + ?text + () : artifact_content = + { + binary = binary; + properties = properties; + rendered = rendered; + text = text; + } +let create_edge_traversal ~edge_id ?final_state ?message ?properties ?step_over_edge_count - () - : edge_traversal - = - { edge_id; final_state; message; properties; step_over_edge_count } -;; - -let create_graph_traversal_variant0 + () : edge_traversal = + { + edge_id = edge_id; + final_state = final_state; + message = message; + properties = properties; + step_over_edge_count = step_over_edge_count; + } +let create_graph_traversal_variant0 ?description ?edge_traversals ?immutable_state @@ -4065,20 +5227,17 @@ let create_graph_traversal_variant0 ?properties ?(result_graph_index = -1L) ?(run_graph_index = -1L) - () - : graph_traversal_variant0 - = - { description - ; edge_traversals - ; immutable_state - ; initial_state - ; properties - ; result_graph_index - ; run_graph_index + () : graph_traversal_variant0 = + { + description = description; + edge_traversals = edge_traversals; + immutable_state = immutable_state; + initial_state = initial_state; + properties = properties; + result_graph_index = result_graph_index; + run_graph_index = run_graph_index; } -;; - -let create_graph_traversal_variant1 +let create_graph_traversal_variant1 ?description ?edge_traversals ?immutable_state @@ -4086,24 +5245,33 @@ let create_graph_traversal_variant1 ?properties ?(result_graph_index = -1L) ?(run_graph_index = -1L) - () - : graph_traversal_variant1 - = - { description - ; edge_traversals - ; immutable_state - ; initial_state - ; properties - ; result_graph_index - ; run_graph_index + () : graph_traversal_variant1 = + { + description = description; + edge_traversals = edge_traversals; + immutable_state = immutable_state; + initial_state = initial_state; + properties = properties; + result_graph_index = result_graph_index; + run_graph_index = run_graph_index; } -;; - -let create_rectangle ?bottom ?left ?message ?properties ?right ?top () : rectangle = - { bottom; left; message; properties; right; top } -;; - -let create_region +let create_rectangle + ?bottom + ?left + ?message + ?properties + ?right + ?top + () : rectangle = + { + bottom = bottom; + left = left; + message = message; + properties = properties; + right = right; + top = top; + } +let create_region ?byte_length ?(byte_offset = -1L) ?char_length @@ -4116,43 +5284,50 @@ let create_region ?source_language ?start_column ?start_line - () - : region - = - { byte_length - ; byte_offset - ; char_length - ; char_offset - ; end_column - ; end_line - ; message - ; properties - ; snippet - ; source_language - ; start_column - ; start_line + () : region = + { + byte_length = byte_length; + byte_offset = byte_offset; + char_length = char_length; + char_offset = char_offset; + end_column = end_column; + end_line = end_line; + message = message; + properties = properties; + snippet = snippet; + source_language = source_language; + start_column = start_column; + start_line = start_line; } -;; - -let create_attachment ~artifact_location ?description ?properties ?rectangles ?regions () - : attachment - = - { artifact_location; description; properties; rectangles; regions } -;; - -let create_physical_location +let create_attachment + ~artifact_location + ?description + ?properties + ?rectangles + ?regions + () : attachment = + { + artifact_location = artifact_location; + description = description; + properties = properties; + rectangles = rectangles; + regions = regions; + } +let create_physical_location ?address ?artifact_location ?context_region ?properties ?region - () - : physical_location - = - { address; artifact_location; context_region; properties; region } -;; - -let create_location + () : physical_location = + { + address = address; + artifact_location = artifact_location; + context_region = context_region; + properties = properties; + region = region; + } +let create_location ?annotations ?(id = -1L) ?logical_locations @@ -4160,46 +5335,61 @@ let create_location ?physical_location ?properties ?relationships - () - : location - = - { annotations - ; id - ; logical_locations - ; message - ; physical_location - ; properties - ; relationships + () : location = + { + annotations = annotations; + id = id; + logical_locations = logical_locations; + message = message; + physical_location = physical_location; + properties = properties; + relationships = relationships; } -;; - -let create_replacement ~deleted_region ?inserted_content ?properties () : replacement = - { deleted_region; inserted_content; properties } -;; - -let create_artifact_change ~artifact_location ?properties ~replacements () - : artifact_change - = - { artifact_location; properties; replacements } -;; - -let create_fix ~artifact_changes ?description ?properties () : fix = - { artifact_changes; description; properties } -;; - -let create_reporting_configuration +let create_replacement + ~deleted_region + ?inserted_content + ?properties + () : replacement = + { + deleted_region = deleted_region; + inserted_content = inserted_content; + properties = properties; + } +let create_artifact_change + ~artifact_location + ?properties + ~replacements + () : artifact_change = + { + artifact_location = artifact_location; + properties = properties; + replacements = replacements; + } +let create_fix + ~artifact_changes + ?description + ?properties + () : fix = + { + artifact_changes = artifact_changes; + description = description; + properties = properties; + } +let create_reporting_configuration ?(enabled = true) ?level ?parameters ?properties ?(rank = -1L) - () - : reporting_configuration - = - { enabled; level; parameters; properties; rank } -;; - -let create_result_provenance + () : reporting_configuration = + { + enabled = enabled; + level = level; + parameters = parameters; + properties = properties; + rank = rank; + } +let create_result_provenance ?conversion_sources ?first_detection_run_guid ?first_detection_time_utc @@ -4207,64 +5397,105 @@ let create_result_provenance ?last_detection_run_guid ?last_detection_time_utc ?properties - () - : result_provenance - = - { conversion_sources - ; first_detection_run_guid - ; first_detection_time_utc - ; invocation_index - ; last_detection_run_guid - ; last_detection_time_utc - ; properties + () : result_provenance = + { + conversion_sources = conversion_sources; + first_detection_run_guid = first_detection_run_guid; + first_detection_time_utc = first_detection_time_utc; + invocation_index = invocation_index; + last_detection_run_guid = last_detection_run_guid; + last_detection_time_utc = last_detection_time_utc; + properties = properties; } -;; - -let create_stack_frame ?location ?module_ ?parameters ?properties ?thread_id () - : stack_frame - = - { location; module_; parameters; properties; thread_id } -;; - -let create_stack ~frames ?message ?properties () : stack = { frames; message; properties } - -let create_suppression ?guid ?justification ~kind ?location ?properties ?status () - : suppression - = - { guid; justification; kind; location; properties; status } -;; - -let create_tool_component_reference ?guid ?(index = -1L) ?name ?properties () - : tool_component_reference - = - { guid; index; name; properties } -;; - -let create_reporting_descriptor_reference +let create_stack_frame + ?location + ?module_ + ?parameters + ?properties + ?thread_id + () : stack_frame = + { + location = location; + module_ = module_; + parameters = parameters; + properties = properties; + thread_id = thread_id; + } +let create_stack + ~frames + ?message + ?properties + () : stack = + { + frames = frames; + message = message; + properties = properties; + } +let create_suppression + ?guid + ?justification + ~kind + ?location + ?properties + ?status + () : suppression = + { + guid = guid; + justification = justification; + kind = kind; + location = location; + properties = properties; + status = status; + } +let create_tool_component_reference + ?guid + ?(index = -1L) + ?name + ?properties + () : tool_component_reference = + { + guid = guid; + index = index; + name = name; + properties = properties; + } +let create_reporting_descriptor_reference ?guid ?id ?(index = -1L) ?properties ?tool_component - () - : reporting_descriptor_reference - = - { guid; id; index; properties; tool_component } -;; - -let create_configuration_override ~configuration ~descriptor ?properties () - : configuration_override - = - { configuration; descriptor; properties } -;; - -let create_reporting_descriptor_relationship ?description ?kinds ?properties ~target () - : reporting_descriptor_relationship - = - { description; kinds; properties; target } -;; - -let create_reporting_descriptor + () : reporting_descriptor_reference = + { + guid = guid; + id = id; + index = index; + properties = properties; + tool_component = tool_component; + } +let create_configuration_override + ~configuration + ~descriptor + ?properties + () : configuration_override = + { + configuration = configuration; + descriptor = descriptor; + properties = properties; + } +let create_reporting_descriptor_relationship + ?description + ?kinds + ?properties + ~target + () : reporting_descriptor_relationship = + { + description = description; + kinds = kinds; + properties = properties; + target = target; + } +let create_reporting_descriptor ?default_configuration ?deprecated_guids ?deprecated_ids @@ -4279,27 +5510,24 @@ let create_reporting_descriptor ?properties ?relationships ?short_description - () - : reporting_descriptor - = - { default_configuration - ; deprecated_guids - ; deprecated_ids - ; deprecated_names - ; full_description - ; guid - ; help - ; help_uri - ; id - ; message_strings - ; name - ; properties - ; relationships - ; short_description + () : reporting_descriptor = + { + default_configuration = default_configuration; + deprecated_guids = deprecated_guids; + deprecated_ids = deprecated_ids; + deprecated_names = deprecated_names; + full_description = full_description; + guid = guid; + help = help; + help_uri = help_uri; + id = id; + message_strings = message_strings; + name = name; + properties = properties; + relationships = relationships; + short_description = short_description; } -;; - -let create_translation_metadata +let create_translation_metadata ?download_uri ?full_description ?full_name @@ -4307,20 +5535,17 @@ let create_translation_metadata ~name ?properties ?short_description - () - : translation_metadata - = - { download_uri - ; full_description - ; full_name - ; information_uri - ; name - ; properties - ; short_description + () : translation_metadata = + { + download_uri = download_uri; + full_description = full_description; + full_name = full_name; + information_uri = information_uri; + name = name; + properties = properties; + short_description = short_description; } -;; - -let create_tool_component +let create_tool_component ?associated_component ?contents ?dotted_quad_file_version @@ -4349,45 +5574,48 @@ let create_tool_component ?taxa ?translation_metadata ?version - () - : tool_component - = - { associated_component - ; contents - ; dotted_quad_file_version - ; download_uri - ; full_description - ; full_name - ; global_message_strings - ; guid - ; information_uri - ; is_comprehensive - ; language - ; localized_data_semantic_version - ; locations - ; minimum_required_localized_data_semantic_version - ; name - ; notifications - ; organization - ; product - ; product_suite - ; properties - ; release_date_utc - ; rules - ; semantic_version - ; short_description - ; supported_taxonomies - ; taxa - ; translation_metadata - ; version + () : tool_component = + { + associated_component = associated_component; + contents = contents; + dotted_quad_file_version = dotted_quad_file_version; + download_uri = download_uri; + full_description = full_description; + full_name = full_name; + global_message_strings = global_message_strings; + guid = guid; + information_uri = information_uri; + is_comprehensive = is_comprehensive; + language = language; + localized_data_semantic_version = localized_data_semantic_version; + locations = locations; + minimum_required_localized_data_semantic_version = minimum_required_localized_data_semantic_version; + name = name; + notifications = notifications; + organization = organization; + product = product; + product_suite = product_suite; + properties = properties; + release_date_utc = release_date_utc; + rules = rules; + semantic_version = semantic_version; + short_description = short_description; + supported_taxonomies = supported_taxonomies; + taxa = taxa; + translation_metadata = translation_metadata; + version = version; } -;; - -let create_tool ~driver ?extensions ?properties () : tool = - { driver; extensions; properties } -;; - -let create_web_request +let create_tool + ~driver + ?extensions + ?properties + () : tool = + { + driver = driver; + extensions = extensions; + properties = properties; + } +let create_web_request ?body ?headers ?(index = -1L) @@ -4397,13 +5625,19 @@ let create_web_request ?protocol ?target ?version - () - : web_request - = - { body; headers; index; method_; parameters; properties; protocol; target; version } -;; - -let create_web_response + () : web_request = + { + body = body; + headers = headers; + index = index; + method_ = method_; + parameters = parameters; + properties = properties; + protocol = protocol; + target = target; + version = version; + } +let create_web_response ?body ?headers ?(index = -1L) @@ -4413,22 +5647,19 @@ let create_web_response ?reason_phrase ?status_code ?version - () - : web_response - = - { body - ; headers - ; index - ; no_response_received - ; properties - ; protocol - ; reason_phrase - ; status_code - ; version + () : web_response = + { + body = body; + headers = headers; + index = index; + no_response_received = no_response_received; + properties = properties; + protocol = protocol; + reason_phrase = reason_phrase; + status_code = status_code; + version = version; } -;; - -let create_thread_flow_location +let create_thread_flow_location ?(execution_order = -1L) ?execution_time_utc ?importance @@ -4443,56 +5674,90 @@ let create_thread_flow_location ?taxa ?web_request ?web_response - () - : thread_flow_location - = - { execution_order - ; execution_time_utc - ; importance - ; index - ; kinds - ; location - ; module_ - ; nesting_level - ; properties - ; stack - ; state - ; taxa - ; web_request - ; web_response + () : thread_flow_location = + { + execution_order = execution_order; + execution_time_utc = execution_time_utc; + importance = importance; + index = index; + kinds = kinds; + location = location; + module_ = module_; + nesting_level = nesting_level; + properties = properties; + stack = stack; + state = state; + taxa = taxa; + web_request = web_request; + web_response = web_response; } -;; - -let create_thread_flow +let create_thread_flow ?id ?immutable_state ?initial_state ~locations ?message ?properties - () - : thread_flow - = - { id; immutable_state; initial_state; locations; message; properties } -;; - -let create_code_flow ?message ?properties ~thread_flows () : code_flow = - { message; properties; thread_flows } -;; - -let create_node ?children ~id ?label ?location ?properties () : node = - { children; id; label; location; properties } -;; - -let create_exception_ ?inner_exceptions ?kind ?message ?properties ?stack () : exception_ = - { inner_exceptions; kind; message; properties; stack } -;; - -let create_graph ?description ?edges ?nodes ?properties () : graph = - { description; edges; nodes; properties } -;; - -let create_result + () : thread_flow = + { + id = id; + immutable_state = immutable_state; + initial_state = initial_state; + locations = locations; + message = message; + properties = properties; + } +let create_code_flow + ?message + ?properties + ~thread_flows + () : code_flow = + { + message = message; + properties = properties; + thread_flows = thread_flows; + } +let create_node + ?children + ~id + ?label + ?location + ?properties + () : node = + { + children = children; + id = id; + label = label; + location = location; + properties = properties; + } +let create_exception_ + ?inner_exceptions + ?kind + ?message + ?properties + ?stack + () : exception_ = + { + inner_exceptions = inner_exceptions; + kind = kind; + message = message; + properties = properties; + stack = stack; + } +let create_graph + ?description + ?edges + ?nodes + ?properties + () : graph = + { + description = description; + edges = edges; + nodes = nodes; + properties = properties; + } +let create_result ?analysis_target ?attachments ?baseline_state @@ -4523,43 +5788,40 @@ let create_result ?web_request ?web_response ?work_item_uris - () - : result - = - { analysis_target - ; attachments - ; baseline_state - ; code_flows - ; correlation_guid - ; fingerprints - ; fixes - ; graph_traversals - ; graphs - ; guid - ; hosted_viewer_uri - ; kind - ; level - ; locations - ; message - ; occurrence_count - ; partial_fingerprints - ; properties - ; provenance - ; rank - ; related_locations - ; rule - ; rule_id - ; rule_index - ; stacks - ; suppressions - ; taxa - ; web_request - ; web_response - ; work_item_uris + () : result = + { + analysis_target = analysis_target; + attachments = attachments; + baseline_state = baseline_state; + code_flows = code_flows; + correlation_guid = correlation_guid; + fingerprints = fingerprints; + fixes = fixes; + graph_traversals = graph_traversals; + graphs = graphs; + guid = guid; + hosted_viewer_uri = hosted_viewer_uri; + kind = kind; + level = level; + locations = locations; + message = message; + occurrence_count = occurrence_count; + partial_fingerprints = partial_fingerprints; + properties = properties; + provenance = provenance; + rank = rank; + related_locations = related_locations; + rule = rule; + rule_id = rule_id; + rule_index = rule_index; + stacks = stacks; + suppressions = suppressions; + taxa = taxa; + web_request = web_request; + web_response = web_response; + work_item_uris = work_item_uris; } -;; - -let create_notification +let create_notification ?associated_rule ?descriptor ?exception_ @@ -4569,22 +5831,19 @@ let create_notification ?properties ?thread_id ?time_utc - () - : notification - = - { associated_rule - ; descriptor - ; exception_ - ; level - ; locations - ; message - ; properties - ; thread_id - ; time_utc + () : notification = + { + associated_rule = associated_rule; + descriptor = descriptor; + exception_ = exception_; + level = level; + locations = locations; + message = message; + properties = properties; + thread_id = thread_id; + time_utc = time_utc; } -;; - -let create_invocation +let create_invocation ?account ?arguments ?command_line @@ -4610,44 +5869,47 @@ let create_invocation ?tool_configuration_notifications ?tool_execution_notifications ?working_directory - () - : invocation - = - { account - ; arguments - ; command_line - ; end_time_utc - ; environment_variables - ; executable_location - ; execution_successful - ; exit_code - ; exit_code_description - ; exit_signal_name - ; exit_signal_number - ; notification_configuration_overrides - ; process_id - ; process_start_failure_message - ; properties - ; response_files - ; rule_configuration_overrides - ; start_time_utc - ; stderr - ; stdin - ; stdout - ; stdout_stderr - ; tool_configuration_notifications - ; tool_execution_notifications - ; working_directory + () : invocation = + { + account = account; + arguments = arguments; + command_line = command_line; + end_time_utc = end_time_utc; + environment_variables = environment_variables; + executable_location = executable_location; + execution_successful = execution_successful; + exit_code = exit_code; + exit_code_description = exit_code_description; + exit_signal_name = exit_signal_name; + exit_signal_number = exit_signal_number; + notification_configuration_overrides = notification_configuration_overrides; + process_id = process_id; + process_start_failure_message = process_start_failure_message; + properties = properties; + response_files = response_files; + rule_configuration_overrides = rule_configuration_overrides; + start_time_utc = start_time_utc; + stderr = stderr; + stdin = stdin; + stdout = stdout; + stdout_stderr = stdout_stderr; + tool_configuration_notifications = tool_configuration_notifications; + tool_execution_notifications = tool_execution_notifications; + working_directory = working_directory; } -;; - -let create_conversion ?analysis_tool_log_files ?invocation ?properties ~tool () - : conversion - = - { analysis_tool_log_files; invocation; properties; tool } -;; - -let create_artifact +let create_conversion + ?analysis_tool_log_files + ?invocation + ?properties + ~tool + () : conversion = + { + analysis_tool_log_files = analysis_tool_log_files; + invocation = invocation; + properties = properties; + tool = tool; + } +let create_artifact ?contents ?description ?encoding @@ -4661,26 +5923,23 @@ let create_artifact ?properties ?roles ?source_language - () - : artifact - = - { contents - ; description - ; encoding - ; hashes - ; last_modified_time_utc - ; length - ; location - ; mime_type - ; offset - ; parent_index - ; properties - ; roles - ; source_language + () : artifact = + { + contents = contents; + description = description; + encoding = encoding; + hashes = hashes; + last_modified_time_utc = last_modified_time_utc; + length = length; + location = location; + mime_type = mime_type; + offset = offset; + parent_index = parent_index; + properties = properties; + roles = roles; + source_language = source_language; } -;; - -let create_external_properties +let create_external_properties ?addresses ?artifacts ?conversion @@ -4702,34 +5961,31 @@ let create_external_properties ?version ?web_requests ?web_responses - () - : external_properties - = - { addresses - ; artifacts - ; conversion - ; driver - ; extensions - ; externalized_properties - ; graph - ; guid - ; invocations - ; logical_locations - ; policies - ; properties - ; results - ; run_guid - ; schema - ; taxonomies - ; thread_flow_locations - ; translations - ; version - ; web_requests - ; web_responses + () : external_properties = + { + addresses = addresses; + artifacts = artifacts; + conversion = conversion; + driver = driver; + extensions = extensions; + externalized_properties = externalized_properties; + graph = graph; + guid = guid; + invocations = invocations; + logical_locations = logical_locations; + policies = policies; + properties = properties; + results = results; + run_guid = run_guid; + schema = schema; + taxonomies = taxonomies; + thread_flow_locations = thread_flow_locations; + translations = translations; + version = version; + web_requests = web_requests; + web_responses = web_responses; } -;; - -let create_version_control_details +let create_version_control_details ?as_of_time_utc ?branch ?mapped_to @@ -4737,41 +5993,51 @@ let create_version_control_details ~repository_uri ?revision_id ?revision_tag - () - : version_control_details - = - { as_of_time_utc - ; branch - ; mapped_to - ; properties - ; repository_uri - ; revision_id - ; revision_tag + () : version_control_details = + { + as_of_time_utc = as_of_time_utc; + branch = branch; + mapped_to = mapped_to; + properties = properties; + repository_uri = repository_uri; + revision_id = revision_id; + revision_tag = revision_tag; } -;; - -let create_special_locations ?display_base ?properties () : special_locations = - { display_base; properties } -;; - -let create_run_automation_details ?correlation_guid ?description ?guid ?id ?properties () - : run_automation_details - = - { correlation_guid; description; guid; id; properties } -;; - -let create_external_property_file_reference +let create_special_locations + ?display_base + ?properties + () : special_locations = + { + display_base = display_base; + properties = properties; + } +let create_run_automation_details + ?correlation_guid + ?description + ?guid + ?id + ?properties + () : run_automation_details = + { + correlation_guid = correlation_guid; + description = description; + guid = guid; + id = id; + properties = properties; + } +let create_external_property_file_reference ?guid ?(item_count = -1L) ?location ?properties - () - : external_property_file_reference - = - { guid; item_count; location; properties } -;; - -let create_external_property_file_references + () : external_property_file_reference = + { + guid = guid; + item_count = item_count; + location = location; + properties = properties; + } +let create_external_property_file_references ?addresses ?artifacts ?conversion @@ -4789,30 +6055,27 @@ let create_external_property_file_references ?translations ?web_requests ?web_responses - () - : external_property_file_references - = - { addresses - ; artifacts - ; conversion - ; driver - ; extensions - ; externalized_properties - ; graphs - ; invocations - ; logical_locations - ; policies - ; properties - ; results - ; taxonomies - ; thread_flow_locations - ; translations - ; web_requests - ; web_responses + () : external_property_file_references = + { + addresses = addresses; + artifacts = artifacts; + conversion = conversion; + driver = driver; + extensions = extensions; + externalized_properties = externalized_properties; + graphs = graphs; + invocations = invocations; + logical_locations = logical_locations; + policies = policies; + properties = properties; + results = results; + taxonomies = taxonomies; + thread_flow_locations = thread_flow_locations; + translations = translations; + web_requests = web_requests; + web_responses = web_responses; } -;; - -let create_run +let create_run ?addresses ?artifacts ?automation_details @@ -4826,7 +6089,7 @@ let create_run ?invocations ?language ?logical_locations - ?(newline_sequences = [ "\r\n"; "\n" ]) + ?(newline_sequences = ["\r\n"; "\n"]) ?original_uri_base_ids ?policies ?properties @@ -4841,48 +6104,48 @@ let create_run ?version_control_provenance ?web_requests ?web_responses - () - : run - = - { addresses - ; artifacts - ; automation_details - ; baseline_guid - ; column_kind - ; conversion - ; default_encoding - ; default_source_language - ; external_property_file_references - ; graphs - ; invocations - ; language - ; logical_locations - ; newline_sequences - ; original_uri_base_ids - ; policies - ; properties - ; redaction_tokens - ; results - ; run_aggregates - ; special_locations - ; taxonomies - ; thread_flow_locations - ; tool - ; translations - ; version_control_provenance - ; web_requests - ; web_responses + () : run = + { + addresses = addresses; + artifacts = artifacts; + automation_details = automation_details; + baseline_guid = baseline_guid; + column_kind = column_kind; + conversion = conversion; + default_encoding = default_encoding; + default_source_language = default_source_language; + external_property_file_references = external_property_file_references; + graphs = graphs; + invocations = invocations; + language = language; + logical_locations = logical_locations; + newline_sequences = newline_sequences; + original_uri_base_ids = original_uri_base_ids; + policies = policies; + properties = properties; + redaction_tokens = redaction_tokens; + results = results; + run_aggregates = run_aggregates; + special_locations = special_locations; + taxonomies = taxonomies; + thread_flow_locations = thread_flow_locations; + tool = tool; + translations = translations; + version_control_provenance = version_control_provenance; + web_requests = web_requests; + web_responses = web_responses; } -;; - -let create_sarif_json_schema +let create_sarif_json_schema ~version ?inline_external_properties ?properties ~runs ?schema - () - : sarif_json_schema - = - { version; inline_external_properties; properties; runs; schema } -;; + () : sarif_json_schema = + { + version = version; + inline_external_properties = inline_external_properties; + properties = properties; + runs = runs; + schema = schema; + } diff --git a/lib/sarif_v_2_1_0_v.mli b/lib/sarif_v_2_1_0_v.mli index a4e1c15..fe8c044 100644 --- a/lib/sarif_v_2_1_0_v.mli +++ b/lib/sarif_v_2_1_0_v.mli @@ -2,2695 +2,3073 @@ [@@@ocaml.warning "-27-32-33-35-39"] (** The MIME type (RFC 2045) of the artifact. *) -type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype [@@deriving show, eq] +type artifact_mimetype = Sarif_v_2_1_0_t.artifact_mimetype + [@@deriving show,eq] (** ArtifactRolesItem *) -type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item [@@deriving show, eq] +type artifact_roles_item = Sarif_v_2_1_0_t.artifact_roles_item + [@@deriving show,eq] -(** A stable, unique identifier for this external properties object, in the - form of a GUID. *) +(** + A stable, unique identifier for this external properties object, in the + form of a GUID. +*) type external_properties_guid = Sarif_v_2_1_0_t.external_properties_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) -type external_properties_run_guid = Sarif_v_2_1_0_t.external_properties_run_guid -[@@deriving show, eq] +(** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. +*) +type external_properties_run_guid = + Sarif_v_2_1_0_t.external_properties_run_guid + [@@deriving show,eq] -type external_properties_version = Sarif_v_2_1_0_t.external_properties_version -[@@deriving show, eq] +type external_properties_version = + Sarif_v_2_1_0_t.external_properties_version + [@@deriving show,eq] -type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show, eq] -type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show, eq] +type hm_str_str = Sarif_v_2_1_0_t.hm_str_str [@@deriving show,eq] + +type int64 = Sarif_v_2_1_0_t.int64 [@@deriving show,eq] (** A value specifying the severity level of the notification. *) -type notification_level = Sarif_v_2_1_0_t.notification_level [@@deriving show, eq] +type notification_level = Sarif_v_2_1_0_t.notification_level + [@@deriving show,eq] (** Key/value pairs that provide additional information about the object. *) -type property_bag = Sarif_v_2_1_0_t.property_bag [@@deriving show, eq] - -(** A physical or virtual address, or a range of addresses, in an 'addressable - region' (memory or a binary file). *) -type address = Sarif_v_2_1_0_t.address = - { absolute_address : int64 - (** The address expressed as a byte offset from the start of the - addressable region. *) - ; fully_qualified_name : string option - (** A human-readable fully qualified name that is associated with the - address. *) - ; index : int64 - (** The index within run.addresses of the cached object for this address. *) - ; kind : string option - (** An open-ended string that identifies the address kind. 'data', +type property_bag = Sarif_v_2_1_0_t.property_bag + [@@deriving show,eq] + +(** + A physical or virtual address, or a range of addresses, in an 'addressable + region' (memory or a binary file). +*) +type address = Sarif_v_2_1_0_t.address = { + absolute_address: int64 + (** + The address expressed as a byte offset from the start of the + addressable region. + *); + fully_qualified_name: string option + (** + A human-readable fully qualified name that is associated with the + address. + *); + index: int64 + (** + The index within run.addresses of the cached object for this address. + *); + kind: string option + (** + An open-ended string that identifies the address kind. 'data', 'function', 'header','instruction', 'module', 'page', 'section', - 'segment', 'stack', 'stackFrame', 'table' are well-known values. *) - ; length : int64 option (** The number of bytes in this range of addresses. *) - ; name : string option (** A name that is associated with the address, e.g., '.text'. *) - ; offset_from_parent : int64 option - (** The byte offset of this address from the absolute or relative address - of the parent object. *) - ; parent_index : int64 (** The index within run.addresses of the parent object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the address. *) - ; relative_address : int64 option - (** The address expressed as a byte offset from the absolute address of the - top-most parent object. *) - } -[@@deriving show, eq] + 'segment', 'stack', 'stackFrame', 'table' are well-known values. + *); + length: int64 option (** The number of bytes in this range of addresses. *); + name: string option + (** A name that is associated with the address, e.g., '.text'. *); + offset_from_parent: int64 option + (** + The byte offset of this address from the absolute or relative address + of the parent object. + *); + parent_index: int64 + (** The index within run.addresses of the parent object. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the address. + *); + relative_address: int64 option + (** + The address expressed as a byte offset from the absolute address of the + top-most parent object. + *) +} + [@@deriving show,eq] (** A logical location of a construct that produced a result. *) -type logical_location = Sarif_v_2_1_0_t.logical_location = - { decorated_name : string option - (** The machine-readable name for the logical location, such as a mangled +type logical_location = Sarif_v_2_1_0_t.logical_location = { + decorated_name: string option + (** + The machine-readable name for the logical location, such as a mangled function name provided by a C++ compiler that encodes calling - convention, return type and other details along with the function name. *) - ; fully_qualified_name : string option - (** The human-readable fully qualified name of the logical location. *) - ; index : int64 (** The index within the logical locations array. *) - ; kind : string option - (** The type of construct this logical location component refers to. Should + convention, return type and other details along with the function name. + *); + fully_qualified_name: string option + (** The human-readable fully qualified name of the logical location. *); + index: int64 (** The index within the logical locations array. *); + kind: string option + (** + The type of construct this logical location component refers to. Should be one of 'function', 'member', 'module', 'namespace', 'parameter', 'resource', 'returnType', 'type', 'variable', 'object', 'array', 'property', 'value', 'element', 'text', 'attribute', 'comment', 'declaration', 'dtd' or 'processingInstruction', if any of those - accurately describe the construct. *) - ; name : string option - (** Identifies the construct in which the result occurred. For example, - this property might contain the name of a class or a method. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the construct in which + accurately describe the construct. + *); + name: string option + (** + Identifies the construct in which the result occurred. For example, + this property might contain the name of a class or a method. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the construct in which the result was detected. For example, this property might point to a - logical location that represents the namespace that holds a type. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the logical - location. *) - } -[@@deriving show, eq] + logical location that represents the namespace that holds a type. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the logical + location. + *) +} + [@@deriving show,eq] (** Encapsulates a message intended to be read by the end user. *) -type message = Sarif_v_2_1_0_t.message = - { arguments : string list option - (** An array of strings to substitute into the message string. *) - ; id : string option (** The identifier for this message. *) - ; markdown : string option (** A Markdown message string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string option (** A plain text message string. *) - } -[@@deriving show, eq] +type message = Sarif_v_2_1_0_t.message = { + arguments: string list option + (** An array of strings to substitute into the message string. *); + id: string option (** The identifier for this message. *); + markdown: string option (** A Markdown message string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string option (** A plain text message string. *) +} + [@@deriving show,eq] (** Specifies the location of an artifact. *) -type artifact_location = Sarif_v_2_1_0_t.artifact_location = - { description : message option (** A short description of the artifact location. *) - ; index : int64 - (** The index within the run artifacts array of the artifact object - associated with the artifact location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - location. *) - ; uri : string option (** A string containing a valid relative or absolute URI. *) - ; uri_base_id : string option - (** A string which indirectly specifies the absolute URI with respect to - which a relative URI in the "uri" property is interpreted. *) - } -[@@deriving show, eq] +type artifact_location = Sarif_v_2_1_0_t.artifact_location = { + description: message option + (** A short description of the artifact location. *); + index: int64 + (** + The index within the run artifacts array of the artifact object + associated with the artifact location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + location. + *); + uri: string option + (** A string containing a valid relative or absolute URI. *); + uri_base_id: string option + (** + A string which indirectly specifies the absolute URI with respect to + which a relative URI in the "uri" property is interpreted. + *) +} + [@@deriving show,eq] (** Represents a directed edge in a graph. *) -type edge = Sarif_v_2_1_0_t.edge = - { id : string (** A string that uniquely identifies the edge within its graph. *) - ; label : message option (** A short description of the edge. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge. *) - ; source_node_id : string - (** Identifies the source node (the node at which the edge starts). *) - ; target_node_id : string - (** Identifies the target node (the node at which the edge ends). *) - } -[@@deriving show, eq] +type edge = Sarif_v_2_1_0_t.edge = { + id: string + (** A string that uniquely identifies the edge within its graph. *); + label: message option (** A short description of the edge. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge. + *); + source_node_id: string + (** Identifies the source node (the node at which the edge starts). *); + target_node_id: string + (** Identifies the target node (the node at which the edge ends). *) +} + [@@deriving show,eq] (** Information about the relation of one location to another. *) -type location_relationship = Sarif_v_2_1_0_t.location_relationship = - { description : message option (** A description of the location relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known - kinds include 'includes', 'isIncludedBy' and 'relevant'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location - relationship. *) - ; target : int64 (** A reference to the related location. *) - } -[@@deriving show, eq] - -(** A message string or message format string rendered in multiple formats. *) -type multiformat_message_string = Sarif_v_2_1_0_t.multiformat_message_string = - { markdown : string option (** A Markdown message string or format string. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the message. *) - ; text : string (** A plain text message string or format string. *) - } -[@@deriving show, eq] +type location_relationship = Sarif_v_2_1_0_t.location_relationship = { + description: message option + (** A description of the location relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known + kinds include 'includes', 'isIncludedBy' and 'relevant'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location + relationship. + *); + target: int64 (** A reference to the related location. *) +} + [@@deriving show,eq] + +(** + A message string or message format string rendered in multiple formats. +*) +type multiformat_message_string = + Sarif_v_2_1_0_t.multiformat_message_string = { + markdown: string option (** A Markdown message string or format string. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the message. + *); + text: string (** A plain text message string or format string. *) +} + [@@deriving show,eq] (** Represents the contents of an artifact. *) -type artifact_content = Sarif_v_2_1_0_t.artifact_content = - { binary : string option - (** MIME Base64-encoded content from a binary artifact, or from a text - artifact in its original encoding. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the artifact - content. *) - ; rendered : multiformat_message_string option - (** An alternate rendered representation of the artifact (e.g., a - decompiled representation of a binary region). *) - ; text : string option (** UTF-8-encoded content from a text artifact. *) - } -[@@deriving show, eq] - -type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show, eq] +type artifact_content = Sarif_v_2_1_0_t.artifact_content = { + binary: string option + (** + MIME Base64-encoded content from a binary artifact, or from a text + artifact in its original encoding. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the artifact + content. + *); + rendered: multiformat_message_string option + (** + An alternate rendered representation of the artifact (e.g., a + decompiled representation of a binary region). + *); + text: string option (** UTF-8-encoded content from a text artifact. *) +} + [@@deriving show,eq] + +type hm_str_mms = Sarif_v_2_1_0_t.hm_str_mms [@@deriving show,eq] (** Represents the traversal of a single edge during a graph traversal. *) -type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = - { edge_id : string (** Identifies the edge being traversed. *) - ; final_state : hm_str_mms option - (** The values of relevant expressions after the edge has been traversed. *) - ; message : message option - (** A message to display to the user as the edge is traversed. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the edge - traversal. *) - ; step_over_edge_count : int64 option - (** The number of edge traversals necessary to return from a nested graph. *) - } -[@@deriving show, eq] - -type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] - -type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = - { description : message option (** A description of this graph traversal. *) - ; edge_traversals : edge_traversal list option - (** The sequences of edges traversed by this graph traversal. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - remain constant for the graph traversal. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the graph traversal that - may change during graph traversal. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph - traversal. *) - ; result_graph_index : int64 - (** The index within the result.graphs to be associated with the result. *) - ; run_graph_index : int64 - (** The index within the run.graphs to be associated with the result. *) - } -[@@deriving show, eq] +type edge_traversal = Sarif_v_2_1_0_t.edge_traversal = { + edge_id: string (** Identifies the edge being traversed. *); + final_state: hm_str_mms option + (** + The values of relevant expressions after the edge has been traversed. + *); + message: message option + (** A message to display to the user as the edge is traversed. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the edge + traversal. + *); + step_over_edge_count: int64 option + (** + The number of edge traversals necessary to return from a nested graph. + *) +} + [@@deriving show,eq] + +type graph_traversal_variant0 = Sarif_v_2_1_0_t.graph_traversal_variant0 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] + +type graph_traversal_variant1 = Sarif_v_2_1_0_t.graph_traversal_variant1 = { + description: message option (** A description of this graph traversal. *); + edge_traversals: edge_traversal list option + (** The sequences of edges traversed by this graph traversal. *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + remain constant for the graph traversal. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the graph traversal that + may change during graph traversal. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph + traversal. + *); + result_graph_index: int64 + (** + The index within the result.graphs to be associated with the result. + *); + run_graph_index: int64 + (** The index within the run.graphs to be associated with the result. *) +} + [@@deriving show,eq] (** Represents a path through a graph. *) -type graph_traversal = Sarif_v_2_1_0_t.graph_traversal [@@deriving show, eq] +type graph_traversal = Sarif_v_2_1_0_t.graph_traversal + [@@deriving show,eq] (** An area within an image. *) -type rectangle = Sarif_v_2_1_0_t.rectangle = - { bottom : float option - ; left : float option - ; message : message option (** A message relevant to the rectangle. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - rectangle. *) - ; right : float option - ; top : float option - } -[@@deriving show, eq] +type rectangle = Sarif_v_2_1_0_t.rectangle = { + bottom: float option; + left: float option; + message: message option (** A message relevant to the rectangle. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + rectangle. + *); + right: float option; + top: float option +} + [@@deriving show,eq] (** A region within an artifact where a result was detected. *) -type region = Sarif_v_2_1_0_t.region = - { byte_length : int64 option (** The length of the region in bytes. *) - ; byte_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - byte in the region. *) - ; char_length : int64 option (** The length of the region in characters. *) - ; char_offset : int64 - (** The zero-based offset from the beginning of the artifact of the first - character in the region. *) - ; end_column : int64 option - (** The column number of the character following the end of the region. *) - ; end_line : int64 option (** The line number of the last character in the region. *) - ; message : message option (** A message relevant to the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the region. *) - ; snippet : artifact_content option - (** The portion of the artifact contents within the specified region. *) - ; source_language : string option - (** Specifies the source language, if any, of the portion of the artifact - specified by the region object. *) - ; start_column : int64 option - (** The column number of the first character in the region. *) - ; start_line : int64 option (** The line number of the first character in the region. *) - } -[@@deriving show, eq] +type region = Sarif_v_2_1_0_t.region = { + byte_length: int64 option (** The length of the region in bytes. *); + byte_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + byte in the region. + *); + char_length: int64 option (** The length of the region in characters. *); + char_offset: int64 + (** + The zero-based offset from the beginning of the artifact of the first + character in the region. + *); + end_column: int64 option + (** + The column number of the character following the end of the region. + *); + end_line: int64 option + (** The line number of the last character in the region. *); + message: message option (** A message relevant to the region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the region. + *); + snippet: artifact_content option + (** The portion of the artifact contents within the specified region. *); + source_language: string option + (** + Specifies the source language, if any, of the portion of the artifact + specified by the region object. + *); + start_column: int64 option + (** The column number of the first character in the region. *); + start_line: int64 option + (** The line number of the first character in the region. *) +} + [@@deriving show,eq] (** An artifact relevant to a result. *) -type attachment = Sarif_v_2_1_0_t.attachment = - { artifact_location : artifact_location (** The location of the attachment. *) - ; description : message option - (** A message describing the role played by the attachment. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - attachment. *) - ; rectangles : rectangle list option - (** An array of rectangles specifying areas of interest within the image. *) - ; regions : region list option - (** An array of regions of interest within the attachment. *) - } -[@@deriving show, eq] - -(** A physical location relevant to a result. Specifies a reference to a - programming artifact together with a range of bytes or characters within - that artifact. *) -type physical_location = Sarif_v_2_1_0_t.physical_location = - { address : address option (** The address of the location. *) - ; artifact_location : artifact_location option (** The location of the artifact. *) - ; context_region : region option - (** Specifies a portion of the artifact that encloses the region. Allows a - viewer to display additional context around the region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the physical - location. *) - ; region : region option (** Specifies a portion of the artifact. *) - } -[@@deriving show, eq] +type attachment = Sarif_v_2_1_0_t.attachment = { + artifact_location: artifact_location (** The location of the attachment. *); + description: message option + (** A message describing the role played by the attachment. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + attachment. + *); + rectangles: rectangle list option + (** + An array of rectangles specifying areas of interest within the image. + *); + regions: region list option + (** An array of regions of interest within the attachment. *) +} + [@@deriving show,eq] + +(** + A physical location relevant to a result. Specifies a reference to a + programming artifact together with a range of bytes or characters within + that artifact. +*) +type physical_location = Sarif_v_2_1_0_t.physical_location = { + address: address option (** The address of the location. *); + artifact_location: artifact_location option + (** The location of the artifact. *); + context_region: region option + (** + Specifies a portion of the artifact that encloses the region. Allows a + viewer to display additional context around the region. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the physical + location. + *); + region: region option (** Specifies a portion of the artifact. *) +} + [@@deriving show,eq] (** A location within a programming artifact. *) -type location = Sarif_v_2_1_0_t.location = - { annotations : region list option (** A set of regions relevant to the location. *) - ; id : int64 - (** Value that distinguishes this location from all other locations within - a single result object. *) - ; logical_locations : logical_location list option - (** The logical locations associated with the result. *) - ; message : message option (** A message relevant to the location. *) - ; physical_location : physical_location option - (** Identifies the artifact and region. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the location. *) - ; relationships : location_relationship list option - (** An array of objects that describe relationships between this location - and others. *) - } -[@@deriving show, eq] +type location = Sarif_v_2_1_0_t.location = { + annotations: region list option + (** A set of regions relevant to the location. *); + id: int64 + (** + Value that distinguishes this location from all other locations within + a single result object. + *); + logical_locations: logical_location list option + (** The logical locations associated with the result. *); + message: message option (** A message relevant to the location. *); + physical_location: physical_location option + (** Identifies the artifact and region. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the location. + *); + relationships: location_relationship list option + (** + An array of objects that describe relationships between this location + and others. + *) +} + [@@deriving show,eq] (** The replacement of a single region of an artifact. *) -type replacement = Sarif_v_2_1_0_t.replacement = - { deleted_region : region (** The region of the artifact to delete. *) - ; inserted_content : artifact_content option - (** The content to insert at the location specified by the 'deletedRegion' - property. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - replacement. *) - } -[@@deriving show, eq] +type replacement = Sarif_v_2_1_0_t.replacement = { + deleted_region: region (** The region of the artifact to delete. *); + inserted_content: artifact_content option + (** + The content to insert at the location specified by the 'deletedRegion' + property. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + replacement. + *) +} + [@@deriving show,eq] (** A change to a single artifact. *) -type artifact_change = Sarif_v_2_1_0_t.artifact_change = - { artifact_location : artifact_location (** The location of the artifact to change. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the change. *) - ; replacements : replacement list - (** An array of replacement objects, each of which represents the +type artifact_change = Sarif_v_2_1_0_t.artifact_change = { + artifact_location: artifact_location + (** The location of the artifact to change. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the change. + *); + replacements: replacement list + (** + An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by - 'artifactLocation'. *) - } -[@@deriving show, eq] - -(** A proposed fix for the problem represented by a result object. A fix - specifies a set of artifacts to modify. For each artifact, it specifies a - set of bytes to remove, and provides a set of new bytes to replace them. *) -type fix = Sarif_v_2_1_0_t.fix = - { artifact_changes : artifact_change list - (** One or more artifact changes that comprise a fix for a result. *) - ; description : message option - (** A message that describes the proposed fix, enabling viewers to present - the proposed change to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the fix. *) - } -[@@deriving show, eq] + 'artifactLocation'. + *) +} + [@@deriving show,eq] + +(** + A proposed fix for the problem represented by a result object. A fix + specifies a set of artifacts to modify. For each artifact, it specifies a + set of bytes to remove, and provides a set of new bytes to replace them. +*) +type fix = Sarif_v_2_1_0_t.fix = { + artifact_changes: artifact_change list + (** One or more artifact changes that comprise a fix for a result. *); + description: message option + (** + A message that describes the proposed fix, enabling viewers to present + the proposed change to an end user. + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the fix. *) +} + [@@deriving show,eq] (** Specifies the failure level for the report. *) -type reporting_configuration_level = Sarif_v_2_1_0_t.reporting_configuration_level -[@@deriving show, eq] - -(** Information about a rule or notification that can be configured at runtime. *) -type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = - { enabled : bool (** Specifies whether the report may be produced during the scan. *) - ; level : reporting_configuration_level option - (** Specifies the failure level for the report. *) - ; parameters : property_bag option - (** Contains configuration information specific to a report. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - configuration. *) - ; rank : int64 - } -[@@deriving show, eq] +type reporting_configuration_level = + Sarif_v_2_1_0_t.reporting_configuration_level + [@@deriving show,eq] + +(** + Information about a rule or notification that can be configured at runtime. +*) +type reporting_configuration = Sarif_v_2_1_0_t.reporting_configuration = { + enabled: bool + (** Specifies whether the report may be produced during the scan. *); + level: reporting_configuration_level option + (** Specifies the failure level for the report. *); + parameters: property_bag option + (** Contains configuration information specific to a report. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + configuration. + *); + rank: int64 +} + [@@deriving show,eq] (** ReportingDescriptorDeprecatedGuidsItem *) type reporting_descriptor_deprecated_guids_item = Sarif_v_2_1_0_t.reporting_descriptor_deprecated_guids_item -[@@deriving show, eq] + [@@deriving show,eq] -(** A unique identifier for the reporting descriptor in the form of a GUID. *) +(** + A unique identifier for the reporting descriptor in the form of a GUID. +*) type reporting_descriptor_guid = Sarif_v_2_1_0_t.reporting_descriptor_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A guid that uniquely identifies the descriptor. *) type reporting_descriptor_reference_guid = Sarif_v_2_1_0_t.reporting_descriptor_reference_guid -[@@deriving show, eq] + [@@deriving show,eq] (** The state of a result relative to a baseline of a previous run. *) -type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state [@@deriving show, eq] +type result_baseline_state = Sarif_v_2_1_0_t.result_baseline_state + [@@deriving show,eq] -(** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) +(** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. +*) type result_correlation_guid = Sarif_v_2_1_0_t.result_correlation_guid -[@@deriving show, eq] + [@@deriving show,eq] (** A stable, unique identifier for the result in the form of a GUID. *) -type result_guid = Sarif_v_2_1_0_t.result_guid [@@deriving show, eq] +type result_guid = Sarif_v_2_1_0_t.result_guid + [@@deriving show,eq] (** A value that categorizes results by evaluation state. *) -type result_kind = Sarif_v_2_1_0_t.result_kind [@@deriving show, eq] +type result_kind = Sarif_v_2_1_0_t.result_kind + [@@deriving show,eq] (** A value specifying the severity level of the result. *) -type result_level = Sarif_v_2_1_0_t.result_level [@@deriving show, eq] +type result_level = Sarif_v_2_1_0_t.result_level + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was first detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was first detected. +*) type result_provenance_first_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_first_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] -(** A GUID-valued string equal to the automationDetails.guid property of the - run in which the result was most recently detected. *) +(** + A GUID-valued string equal to the automationDetails.guid property of the + run in which the result was most recently detected. +*) type result_provenance_last_detection_run_guid = Sarif_v_2_1_0_t.result_provenance_last_detection_run_guid -[@@deriving show, eq] + [@@deriving show,eq] (** Contains information about how and when a result was detected. *) -type result_provenance = Sarif_v_2_1_0_t.result_provenance = - { conversion_sources : physical_location list option - (** An array of physicalLocation objects which specify the portions of an - analysis tool's output that a converter transformed into the result. *) - ; first_detection_run_guid : result_provenance_first_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was first detected. *) - ; first_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result +type result_provenance = Sarif_v_2_1_0_t.result_provenance = { + conversion_sources: physical_location list option + (** + An array of physicalLocation objects which specify the portions of an + analysis tool's output that a converter transformed into the result. + *); + first_detection_run_guid: result_provenance_first_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was first detected. + *); + first_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was first detected. See "Date/time properties" in the SARIF spec for - the required format. *) - ; invocation_index : int64 - (** The index within the run.invocations array of the invocation object - which describes the tool invocation that detected the result. *) - ; last_detection_run_guid : result_provenance_last_detection_run_guid option - (** A GUID-valued string equal to the automationDetails.guid property of - the run in which the result was most recently detected. *) - ; last_detection_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the result + the required format. + *); + invocation_index: int64 + (** + The index within the run.invocations array of the invocation object + which describes the tool invocation that detected the result. + *); + last_detection_run_guid: result_provenance_last_detection_run_guid option + (** + A GUID-valued string equal to the automationDetails.guid property of + the run in which the result was most recently detected. + *); + last_detection_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the result was most recently detected. See "Date/time properties" in the SARIF - spec for the required format. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - } -[@@deriving show, eq] + spec for the required format. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *) +} + [@@deriving show,eq] (** A function call within a stack trace. *) -type stack_frame = Sarif_v_2_1_0_t.stack_frame = - { location : location option (** The location to which this stack frame refers. *) - ; module_ : string option - (** The name of the module that contains the code of this stack frame. *) - ; parameters : string list option (** The parameters of the call that is executing. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack - frame. *) - ; thread_id : int64 option (** The thread identifier of the stack frame. *) - } -[@@deriving show, eq] +type stack_frame = Sarif_v_2_1_0_t.stack_frame = { + location: location option + (** The location to which this stack frame refers. *); + module_: string option + (** The name of the module that contains the code of this stack frame. *); + parameters: string list option + (** The parameters of the call that is executing. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack + frame. + *); + thread_id: int64 option (** The thread identifier of the stack frame. *) +} + [@@deriving show,eq] (** A call stack that is relevant to a result. *) -type stack = Sarif_v_2_1_0_t.stack = - { frames : stack_frame list - (** An array of stack frames that represents a sequence of calls, rendered - in reverse chronological order, that comprise the call stack. *) - ; message : message option (** A message relevant to this call stack. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the stack. *) - } -[@@deriving show, eq] +type stack = Sarif_v_2_1_0_t.stack = { + frames: stack_frame list + (** + An array of stack frames that represents a sequence of calls, rendered + in reverse chronological order, that comprise the call stack. + *); + message: message option (** A message relevant to this call stack. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the stack. + *) +} + [@@deriving show,eq] (** A stable, unique identifier for the suprression in the form of a GUID. *) -type suppression_guid = Sarif_v_2_1_0_t.suppression_guid [@@deriving show, eq] +type suppression_guid = Sarif_v_2_1_0_t.suppression_guid + [@@deriving show,eq] (** A string that indicates where the suppression is persisted. *) -type suppression_kind = Sarif_v_2_1_0_t.suppression_kind [@@deriving show, eq] +type suppression_kind = Sarif_v_2_1_0_t.suppression_kind + [@@deriving show,eq] (** A string that indicates the review status of the suppression. *) -type suppression_status = Sarif_v_2_1_0_t.suppression_status [@@deriving show, eq] +type suppression_status = Sarif_v_2_1_0_t.suppression_status + [@@deriving show,eq] (** A suppression that is relevant to a result. *) -type suppression = Sarif_v_2_1_0_t.suppression = - { guid : suppression_guid option - (** A stable, unique identifier for the suprression in the form of a GUID. *) - ; justification : string option - (** A string representing the justification for the suppression. *) - ; kind : suppression_kind - (** A string that indicates where the suppression is persisted. *) - ; location : location option - (** Identifies the location associated with the suppression. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - suppression. *) - ; status : suppression_status option - (** A string that indicates the review status of the suppression. *) - } -[@@deriving show, eq] - -(** Specifies the importance of this location in understanding the code flow in - which it occurs. The order from most to least important is "essential", - "important", "unimportant". Default: "important". *) -type thread_flow_location_importance = Sarif_v_2_1_0_t.thread_flow_location_importance -[@@deriving show, eq] +type suppression = Sarif_v_2_1_0_t.suppression = { + guid: suppression_guid option + (** + A stable, unique identifier for the suprression in the form of a GUID. + *); + justification: string option + (** A string representing the justification for the suppression. *); + kind: suppression_kind + (** A string that indicates where the suppression is persisted. *); + location: location option + (** Identifies the location associated with the suppression. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + suppression. + *); + status: suppression_status option + (** A string that indicates the review status of the suppression. *) +} + [@@deriving show,eq] + +(** + Specifies the importance of this location in understanding the code flow in + which it occurs. The order from most to least important is "essential", + "important", "unimportant". Default: "important". +*) +type thread_flow_location_importance = + Sarif_v_2_1_0_t.thread_flow_location_importance + [@@deriving show,eq] (** ToolComponentContentsItem *) -type tool_component_contents_item = Sarif_v_2_1_0_t.tool_component_contents_item -[@@deriving show, eq] - -(** The binary version of the tool component's primary executable file - expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) +type tool_component_contents_item = + Sarif_v_2_1_0_t.tool_component_contents_item + [@@deriving show,eq] + +(** + The binary version of the tool component's primary executable file + expressed as four non-negative integers separated by a period (for + operating systems that express file versions in this way). +*) type tool_component_dotted_quad_file_version = Sarif_v_2_1_0_t.tool_component_dotted_quad_file_version -[@@deriving show, eq] + [@@deriving show,eq] (** A unique identifier for the tool component in the form of a GUID. *) -type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase language code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) +type tool_component_guid = Sarif_v_2_1_0_t.tool_component_guid + [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase language code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) type tool_component_language = Sarif_v_2_1_0_t.tool_component_language -[@@deriving show, eq] + [@@deriving show,eq] (** The 'guid' property of the referenced toolComponent. *) -type tool_component_reference_guid = Sarif_v_2_1_0_t.tool_component_reference_guid -[@@deriving show, eq] - -(** Identifies a particular toolComponent object, either the driver or an - extension. *) -type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = - { guid : tool_component_reference_guid option - (** The 'guid' property of the referenced toolComponent. *) - ; index : int64 (** An index into the referenced toolComponent in tool.extensions. *) - ; name : string option (** The 'name' property of the referenced toolComponent. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - toolComponentReference. *) - } -[@@deriving show, eq] +type tool_component_reference_guid = + Sarif_v_2_1_0_t.tool_component_reference_guid + [@@deriving show,eq] + +(** + Identifies a particular toolComponent object, either the driver or an + extension. +*) +type tool_component_reference = Sarif_v_2_1_0_t.tool_component_reference = { + guid: tool_component_reference_guid option + (** The 'guid' property of the referenced toolComponent. *); + index: int64 + (** An index into the referenced toolComponent in tool.extensions. *); + name: string option + (** The 'name' property of the referenced toolComponent. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + toolComponentReference. + *) +} + [@@deriving show,eq] (** Information about how to locate a relevant reporting descriptor. *) -type reporting_descriptor_reference = Sarif_v_2_1_0_t.reporting_descriptor_reference = - { guid : reporting_descriptor_reference_guid option - (** A guid that uniquely identifies the descriptor. *) - ; id : string option (** The id of the descriptor. *) - ; index : int64 - (** The index into an array of descriptors in +type reporting_descriptor_reference = + Sarif_v_2_1_0_t.reporting_descriptor_reference = { + guid: reporting_descriptor_reference_guid option + (** A guid that uniquely identifies the descriptor. *); + id: string option (** The id of the descriptor. *); + index: int64 + (** + The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, - or toolComponent.taxonomyDescriptors, depending on context. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; tool_component : tool_component_reference option - (** A reference used to locate the toolComponent associated with the - descriptor. *) - } -[@@deriving show, eq] - -(** Information about how a specific rule or notification was reconfigured at - runtime. *) -type configuration_override = Sarif_v_2_1_0_t.configuration_override = - { configuration : reporting_configuration - (** Specifies how the rule or notification was configured during the scan. *) - ; descriptor : reporting_descriptor_reference - (** A reference used to locate the descriptor whose configuration was - overridden. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - configuration override. *) - } -[@@deriving show, eq] + or toolComponent.taxonomyDescriptors, depending on context. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + tool_component: tool_component_reference option + (** + A reference used to locate the toolComponent associated with the + descriptor. + *) +} + [@@deriving show,eq] + +(** + Information about how a specific rule or notification was reconfigured at + runtime. +*) +type configuration_override = Sarif_v_2_1_0_t.configuration_override = { + configuration: reporting_configuration + (** + Specifies how the rule or notification was configured during the scan. + *); + descriptor: reporting_descriptor_reference + (** + A reference used to locate the descriptor whose configuration was + overridden. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + configuration override. + *) +} + [@@deriving show,eq] (** Information about the relation of one reporting descriptor to another. *) type reporting_descriptor_relationship = - Sarif_v_2_1_0_t.reporting_descriptor_relationship = - { description : message option - (** A description of the reporting descriptor relationship. *) - ; kinds : string list option - (** A set of distinct strings that categorize the relationship. Well-known + Sarif_v_2_1_0_t.reporting_descriptor_relationship = { + description: message option + (** A description of the reporting descriptor relationship. *); + kinds: string list option + (** + A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and - 'incomparable'. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the reporting - descriptor reference. *) - ; target : reporting_descriptor_reference - (** A reference to the related reporting descriptor. *) - } -[@@deriving show, eq] - -(** Metadata that describes a specific report produced by the tool, as part of - the analysis it provides or its runtime reporting. *) -type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = - { default_configuration : reporting_configuration option - (** Default reporting configuration information. *) - ; deprecated_guids : reporting_descriptor_deprecated_guids_item list option - (** An array of unique identifies in the form of a GUID by which this - report was known in some previous version of the analysis tool. *) - ; deprecated_ids : string list option - (** An array of stable, opaque identifiers by which this report was known - in some previous version of the analysis tool. *) - ; deprecated_names : string list option - (** An array of readable identifiers by which this report was known in some - previous version of the analysis tool. *) - ; full_description : multiformat_message_string option - (** A description of the report. Should, as far as possible, provide + 'incomparable'. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the reporting + descriptor reference. + *); + target: reporting_descriptor_reference + (** A reference to the related reporting descriptor. *) +} + [@@deriving show,eq] + +(** + Metadata that describes a specific report produced by the tool, as part of + the analysis it provides or its runtime reporting. +*) +type reporting_descriptor = Sarif_v_2_1_0_t.reporting_descriptor = { + default_configuration: reporting_configuration option + (** Default reporting configuration information. *); + deprecated_guids: reporting_descriptor_deprecated_guids_item list option + (** + An array of unique identifies in the form of a GUID by which this + report was known in some previous version of the analysis tool. + *); + deprecated_ids: string list option + (** + An array of stable, opaque identifiers by which this report was known + in some previous version of the analysis tool. + *); + deprecated_names: string list option + (** + An array of readable identifiers by which this report was known in some + previous version of the analysis tool. + *); + full_description: multiformat_message_string option + (** + A description of the report. Should, as far as possible, provide details sufficient to enable resolution of any problem indicated by the - result. *) - ; guid : reporting_descriptor_guid option - (** A unique identifier for the reporting descriptor in the form of a GUID. *) - ; help : multiformat_message_string option - (** Provides the primary documentation for the report, useful when there is - no online documentation. *) - ; help_uri : string option - (** A URI where the primary documentation for the report can be found. *) - ; id : string (** A stable, opaque identifier for the report. *) - ; message_strings : hm_str_mms option - (** A set of name/value pairs with arbitrary names. Each value is a + result. + *); + guid: reporting_descriptor_guid option + (** + A unique identifier for the reporting descriptor in the form of a GUID. + *); + help: multiformat_message_string option + (** + Provides the primary documentation for the report, useful when there is + no online documentation. + *); + help_uri: string option + (** A URI where the primary documentation for the report can be found. *); + id: string (** A stable, opaque identifier for the report. *); + message_strings: hm_str_mms option + (** + A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination - with an arbitrary number of additional string arguments. *) - ; name : string option (** A report identifier that is understandable to an end user. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the report. *) - ; relationships : reporting_descriptor_relationship list option - (** An array of objects that describe relationships between this reporting - descriptor and others. *) - ; short_description : multiformat_message_string option - (** A concise description of the report. Should be a single sentence that + with an arbitrary number of additional string arguments. + *); + name: string option + (** A report identifier that is understandable to an end user. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the report. + *); + relationships: reporting_descriptor_relationship list option + (** + An array of objects that describe relationships between this reporting + descriptor and others. + *); + short_description: multiformat_message_string option + (** + A concise description of the report. Should be a single sentence that is understandable when visible space is limited to a single line of - text. *) - } -[@@deriving show, eq] + text. + *) +} + [@@deriving show,eq] (** Provides additional metadata related to translation. *) -type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = - { download_uri : string option - (** The absolute URI from which the translation metadata can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the translation metadata. *) - ; full_name : string option - (** The full name associated with the translation metadata. *) - ; information_uri : string option - (** The absolute URI from which information related to the translation - metadata can be downloaded. *) - ; name : string (** The name associated with the translation metadata. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - translation metadata. *) - ; short_description : multiformat_message_string option - (** A brief description of the translation metadata. *) - } -[@@deriving show, eq] - -(** A component, such as a plug-in or the driver, of the analysis tool that was - run. *) -type tool_component = Sarif_v_2_1_0_t.tool_component = - { associated_component : tool_component_reference option - (** The component which is strongly associated with this component. For a +type translation_metadata = Sarif_v_2_1_0_t.translation_metadata = { + download_uri: string option + (** + The absolute URI from which the translation metadata can be downloaded. + *); + full_description: multiformat_message_string option + (** A comprehensive description of the translation metadata. *); + full_name: string option + (** The full name associated with the translation metadata. *); + information_uri: string option + (** + The absolute URI from which information related to the translation + metadata can be downloaded. + *); + name: string (** The name associated with the translation metadata. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + translation metadata. + *); + short_description: multiformat_message_string option + (** A brief description of the translation metadata. *) +} + [@@deriving show,eq] + +(** + A component, such as a plug-in or the driver, of the analysis tool that was + run. +*) +type tool_component = Sarif_v_2_1_0_t.tool_component = { + associated_component: tool_component_reference option + (** + The component which is strongly associated with this component. For a translation, this refers to the component which has been translated. For an extension, this is the driver that provides the extension's - plugin model. *) - ; contents : tool_component_contents_item list option - (** The kinds of data contained in this object. *) - ; dotted_quad_file_version : tool_component_dotted_quad_file_version option - (** The binary version of the tool component's primary executable file + plugin model. + *); + contents: tool_component_contents_item list option + (** The kinds of data contained in this object. *); + dotted_quad_file_version: tool_component_dotted_quad_file_version option + (** + The binary version of the tool component's primary executable file expressed as four non-negative integers separated by a period (for - operating systems that express file versions in this way). *) - ; download_uri : string option - (** The absolute URI from which the tool component can be downloaded. *) - ; full_description : multiformat_message_string option - (** A comprehensive description of the tool component. *) - ; full_name : string option - (** The name of the tool component along with its version and any other - useful identifying information, such as its locale. *) - ; global_message_strings : hm_str_mms option - (** A dictionary, each of whose keys is a resource identifier and each of + operating systems that express file versions in this way). + *); + download_uri: string option + (** The absolute URI from which the tool component can be downloaded. *); + full_description: multiformat_message_string option + (** A comprehensive description of the tool component. *); + full_name: string option + (** + The name of the tool component along with its version and any other + useful identifying information, such as its locale. + *); + global_message_strings: hm_str_mms option + (** + A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in - combination with an arbitrary number of additional string arguments. *) - ; guid : tool_component_guid option - (** A unique identifier for the tool component in the form of a GUID. *) - ; information_uri : string option - (** The absolute URI at which information about this version of the tool - component can be found. *) - ; is_comprehensive : bool - (** Specifies whether this object contains a complete definition of the + combination with an arbitrary number of additional string arguments. + *); + guid: tool_component_guid option + (** A unique identifier for the tool component in the form of a GUID. *); + information_uri: string option + (** + The absolute URI at which information about this version of the tool + component can be found. + *); + is_comprehensive: bool + (** + Specifies whether this object contains a complete definition of the localizable and/or non-localizable data for this component, as opposed to including only data that is relevant to the results persisted to - this log file. *) - ; language : tool_component_language option - (** The language of the messages emitted into the log file during this run + this log file. + *); + language: tool_component_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase language code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; localized_data_semantic_version : string option - (** The semantic version of the localized strings defined in this - component; maintained by components that provide translations. *) - ; locations : artifact_location list option - (** An array of the artifactLocation objects associated with the tool - component. *) - ; minimum_required_localized_data_semantic_version : string option - (** The minimum value of localizedDataSemanticVersion required in + RFC5646). + *); + localized_data_semantic_version: string option + (** + The semantic version of the localized strings defined in this + component; maintained by components that provide translations. + *); + locations: artifact_location list option + (** + An array of the artifactLocation objects associated with the tool + component. + *); + minimum_required_localized_data_semantic_version: string option + (** + The minimum value of localizedDataSemanticVersion required in translations consumed by this component; used by components that - consume translations. *) - ; name : string (** The name of the tool component. *) - ; notifications : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the notifications + consume translations. + *); + name: string (** The name of the tool component. *); + notifications: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the notifications related to the configuration and runtime execution of the tool - component. *) - ; organization : string option - (** The organization or company that produced the tool component. *) - ; product : string option (** A product suite to which the tool component belongs. *) - ; product_suite : string option - (** A localizable string containing the name of the suite of products to - which the tool component belongs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool - component. *) - ; release_date_utc : string option - (** A string specifying the UTC date (and optionally, the time) of the - component's release. *) - ; rules : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the analysis - performed by the tool component. *) - ; semantic_version : string option - (** The tool component version in the format specified by Semantic - Versioning 2.0. *) - ; short_description : multiformat_message_string option - (** A brief description of the tool component. *) - ; supported_taxonomies : tool_component_reference list option - (** An array of toolComponentReference objects to declare the taxonomies - supported by the tool component. *) - ; taxa : reporting_descriptor list option - (** An array of reportingDescriptor objects relevant to the definitions of - both standalone and tool-defined taxonomies. *) - ; translation_metadata : translation_metadata option - (** Translation metadata, required for a translation, not populated by - other component types. *) - ; version : string option - (** The tool component version, in whatever format the component natively - provides. *) - } -[@@deriving show, eq] + component. + *); + organization: string option + (** The organization or company that produced the tool component. *); + product: string option + (** A product suite to which the tool component belongs. *); + product_suite: string option + (** + A localizable string containing the name of the suite of products to + which the tool component belongs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool + component. + *); + release_date_utc: string option + (** + A string specifying the UTC date (and optionally, the time) of the + component's release. + *); + rules: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the analysis + performed by the tool component. + *); + semantic_version: string option + (** + The tool component version in the format specified by Semantic + Versioning 2.0. + *); + short_description: multiformat_message_string option + (** A brief description of the tool component. *); + supported_taxonomies: tool_component_reference list option + (** + An array of toolComponentReference objects to declare the taxonomies + supported by the tool component. + *); + taxa: reporting_descriptor list option + (** + An array of reportingDescriptor objects relevant to the definitions of + both standalone and tool-defined taxonomies. + *); + translation_metadata: translation_metadata option + (** + Translation metadata, required for a translation, not populated by + other component types. + *); + version: string option + (** + The tool component version, in whatever format the component natively + provides. + *) +} + [@@deriving show,eq] (** The analysis tool that was run. *) -type tool = Sarif_v_2_1_0_t.tool = - { driver : tool_component (** The analysis tool that was run. *) - ; extensions : tool_component list option - (** Tool extensions that contributed to or reconfigured the analysis tool - that was run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the tool. *) - } -[@@deriving show, eq] +type tool = Sarif_v_2_1_0_t.tool = { + driver: tool_component (** The analysis tool that was run. *); + extensions: tool_component list option + (** + Tool extensions that contributed to or reconfigured the analysis tool + that was run. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the tool. + *) +} + [@@deriving show,eq] (** Describes an HTTP request. *) -type web_request = Sarif_v_2_1_0_t.web_request = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; method_ : string option - (** The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', - 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. *) - ; parameters : hm_str_str option (** The request parameters. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; target : string option (** The target of the request. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] +type web_request = Sarif_v_2_1_0_t.web_request = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + method_: string option + (** + The HTTP method. Well-known values are 'GET', 'PUT', 'POST', 'DELETE', + 'PATCH', 'HEAD', 'OPTIONS', 'TRACE', 'CONNECT'. + *); + parameters: hm_str_str option (** The request parameters. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + target: string option (** The target of the request. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] (** Describes the response to an HTTP request. *) -type web_response = Sarif_v_2_1_0_t.web_response = - { body : artifact_content option (** The body of the request. *) - ; headers : hm_str_str option (** The request headers. *) - ; index : int64 - (** The index within the run.webRequests array of the request object - associated with this result. *) - ; no_response_received : bool - (** Specifies whether a response was received from the server. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the request. *) - ; protocol : string option (** The request protocol. Example: 'http'. *) - ; reason_phrase : string option (** The response reason. Example: 'Not found'. *) - ; status_code : string option (** The response status code. Example: 451. *) - ; version : string option (** The request version. Example: '1.1'. *) - } -[@@deriving show, eq] - -(** A location visited by an analysis tool while simulating or monitoring the - execution of a program. *) -type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = - { execution_order : int64 - (** An integer representing the temporal order in which execution reached - this location. *) - ; execution_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which this - location was executed. *) - ; importance : thread_flow_location_importance option - (** Specifies the importance of this location in understanding the code +type web_response = Sarif_v_2_1_0_t.web_response = { + body: artifact_content option (** The body of the request. *); + headers: hm_str_str option (** The request headers. *); + index: int64 + (** + The index within the run.webRequests array of the request object + associated with this result. + *); + no_response_received: bool + (** Specifies whether a response was received from the server. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the request. + *); + protocol: string option (** The request protocol. Example: 'http'. *); + reason_phrase: string option + (** The response reason. Example: 'Not found'. *); + status_code: string option (** The response status code. Example: 451. *); + version: string option (** The request version. Example: '1.1'. *) +} + [@@deriving show,eq] + +(** + A location visited by an analysis tool while simulating or monitoring the + execution of a program. +*) +type thread_flow_location = Sarif_v_2_1_0_t.thread_flow_location = { + execution_order: int64 + (** + An integer representing the temporal order in which execution reached + this location. + *); + execution_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which this + location was executed. + *); + importance: thread_flow_location_importance option + (** + Specifies the importance of this location in understanding the code flow in which it occurs. The order from most to least important is - "essential", "important", "unimportant". Default: "important". *) - ; index : int64 (** he index within the run threadFlowLocations array. *) - ; kinds : string list option - (** A set of distinct strings that categorize the thread flow location. + "essential", "important", "unimportant". Default: "important". + *); + index: int64 (** he index within the run threadFlowLocations array. *); + kinds: string list option + (** + A set of distinct strings that categorize the thread flow location. Well-known kinds include 'acquire', 'release', 'enter', 'exit', 'call', 'return', 'branch', 'implicit', 'false', 'true', 'caution', 'danger', 'unknown', 'unreachable', 'taint', 'function', 'handler', 'lock', - 'memory', 'resource', 'scope' and 'value'. *) - ; location : location option (** The code location. *) - ; module_ : string option - (** The name of the module that contains the code that is executing. *) - ; nesting_level : int64 option - (** An integer representing a containment hierarchy within the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - threadflow location. *) - ; stack : stack option (** The call stack leading to this location. *) - ; state : hm_str_mms option - (** A dictionary, each of whose keys specifies a variable or expression, + 'memory', 'resource', 'scope' and 'value'. + *); + location: location option (** The code location. *); + module_: string option + (** The name of the module that contains the code that is executing. *); + nesting_level: int64 option + (** + An integer representing a containment hierarchy within the thread flow. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + threadflow location. + *); + stack: stack option (** The call stack leading to this location. *); + state: hm_str_mms option + (** + A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global - variables. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to rule or taxonomy reporting descriptors that - are applicable to the thread flow location. *) - ; web_request : web_request option - (** A web request associated with this thread flow location. *) - ; web_response : web_response option - (** A web response associated with this thread flow location. *) - } -[@@deriving show, eq] - -(** Describes a sequence of code locations that specify a path through a single - thread of execution such as an operating system or fiber. *) -type thread_flow = Sarif_v_2_1_0_t.thread_flow = - { id : string option - (** An string that uniquely identifies the threadFlow within the codeFlow - in which it occurs. *) - ; immutable_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that - remain constant. *) - ; initial_state : hm_str_mms option - (** Values of relevant expressions at the start of the thread flow that may - change during thread flow execution. *) - ; locations : thread_flow_location list - (** A temporally ordered array of 'threadFlowLocation' objects, each of + variables. + *); + taxa: reporting_descriptor_reference list option + (** + An array of references to rule or taxonomy reporting descriptors that + are applicable to the thread flow location. + *); + web_request: web_request option + (** A web request associated with this thread flow location. *); + web_response: web_response option + (** A web response associated with this thread flow location. *) +} + [@@deriving show,eq] + +(** + Describes a sequence of code locations that specify a path through a single + thread of execution such as an operating system or fiber. +*) +type thread_flow = Sarif_v_2_1_0_t.thread_flow = { + id: string option + (** + An string that uniquely identifies the threadFlow within the codeFlow + in which it occurs. + *); + immutable_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that + remain constant. + *); + initial_state: hm_str_mms option + (** + Values of relevant expressions at the start of the thread flow that may + change during thread flow execution. + *); + locations: thread_flow_location list + (** + A temporally ordered array of 'threadFlowLocation' objects, each of which describes a location visited by the tool while producing the - result. *) - ; message : message option (** A message relevant to the thread flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the thread - flow. *) - } -[@@deriving show, eq] - -(** A set of threadFlows which together describe a pattern of code execution - relevant to detecting a result. *) -type code_flow = Sarif_v_2_1_0_t.code_flow = - { message : message option (** A message relevant to the code flow. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the code - flow. *) - ; thread_flows : thread_flow list - (** An array of one or more unique threadFlow objects, each of which - describes the progress of a program through a thread of execution. *) - } -[@@deriving show, eq] + result. + *); + message: message option (** A message relevant to the thread flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the thread + flow. + *) +} + [@@deriving show,eq] + +(** + A set of threadFlows which together describe a pattern of code execution + relevant to detecting a result. +*) +type code_flow = Sarif_v_2_1_0_t.code_flow = { + message: message option (** A message relevant to the code flow. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the code + flow. + *); + thread_flows: thread_flow list + (** + An array of one or more unique threadFlow objects, each of which + describes the progress of a program through a thread of execution. + *) +} + [@@deriving show,eq] (** Represents a node in a graph. *) -type node = Sarif_v_2_1_0_t.node = - { children : node list option (** Array of child nodes. *) - ; id : string (** A string that uniquely identifies the node within its graph. *) - ; label : message option (** A short description of the node. *) - ; location : location option (** A code location associated with the node. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the node. *) - } -[@@deriving show, eq] - -(** Describes a runtime exception encountered during the execution of an - analysis tool. *) -type exception_ = Sarif_v_2_1_0_t.exception_ = - { inner_exceptions : exception_ list option - (** An array of exception objects each of which is considered a cause of - this exception. *) - ; kind : string option - (** A string that identifies the kind of exception, for example, the fully +type node = Sarif_v_2_1_0_t.node = { + children: node list option (** Array of child nodes. *); + id: string + (** A string that uniquely identifies the node within its graph. *); + label: message option (** A short description of the node. *); + location: location option (** A code location associated with the node. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the node. + *) +} + [@@deriving show,eq] + +(** + Describes a runtime exception encountered during the execution of an + analysis tool. +*) +type exception_ = Sarif_v_2_1_0_t.exception_ = { + inner_exceptions: exception_ list option + (** + An array of exception objects each of which is considered a cause of + this exception. + *); + kind: string option + (** + A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name - of a signal. *) - ; message : string option (** A message that describes the exception. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - exception. *) - ; stack : stack option (** The sequence of function calls leading to the exception. *) - } -[@@deriving show, eq] - -(** A network of nodes and directed edges that describes some aspect of the - structure of the code (for example, a call graph). *) -type graph = Sarif_v_2_1_0_t.graph = - { description : message option (** A description of the graph. *) - ; edges : edge list option - (** An array of edge objects representing the edges of the graph. *) - ; nodes : node list option - (** An array of node objects representing the nodes of the graph. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the graph. *) - } -[@@deriving show, eq] + of a signal. + *); + message: string option (** A message that describes the exception. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + exception. + *); + stack: stack option + (** The sequence of function calls leading to the exception. *) +} + [@@deriving show,eq] + +(** + A network of nodes and directed edges that describes some aspect of the + structure of the code (for example, a call graph). +*) +type graph = Sarif_v_2_1_0_t.graph = { + description: message option (** A description of the graph. *); + edges: edge list option + (** An array of edge objects representing the edges of the graph. *); + nodes: node list option + (** An array of node objects representing the nodes of the graph. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the graph. + *) +} + [@@deriving show,eq] (** A result produced by an analysis tool. *) -type result = Sarif_v_2_1_0_t.result = - { analysis_target : artifact_location option - (** Identifies the artifact that the analysis tool was instructed to scan. +type result = Sarif_v_2_1_0_t.result = { + analysis_target: artifact_location option + (** + Identifies the artifact that the analysis tool was instructed to scan. This need not be the same as the artifact where the result actually - occurred. *) - ; attachments : attachment list option (** A set of artifacts relevant to the result. *) - ; baseline_state : result_baseline_state option - (** The state of a result relative to a baseline of a previous run. *) - ; code_flows : code_flow list option - (** An array of 'codeFlow' objects relevant to the result. *) - ; correlation_guid : result_correlation_guid option - (** A stable, unique identifier for the equivalence class of logically - identical results to which this result belongs, in the form of a GUID. *) - ; fingerprints : hm_str_str option - (** A set of strings each of which individually defines a stable, unique - identity for the result. *) - ; fixes : fix list option - (** An array of 'fix' objects, each of which represents a proposed fix to - the problem indicated by the result. *) - ; graph_traversals : graph_traversal list option - (** An array of one or more unique 'graphTraversal' objects. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the - result. *) - ; guid : result_guid option - (** A stable, unique identifier for the result in the form of a GUID. *) - ; hosted_viewer_uri : string option - (** An absolute URI at which the result can be viewed. *) - ; kind : result_kind option (** A value that categorizes results by evaluation state. *) - ; level : result_level option - (** A value specifying the severity level of the result. *) - ; locations : location list option - (** The set of locations where the result was detected. Specify only one + occurred. + *); + attachments: attachment list option + (** A set of artifacts relevant to the result. *); + baseline_state: result_baseline_state option + (** The state of a result relative to a baseline of a previous run. *); + code_flows: code_flow list option + (** An array of 'codeFlow' objects relevant to the result. *); + correlation_guid: result_correlation_guid option + (** + A stable, unique identifier for the equivalence class of logically + identical results to which this result belongs, in the form of a GUID. + *); + fingerprints: hm_str_str option + (** + A set of strings each of which individually defines a stable, unique + identity for the result. + *); + fixes: fix list option + (** + An array of 'fix' objects, each of which represents a proposed fix to + the problem indicated by the result. + *); + graph_traversals: graph_traversal list option + (** An array of one or more unique 'graphTraversal' objects. *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the + result. + *); + guid: result_guid option + (** A stable, unique identifier for the result in the form of a GUID. *); + hosted_viewer_uri: string option + (** An absolute URI at which the result can be viewed. *); + kind: result_kind option + (** A value that categorizes results by evaluation state. *); + level: result_level option + (** A value specifying the severity level of the result. *); + locations: location list option + (** + The set of locations where the result was detected. Specify only one location unless the problem indicated by the result can only be - corrected by making a change at every specified location. *) - ; message : message - (** A message that describes the result. The first sentence of the message - only will be displayed when visible space is limited. *) - ; occurrence_count : int64 option - (** A positive integer specifying the number of times this logically unique - result was observed in this run. *) - ; partial_fingerprints : hm_str_str option - (** A set of strings that contribute to the stable, unique identity of the - result. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the result. *) - ; provenance : result_provenance option - (** Information about how and when the result was detected. *) - ; rank : int64 - ; related_locations : location list option - (** A set of locations relevant to this result. *) - ; rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor relevant to this result. *) - ; rule_id : string option - (** The stable, unique identifier of the rule, if any, to which this result - is relevant. *) - ; rule_index : int64 - (** The index within the tool component rules array of the rule object - associated with this result. *) - ; stacks : stack list option (** An array of 'stack' objects relevant to the result. *) - ; suppressions : suppression list option - (** A set of suppressions relevant to this result. *) - ; taxa : reporting_descriptor_reference list option - (** An array of references to taxonomy reporting descriptors that are - applicable to the result. *) - ; web_request : web_request option (** A web request associated with this result. *) - ; web_response : web_response option (** A web response associated with this result. *) - ; work_item_uris : string list option - (** The URIs of the work items associated with this result. *) - } -[@@deriving show, eq] - -(** Describes a condition relevant to the tool itself, as opposed to being - relevant to a target being analyzed by the tool. *) -type notification = Sarif_v_2_1_0_t.notification = - { associated_rule : reporting_descriptor_reference option - (** A reference used to locate the rule descriptor associated with this - notification. *) - ; descriptor : reporting_descriptor_reference option - (** A reference used to locate the descriptor relevant to this - notification. *) - ; exception_ : exception_ option - (** The runtime exception, if any, relevant to this notification. *) - ; level : notification_level option - (** A value specifying the severity level of the notification. *) - ; locations : location list option (** The locations relevant to this notification. *) - ; message : message (** A message that describes the condition that was encountered. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - notification. *) - ; thread_id : int64 option - (** The thread identifier of the code that generated the notification. *) - ; time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the - analysis tool generated the notification. *) - } -[@@deriving show, eq] + corrected by making a change at every specified location. + *); + message: message + (** + A message that describes the result. The first sentence of the message + only will be displayed when visible space is limited. + *); + occurrence_count: int64 option + (** + A positive integer specifying the number of times this logically unique + result was observed in this run. + *); + partial_fingerprints: hm_str_str option + (** + A set of strings that contribute to the stable, unique identity of the + result. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the result. + *); + provenance: result_provenance option + (** Information about how and when the result was detected. *); + rank: int64; + related_locations: location list option + (** A set of locations relevant to this result. *); + rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor relevant to this result. + *); + rule_id: string option + (** + The stable, unique identifier of the rule, if any, to which this result + is relevant. + *); + rule_index: int64 + (** + The index within the tool component rules array of the rule object + associated with this result. + *); + stacks: stack list option + (** An array of 'stack' objects relevant to the result. *); + suppressions: suppression list option + (** A set of suppressions relevant to this result. *); + taxa: reporting_descriptor_reference list option + (** + An array of references to taxonomy reporting descriptors that are + applicable to the result. + *); + web_request: web_request option + (** A web request associated with this result. *); + web_response: web_response option + (** A web response associated with this result. *); + work_item_uris: string list option + (** The URIs of the work items associated with this result. *) +} + [@@deriving show,eq] + +(** + Describes a condition relevant to the tool itself, as opposed to being + relevant to a target being analyzed by the tool. +*) +type notification = Sarif_v_2_1_0_t.notification = { + associated_rule: reporting_descriptor_reference option + (** + A reference used to locate the rule descriptor associated with this + notification. + *); + descriptor: reporting_descriptor_reference option + (** + A reference used to locate the descriptor relevant to this + notification. + *); + exception_: exception_ option + (** The runtime exception, if any, relevant to this notification. *); + level: notification_level option + (** A value specifying the severity level of the notification. *); + locations: location list option + (** The locations relevant to this notification. *); + message: message + (** A message that describes the condition that was encountered. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + notification. + *); + thread_id: int64 option + (** The thread identifier of the code that generated the notification. *); + time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the + analysis tool generated the notification. + *) +} + [@@deriving show,eq] (** The runtime environment of the analysis tool run. *) -type invocation = Sarif_v_2_1_0_t.invocation = - { account : string option (** The account under which the invocation occurred. *) - ; arguments : string option - (** An array of strings, containing in order the command line arguments - passed to the tool from the operating system. *) - ; command_line : string option (** The command line used to invoke the tool. *) - ; end_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the +type invocation = Sarif_v_2_1_0_t.invocation = { + account: string option + (** The account under which the invocation occurred. *); + arguments: string option + (** + An array of strings, containing in order the command line arguments + passed to the tool from the operating system. + *); + command_line: string option + (** The command line used to invoke the tool. *); + end_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation ended. See "Date/time properties" in the SARIF spec for the - required format. *) - ; environment_variables : hm_str_str option - (** The environment variables associated with the analysis tool process, - expressed as key/value pairs. *) - ; executable_location : artifact_location option - (** An absolute URI specifying the location of the executable that was - invoked. *) - ; execution_successful : bool - (** Specifies whether the tool's execution completed successfully. *) - ; exit_code : int64 option (** The process exit code. *) - ; exit_code_description : string option (** The reason for the process exit. *) - ; exit_signal_name : string option - (** The name of the signal that caused the process to exit. *) - ; exit_signal_number : int64 option - (** The numeric value of the signal that caused the process to exit. *) - ; notification_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe notifications - related runtime overrides. *) - ; process_id : int64 option - (** The id of the process in which the invocation occurred. *) - ; process_start_failure_message : string option - (** The reason given by the operating system that the process failed to - start. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - invocation. *) - ; response_files : artifact_location list option - (** The locations of any response files specified on the tool's command - line. *) - ; rule_configuration_overrides : configuration_override list option - (** An array of configurationOverride objects that describe rules related - runtime overrides. *) - ; start_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + required format. + *); + environment_variables: hm_str_str option + (** + The environment variables associated with the analysis tool process, + expressed as key/value pairs. + *); + executable_location: artifact_location option + (** + An absolute URI specifying the location of the executable that was + invoked. + *); + execution_successful: bool + (** Specifies whether the tool's execution completed successfully. *); + exit_code: int64 option (** The process exit code. *); + exit_code_description: string option + (** The reason for the process exit. *); + exit_signal_name: string option + (** The name of the signal that caused the process to exit. *); + exit_signal_number: int64 option + (** The numeric value of the signal that caused the process to exit. *); + notification_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe notifications + related runtime overrides. + *); + process_id: int64 option + (** The id of the process in which the invocation occurred. *); + process_start_failure_message: string option + (** + The reason given by the operating system that the process failed to + start. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + invocation. + *); + response_files: artifact_location list option + (** + The locations of any response files specified on the tool's command + line. + *); + rule_configuration_overrides: configuration_override list option + (** + An array of configurationOverride objects that describe rules related + runtime overrides. + *); + start_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the invocation started. See "Date/time properties" in the SARIF spec for - the required format. *) - ; stderr : artifact_location option - (** A file containing the standard error stream from the process that was - invoked. *) - ; stdin : artifact_location option - (** A file containing the standard input stream to the process that was - invoked. *) - ; stdout : artifact_location option - (** A file containing the standard output stream from the process that was - invoked. *) - ; stdout_stderr : artifact_location option - (** A file containing the interleaved standard output and standard error - stream from the process that was invoked. *) - ; tool_configuration_notifications : notification list option - (** A list of conditions detected by the tool that are relevant to the - tool's configuration. *) - ; tool_execution_notifications : notification list option - (** A list of runtime conditions detected by the tool during the analysis. *) - ; working_directory : artifact_location option - (** The working directory for the invocation. *) - } -[@@deriving show, eq] - -(** Describes how a converter transformed the output of a static analysis tool - from the analysis tool's native output format into the SARIF format. *) -type conversion = Sarif_v_2_1_0_t.conversion = - { analysis_tool_log_files : artifact_location list option - (** The locations of the analysis tool's per-run log files. *) - ; invocation : invocation option - (** An invocation object that describes the invocation of the converter. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the - conversion. *) - ; tool : tool (** A tool object that describes the converter. *) - } -[@@deriving show, eq] - -(** A single artifact. In some cases, this artifact might be nested within - another artifact. *) -type artifact = Sarif_v_2_1_0_t.artifact = - { contents : artifact_content option (** The contents of the artifact. *) - ; description : message option (** A short description of the artifact. *) - ; encoding : string option - (** Specifies the encoding for an artifact object that refers to a text - file. *) - ; hashes : hm_str_str option - (** A dictionary, each of whose keys is the name of a hash function and + the required format. + *); + stderr: artifact_location option + (** + A file containing the standard error stream from the process that was + invoked. + *); + stdin: artifact_location option + (** + A file containing the standard input stream to the process that was + invoked. + *); + stdout: artifact_location option + (** + A file containing the standard output stream from the process that was + invoked. + *); + stdout_stderr: artifact_location option + (** + A file containing the interleaved standard output and standard error + stream from the process that was invoked. + *); + tool_configuration_notifications: notification list option + (** + A list of conditions detected by the tool that are relevant to the + tool's configuration. + *); + tool_execution_notifications: notification list option + (** + A list of runtime conditions detected by the tool during the analysis. + *); + working_directory: artifact_location option + (** The working directory for the invocation. *) +} + [@@deriving show,eq] + +(** + Describes how a converter transformed the output of a static analysis tool + from the analysis tool's native output format into the SARIF format. +*) +type conversion = Sarif_v_2_1_0_t.conversion = { + analysis_tool_log_files: artifact_location list option + (** The locations of the analysis tool's per-run log files. *); + invocation: invocation option + (** + An invocation object that describes the invocation of the converter. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the + conversion. + *); + tool: tool (** A tool object that describes the converter. *) +} + [@@deriving show,eq] + +(** + A single artifact. In some cases, this artifact might be nested within + another artifact. +*) +type artifact = Sarif_v_2_1_0_t.artifact = { + contents: artifact_content option (** The contents of the artifact. *); + description: message option (** A short description of the artifact. *); + encoding: string option + (** + Specifies the encoding for an artifact object that refers to a text + file. + *); + hashes: hm_str_str option + (** + A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by - the specified hash function. *) - ; last_modified_time_utc : string option - (** The Coordinated Universal Time (UTC) date and time at which the + the specified hash function. + *); + last_modified_time_utc: string option + (** + The Coordinated Universal Time (UTC) date and time at which the artifact was most recently modified. See "Date/time properties" in the - SARIF spec for the required format. *) - ; length : int64 (** The length of the artifact in bytes. *) - ; location : artifact_location option (** The location of the artifact. *) - ; mime_type : artifact_mimetype option (** The MIME type (RFC 2045) of the artifact. *) - ; offset : int64 option - (** The offset in bytes of the artifact within its containing artifact. *) - ; parent_index : int64 - (** Identifies the index of the immediate parent of the artifact, if this - artifact is nested. *) - ; properties : external_properties option - (** Key/value pairs that provide additional information about the artifact. *) - ; roles : artifact_roles_item list option - (** The role or roles played by the artifact in the analysis. *) - ; source_language : string option - (** Specifies the source language for any artifact object that refers to a - text file that contains source code. *) - } -[@@deriving show, eq] + SARIF spec for the required format. + *); + length: int64 (** The length of the artifact in bytes. *); + location: artifact_location option (** The location of the artifact. *); + mime_type: artifact_mimetype option + (** The MIME type (RFC 2045) of the artifact. *); + offset: int64 option + (** + The offset in bytes of the artifact within its containing artifact. + *); + parent_index: int64 + (** + Identifies the index of the immediate parent of the artifact, if this + artifact is nested. + *); + properties: external_properties option + (** + Key/value pairs that provide additional information about the artifact. + *); + roles: artifact_roles_item list option + (** The role or roles played by the artifact in the analysis. *); + source_language: string option + (** + Specifies the source language for any artifact object that refers to a + text file that contains source code. + *) +} + [@@deriving show,eq] (** The top-level element of an external property file. *) -and external_properties = Sarif_v_2_1_0_t.external_properties = - { addresses : address list option - (** Addresses that will be merged with a separate run. *) - ; artifacts : artifact list option - (** An array of artifact objects that will be merged with a separate run. *) - ; conversion : conversion option - (** A conversion object that will be merged with a separate run. *) - ; driver : tool_component option - (** The analysis tool object that will be merged with a separate run. *) - ; extensions : tool_component list option - (** Tool extensions that will be merged with a separate run. *) - ; externalized_properties : property_bag option - (** Key/value pairs that provide additional information that will be merged - with a separate run. *) - ; graph : graph list option - (** An array of graph objects that will be merged with a separate run. *) - ; guid : external_properties_guid option - (** A stable, unique identifier for this external properties object, in the - form of a GUID. *) - ; invocations : invocation option - (** Describes the invocation of the analysis tool that will be merged with - a separate run. *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions - that will be merged with a separate run. *) - ; policies : tool_component list option - (** Tool policies that will be merged with a separate run. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - properties. *) - ; results : result option - (** An array of result objects that will be merged with a separate run. *) - ; run_guid : external_properties_run_guid option - (** A stable, unique identifier for the run associated with this external - properties object, in the form of a GUID. *) - ; schema : string option - (** The URI of the JSON schema corresponding to the version of the external - property file format. *) - ; taxonomies : tool_component list option - (** Tool taxonomies that will be merged with a separate run. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects that will be merged with a - separate run. *) - ; translations : tool_component list option - (** Tool translations that will be merged with a separate run. *) - ; version : external_properties_version option - (** The SARIF format version of this external properties object. *) - ; web_requests : web_request list option - (** Requests that will be merged with a separate run. *) - ; web_responses : web_response list option - (** Responses that will be merged with a separate run. *) - } -[@@deriving show, eq] - -(** Specifies the information necessary to retrieve a desired revision from a - version control system. *) -type version_control_details = Sarif_v_2_1_0_t.version_control_details = - { as_of_time_utc : string option - (** A Coordinated Universal Time (UTC) date and time that can be used to - synchronize an enlistment to the state of the repository at that time. *) - ; branch : string option (** The name of a branch containing the revision. *) - ; mapped_to : artifact_location option - (** The location in the local file system to which the root of the - repository was mapped at the time of the analysis. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the version - control details. *) - ; repository_uri : string (** The absolute URI of the repository. *) - ; revision_id : string option - (** A string that uniquely and permanently identifies the revision within - the repository. *) - ; revision_tag : string option (** A tag that has been applied to the revision. *) - } -[@@deriving show, eq] +and external_properties = Sarif_v_2_1_0_t.external_properties = { + addresses: address list option + (** Addresses that will be merged with a separate run. *); + artifacts: artifact list option + (** + An array of artifact objects that will be merged with a separate run. + *); + conversion: conversion option + (** A conversion object that will be merged with a separate run. *); + driver: tool_component option + (** The analysis tool object that will be merged with a separate run. *); + extensions: tool_component list option + (** Tool extensions that will be merged with a separate run. *); + externalized_properties: property_bag option + (** + Key/value pairs that provide additional information that will be merged + with a separate run. + *); + graph: graph list option + (** An array of graph objects that will be merged with a separate run. *); + guid: external_properties_guid option + (** + A stable, unique identifier for this external properties object, in the + form of a GUID. + *); + invocations: invocation option + (** + Describes the invocation of the analysis tool that will be merged with + a separate run. + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions + that will be merged with a separate run. + *); + policies: tool_component list option + (** Tool policies that will be merged with a separate run. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + properties. + *); + results: result option + (** + An array of result objects that will be merged with a separate run. + *); + run_guid: external_properties_run_guid option + (** + A stable, unique identifier for the run associated with this external + properties object, in the form of a GUID. + *); + schema: string option + (** + The URI of the JSON schema corresponding to the version of the external + property file format. + *); + taxonomies: tool_component list option + (** Tool taxonomies that will be merged with a separate run. *); + thread_flow_locations: thread_flow_location list option + (** + An array of threadFlowLocation objects that will be merged with a + separate run. + *); + translations: tool_component list option + (** Tool translations that will be merged with a separate run. *); + version: external_properties_version option + (** The SARIF format version of this external properties object. *); + web_requests: web_request list option + (** Requests that will be merged with a separate run. *); + web_responses: web_response list option + (** Responses that will be merged with a separate run. *) +} + [@@deriving show,eq] + +(** + Specifies the information necessary to retrieve a desired revision from a + version control system. +*) +type version_control_details = Sarif_v_2_1_0_t.version_control_details = { + as_of_time_utc: string option + (** + A Coordinated Universal Time (UTC) date and time that can be used to + synchronize an enlistment to the state of the repository at that time. + *); + branch: string option (** The name of a branch containing the revision. *); + mapped_to: artifact_location option + (** + The location in the local file system to which the root of the + repository was mapped at the time of the analysis. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the version + control details. + *); + repository_uri: string (** The absolute URI of the repository. *); + revision_id: string option + (** + A string that uniquely and permanently identifies the revision within + the repository. + *); + revision_tag: string option + (** A tag that has been applied to the revision. *) +} + [@@deriving show,eq] (** Defines locations of special significance to SARIF consumers. *) -type special_locations = Sarif_v_2_1_0_t.special_locations = - { display_base : artifact_location option - (** Provides a suggestion to SARIF consumers to display file paths relative - to the specified location. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the special - locations. *) - } -[@@deriving show, eq] - -type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show, eq] - -(** The language of the messages emitted into the log file during this run - (expressed as an ISO 639-1 two-letter lowercase culture code) and an - optional region (expressed as an ISO 3166-1 two-letter uppercase subculture - code associated with a country or region). The casing is recommended but - not required (in order for this data to conform to RFC5646). *) -type run_language = Sarif_v_2_1_0_t.run_language [@@deriving show, eq] +type special_locations = Sarif_v_2_1_0_t.special_locations = { + display_base: artifact_location option + (** + Provides a suggestion to SARIF consumers to display file paths relative + to the specified location. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the special + locations. + *) +} + [@@deriving show,eq] + +type sarif_version = Sarif_v_2_1_0_t.sarif_version [@@deriving show,eq] + +(** + The language of the messages emitted into the log file during this run + (expressed as an ISO 639-1 two-letter lowercase culture code) and an + optional region (expressed as an ISO 3166-1 two-letter uppercase subculture + code associated with a country or region). The casing is recommended but + not required (in order for this data to conform to RFC5646). +*) +type run_language = Sarif_v_2_1_0_t.run_language + [@@deriving show,eq] (** Specifies the unit in which the tool measures columns. *) -type run_column_kind = Sarif_v_2_1_0_t.run_column_kind [@@deriving show, eq] - -(** The 'guid' property of a previous SARIF 'run' that comprises the baseline - that was used to compute result 'baselineState' properties for the run. *) -type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid [@@deriving show, eq] - -(** A stable, unique identifier for this object's containing run object in the - form of a GUID. *) -type run_automation_details_guid = Sarif_v_2_1_0_t.run_automation_details_guid -[@@deriving show, eq] - -(** A stable, unique identifier for the equivalence class of runs to which this - object's containing run object belongs in the form of a GUID. *) +type run_column_kind = Sarif_v_2_1_0_t.run_column_kind + [@@deriving show,eq] + +(** + The 'guid' property of a previous SARIF 'run' that comprises the baseline + that was used to compute result 'baselineState' properties for the run. +*) +type run_baseline_guid = Sarif_v_2_1_0_t.run_baseline_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for this object's containing run object in the + form of a GUID. +*) +type run_automation_details_guid = + Sarif_v_2_1_0_t.run_automation_details_guid + [@@deriving show,eq] + +(** + A stable, unique identifier for the equivalence class of runs to which this + object's containing run object belongs in the form of a GUID. +*) type run_automation_details_correlation_guid = Sarif_v_2_1_0_t.run_automation_details_correlation_guid -[@@deriving show, eq] - -(** Information that describes a run's identity and role within an engineering - system process. *) -type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = - { correlation_guid : run_automation_details_correlation_guid option - (** A stable, unique identifier for the equivalence class of runs to which - this object's containing run object belongs in the form of a GUID. *) - ; description : message option - (** A description of the identity and role played within the engineering - system by this object's containing run object. *) - ; guid : run_automation_details_guid option - (** A stable, unique identifier for this object's containing run object in - the form of a GUID. *) - ; id : string option - (** A hierarchical string that uniquely identifies this object's containing - run object. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run - automation details. *) - } -[@@deriving show, eq] - -type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show, eq] - -(** A stable, unique identifier for the external property file in the form of a - GUID. *) + [@@deriving show,eq] + +(** + Information that describes a run's identity and role within an engineering + system process. +*) +type run_automation_details = Sarif_v_2_1_0_t.run_automation_details = { + correlation_guid: run_automation_details_correlation_guid option + (** + A stable, unique identifier for the equivalence class of runs to which + this object's containing run object belongs in the form of a GUID. + *); + description: message option + (** + A description of the identity and role played within the engineering + system by this object's containing run object. + *); + guid: run_automation_details_guid option + (** + A stable, unique identifier for this object's containing run object in + the form of a GUID. + *); + id: string option + (** + A hierarchical string that uniquely identifies this object's containing + run object. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the run + automation details. + *) +} + [@@deriving show,eq] + +type hm_str_al = Sarif_v_2_1_0_t.hm_str_al [@@deriving show,eq] + +(** + A stable, unique identifier for the external property file in the form of a + GUID. +*) type external_property_file_reference_guid = Sarif_v_2_1_0_t.external_property_file_reference_guid -[@@deriving show, eq] - -(** Contains information that enables a SARIF consumer to locate the external - property file that contains the value of an externalized property - associated with the run. *) -type external_property_file_reference = Sarif_v_2_1_0_t.external_property_file_reference = - { guid : external_property_file_reference_guid option - (** A stable, unique identifier for the external property file in the form - of a GUID. *) - ; item_count : int64 - (** A non-negative integer specifying the number of items contained in the - external property file. *) - ; location : artifact_location option (** The location of the external property file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property file. *) - } -[@@deriving show, eq] - -(** References to external property files that should be inlined with the - content of a root log file. *) + [@@deriving show,eq] + +(** + Contains information that enables a SARIF consumer to locate the external + property file that contains the value of an externalized property + associated with the run. +*) +type external_property_file_reference = + Sarif_v_2_1_0_t.external_property_file_reference = { + guid: external_property_file_reference_guid option + (** + A stable, unique identifier for the external property file in the form + of a GUID. + *); + item_count: int64 + (** + A non-negative integer specifying the number of items contained in the + external property file. + *); + location: artifact_location option + (** The location of the external property file. *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property file. + *) +} + [@@deriving show,eq] + +(** + References to external property files that should be inlined with the + content of a root log file. +*) type external_property_file_references = - Sarif_v_2_1_0_t.external_property_file_references = - { addresses : external_property_file_reference list option - (** An array of external property files containing run.addresses arrays to - be merged with the root log file. *) - ; artifacts : external_property_file_reference list option - (** An array of external property files containing run.artifacts arrays to - be merged with the root log file. *) - ; conversion : external_property_file_reference option - (** An external property file containing a run.conversion object to be - merged with the root log file. *) - ; driver : external_property_file_reference option - (** An external property file containing a run.driver object to be merged - with the root log file. *) - ; extensions : external_property_file_reference list option - (** An array of external property files containing run.extensions arrays to - be merged with the root log file. *) - ; externalized_properties : external_property_file_reference option - (** An external property file containing a run.properties object to be - merged with the root log file. *) - ; graphs : external_property_file_reference list option - (** An array of external property files containing a run.graphs object to - be merged with the root log file. *) - ; invocations : external_property_file_reference list option - (** An array of external property files containing run.invocations arrays - to be merged with the root log file. *) - ; logical_locations : external_property_file_reference list option - (** An array of external property files containing run.logicalLocations - arrays to be merged with the root log file. *) - ; policies : external_property_file_reference list option - (** An array of external property files containing run.policies arrays to - be merged with the root log file. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the external - property files. *) - ; results : external_property_file_reference list option - (** An array of external property files containing run.results arrays to be - merged with the root log file. *) - ; taxonomies : external_property_file_reference list option - (** An array of external property files containing run.taxonomies arrays to - be merged with the root log file. *) - ; thread_flow_locations : external_property_file_reference list option - (** An array of external property files containing run.threadFlowLocations - arrays to be merged with the root log file. *) - ; translations : external_property_file_reference list option - (** An array of external property files containing run.translations arrays - to be merged with the root log file. *) - ; web_requests : external_property_file_reference list option - (** An array of external property files containing run.requests arrays to - be merged with the root log file. *) - ; web_responses : external_property_file_reference list option - (** An array of external property files containing run.responses arrays to - be merged with the root log file. *) - } -[@@deriving show, eq] - -(** Describes a single run of an analysis tool, and contains the reported - output of that run. *) -type run = Sarif_v_2_1_0_t.run = - { addresses : address list option - (** Addresses associated with this run instance, if any. *) - ; artifacts : artifact list option - (** An array of artifact objects relevant to the run. *) - ; automation_details : run_automation_details option - (** Automation details that describe this run. *) - ; baseline_guid : run_baseline_guid option - (** The 'guid' property of a previous SARIF 'run' that comprises the + Sarif_v_2_1_0_t.external_property_file_references = { + addresses: external_property_file_reference list option + (** + An array of external property files containing run.addresses arrays to + be merged with the root log file. + *); + artifacts: external_property_file_reference list option + (** + An array of external property files containing run.artifacts arrays to + be merged with the root log file. + *); + conversion: external_property_file_reference option + (** + An external property file containing a run.conversion object to be + merged with the root log file. + *); + driver: external_property_file_reference option + (** + An external property file containing a run.driver object to be merged + with the root log file. + *); + extensions: external_property_file_reference list option + (** + An array of external property files containing run.extensions arrays to + be merged with the root log file. + *); + externalized_properties: external_property_file_reference option + (** + An external property file containing a run.properties object to be + merged with the root log file. + *); + graphs: external_property_file_reference list option + (** + An array of external property files containing a run.graphs object to + be merged with the root log file. + *); + invocations: external_property_file_reference list option + (** + An array of external property files containing run.invocations arrays + to be merged with the root log file. + *); + logical_locations: external_property_file_reference list option + (** + An array of external property files containing run.logicalLocations + arrays to be merged with the root log file. + *); + policies: external_property_file_reference list option + (** + An array of external property files containing run.policies arrays to + be merged with the root log file. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the external + property files. + *); + results: external_property_file_reference list option + (** + An array of external property files containing run.results arrays to be + merged with the root log file. + *); + taxonomies: external_property_file_reference list option + (** + An array of external property files containing run.taxonomies arrays to + be merged with the root log file. + *); + thread_flow_locations: external_property_file_reference list option + (** + An array of external property files containing run.threadFlowLocations + arrays to be merged with the root log file. + *); + translations: external_property_file_reference list option + (** + An array of external property files containing run.translations arrays + to be merged with the root log file. + *); + web_requests: external_property_file_reference list option + (** + An array of external property files containing run.requests arrays to + be merged with the root log file. + *); + web_responses: external_property_file_reference list option + (** + An array of external property files containing run.responses arrays to + be merged with the root log file. + *) +} + [@@deriving show,eq] + +(** + Describes a single run of an analysis tool, and contains the reported + output of that run. +*) +type run = Sarif_v_2_1_0_t.run = { + addresses: address list option + (** Addresses associated with this run instance, if any. *); + artifacts: artifact list option + (** An array of artifact objects relevant to the run. *); + automation_details: run_automation_details option + (** Automation details that describe this run. *); + baseline_guid: run_baseline_guid option + (** + The 'guid' property of a previous SARIF 'run' that comprises the baseline that was used to compute result 'baselineState' properties for - the run. *) - ; column_kind : run_column_kind option - (** Specifies the unit in which the tool measures columns. *) - ; conversion : conversion option - (** A conversion object that describes how a converter transformed an - analysis tool's native reporting format into the SARIF format. *) - ; default_encoding : string option - (** Specifies the default encoding for any artifact object that refers to a - text file. *) - ; default_source_language : string option - (** Specifies the default source language for any artifact object that - refers to a text file that contains source code. *) - ; external_property_file_references : external_property_file_references option - (** References to external property files that should be inlined with the - content of a root log file. *) - ; graphs : graph list option - (** An array of zero or more unique graph objects associated with the run. *) - ; invocations : invocation list option - (** Describes the invocation of the analysis tool. *) - ; language : run_language option - (** The language of the messages emitted into the log file during this run + the run. + *); + column_kind: run_column_kind option + (** Specifies the unit in which the tool measures columns. *); + conversion: conversion option + (** + A conversion object that describes how a converter transformed an + analysis tool's native reporting format into the SARIF format. + *); + default_encoding: string option + (** + Specifies the default encoding for any artifact object that refers to a + text file. + *); + default_source_language: string option + (** + Specifies the default source language for any artifact object that + refers to a text file that contains source code. + *); + external_property_file_references: external_property_file_references option + (** + References to external property files that should be inlined with the + content of a root log file. + *); + graphs: graph list option + (** + An array of zero or more unique graph objects associated with the run. + *); + invocations: invocation list option + (** Describes the invocation of the analysis tool. *); + language: run_language option + (** + The language of the messages emitted into the log file during this run (expressed as an ISO 639-1 two-letter lowercase culture code) and an optional region (expressed as an ISO 3166-1 two-letter uppercase subculture code associated with a country or region). The casing is recommended but not required (in order for this data to conform to - RFC5646). *) - ; logical_locations : logical_location list option - (** An array of logical locations such as namespaces, types or functions. *) - ; newline_sequences : string list - (** An ordered list of character sequences that were treated as line breaks - when computing region information for the run. *) - ; original_uri_base_ids : hm_str_al option - (** The artifact location specified by each uriBaseId symbol on the machine - where the tool originally ran. *) - ; policies : tool_component list option - (** Contains configurations that may potentially override both + RFC5646). + *); + logical_locations: logical_location list option + (** + An array of logical locations such as namespaces, types or functions. + *); + newline_sequences: string list + (** + An ordered list of character sequences that were treated as line breaks + when computing region information for the run. + *); + original_uri_base_ids: hm_str_al option + (** + The artifact location specified by each uriBaseId symbol on the machine + where the tool originally ran. + *); + policies: tool_component list option + (** + Contains configurations that may potentially override both reportingDescriptor.defaultConfiguration (the tool's default severities) and invocation.configurationOverrides (severities - established at run-time from the command line). *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the run. *) - ; redaction_tokens : string list option - (** An array of strings used to replace sensitive information in a - redaction-aware property. *) - ; results : result list option - (** The set of results contained in an SARIF log. The results array can be + established at run-time from the command line). + *); + properties: property_bag option + (** Key/value pairs that provide additional information about the run. *); + redaction_tokens: string list option + (** + An array of strings used to replace sensitive information in a + redaction-aware property. + *); + results: result list option + (** + The set of results contained in an SARIF log. The results array can be omitted when a run is solely exporting rules metadata. It must be - present (but may be empty) if a log file represents an actual scan. *) - ; run_aggregates : run_automation_details list option - (** Automation details that describe the aggregate of runs to which this - run belongs. *) - ; special_locations : special_locations option - (** A specialLocations object that defines locations of special - significance to SARIF consumers. *) - ; taxonomies : tool_component list option - (** An array of toolComponent objects relevant to a taxonomy in which - results are categorized. *) - ; thread_flow_locations : thread_flow_location list option - (** An array of threadFlowLocation objects cached at run level. *) - ; tool : tool - (** Information about the tool or tool pipeline that generated the results + present (but may be empty) if a log file represents an actual scan. + *); + run_aggregates: run_automation_details list option + (** + Automation details that describe the aggregate of runs to which this + run belongs. + *); + special_locations: special_locations option + (** + A specialLocations object that defines locations of special + significance to SARIF consumers. + *); + taxonomies: tool_component list option + (** + An array of toolComponent objects relevant to a taxonomy in which + results are categorized. + *); + thread_flow_locations: thread_flow_location list option + (** An array of threadFlowLocation objects cached at run level. *); + tool: tool + (** + Information about the tool or tool pipeline that generated the results in this run. A run can only contain results produced by a single tool or tool pipeline. A run can aggregate results from multiple log files, as long as context around the tool run (tool command-line arguments and - the like) is identical for all aggregated files. *) - ; translations : tool_component list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; version_control_provenance : version_control_details list option - (** Specifies the revision in version control of the artifacts that were - scanned. *) - ; web_requests : web_request list option - (** An array of request objects cached at run level. *) - ; web_responses : web_response list option - (** An array of response objects cached at run level. *) - } -[@@deriving show, eq] - -(** Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON - Schema: a standard format for the output of static analysis tools. *) -type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = - { version : sarif_version (** The SARIF format version of this log file. *) - ; inline_external_properties : external_properties list option - (** References to external property files that share data between runs. *) - ; properties : property_bag option - (** Key/value pairs that provide additional information about the log file. *) - ; runs : run list (** The set of runs contained in this log file. *) - ; schema : string option (** The URI of the JSON schema corresponding to the version. *) - } -[@@deriving show, eq] - -(** Validate a value of type {!type:artifact_mimetype}. *) -val validate_artifact_mimetype - : Atdgen_runtime.Util.Validation.path - -> artifact_mimetype - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:artifact_roles_item}. *) -val validate_artifact_roles_item - : Atdgen_runtime.Util.Validation.path - -> artifact_roles_item - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:external_properties_guid}. *) -val validate_external_properties_guid - : Atdgen_runtime.Util.Validation.path - -> external_properties_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:external_properties_run_guid}. *) -val validate_external_properties_run_guid - : Atdgen_runtime.Util.Validation.path - -> external_properties_run_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:external_properties_version}. *) -val validate_external_properties_version - : Atdgen_runtime.Util.Validation.path - -> external_properties_version - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:hm_str_str}. *) -val validate_hm_str_str - : Atdgen_runtime.Util.Validation.path - -> hm_str_str - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:int64}. *) -val validate_int64 - : Atdgen_runtime.Util.Validation.path - -> int64 - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:notification_level}. *) -val validate_notification_level - : Atdgen_runtime.Util.Validation.path - -> notification_level - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:property_bag}. *) -val validate_property_bag - : Atdgen_runtime.Util.Validation.path - -> property_bag - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:address}. *) -val create_address - : ?absolute_address:int64 - -> ?fully_qualified_name:string - -> ?index:int64 - -> ?kind:string - -> ?length:int64 - -> ?name:string - -> ?offset_from_parent:int64 - -> ?parent_index:int64 - -> ?properties:property_bag - -> ?relative_address:int64 - -> unit - -> address - -(** Validate a value of type {!type:address}. *) -val validate_address - : Atdgen_runtime.Util.Validation.path - -> address - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:logical_location}. *) -val create_logical_location - : ?decorated_name:string - -> ?fully_qualified_name:string - -> ?index:int64 - -> ?kind:string - -> ?name:string - -> ?parent_index:int64 - -> ?properties:property_bag - -> unit - -> logical_location - -(** Validate a value of type {!type:logical_location}. *) -val validate_logical_location - : Atdgen_runtime.Util.Validation.path - -> logical_location - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:message}. *) -val create_message - : ?arguments:string list - -> ?id:string - -> ?markdown:string - -> ?properties:property_bag - -> ?text:string - -> unit - -> message - -(** Validate a value of type {!type:message}. *) -val validate_message - : Atdgen_runtime.Util.Validation.path - -> message - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:artifact_location}. *) -val create_artifact_location - : ?description:message - -> ?index:int64 - -> ?properties:property_bag - -> ?uri:string - -> ?uri_base_id:string - -> unit - -> artifact_location - -(** Validate a value of type {!type:artifact_location}. *) -val validate_artifact_location - : Atdgen_runtime.Util.Validation.path - -> artifact_location - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:edge}. *) -val create_edge - : id:string - -> ?label:message - -> ?properties:property_bag - -> source_node_id:string - -> target_node_id:string - -> unit - -> edge - -(** Validate a value of type {!type:edge}. *) -val validate_edge - : Atdgen_runtime.Util.Validation.path - -> edge - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:location_relationship}. *) -val create_location_relationship - : ?description:message - -> ?kinds:string list - -> ?properties:property_bag - -> target:int64 - -> unit - -> location_relationship - -(** Validate a value of type {!type:location_relationship}. *) -val validate_location_relationship - : Atdgen_runtime.Util.Validation.path - -> location_relationship - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:multiformat_message_string}. *) -val create_multiformat_message_string - : ?markdown:string - -> ?properties:property_bag - -> text:string - -> unit - -> multiformat_message_string - -(** Validate a value of type {!type:multiformat_message_string}. *) -val validate_multiformat_message_string - : Atdgen_runtime.Util.Validation.path - -> multiformat_message_string - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:artifact_content}. *) -val create_artifact_content - : ?binary:string - -> ?properties:property_bag - -> ?rendered:multiformat_message_string - -> ?text:string - -> unit - -> artifact_content - -(** Validate a value of type {!type:artifact_content}. *) -val validate_artifact_content - : Atdgen_runtime.Util.Validation.path - -> artifact_content - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:hm_str_mms}. *) -val validate_hm_str_mms - : Atdgen_runtime.Util.Validation.path - -> hm_str_mms - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:edge_traversal}. *) -val create_edge_traversal - : edge_id:string - -> ?final_state:hm_str_mms - -> ?message:message - -> ?properties:property_bag - -> ?step_over_edge_count:int64 - -> unit - -> edge_traversal - -(** Validate a value of type {!type:edge_traversal}. *) -val validate_edge_traversal - : Atdgen_runtime.Util.Validation.path - -> edge_traversal - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:graph_traversal_variant0}. *) -val create_graph_traversal_variant0 - : ?description:message - -> ?edge_traversals:edge_traversal list - -> ?immutable_state:hm_str_mms - -> ?initial_state:hm_str_mms - -> ?properties:property_bag - -> ?result_graph_index:int64 - -> ?run_graph_index:int64 - -> unit - -> graph_traversal_variant0 - -(** Validate a value of type {!type:graph_traversal_variant0}. *) -val validate_graph_traversal_variant0 - : Atdgen_runtime.Util.Validation.path - -> graph_traversal_variant0 - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:graph_traversal_variant1}. *) -val create_graph_traversal_variant1 - : ?description:message - -> ?edge_traversals:edge_traversal list - -> ?immutable_state:hm_str_mms - -> ?initial_state:hm_str_mms - -> ?properties:property_bag - -> ?result_graph_index:int64 - -> ?run_graph_index:int64 - -> unit - -> graph_traversal_variant1 - -(** Validate a value of type {!type:graph_traversal_variant1}. *) -val validate_graph_traversal_variant1 - : Atdgen_runtime.Util.Validation.path - -> graph_traversal_variant1 - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:graph_traversal}. *) -val validate_graph_traversal - : Atdgen_runtime.Util.Validation.path - -> graph_traversal - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:rectangle}. *) -val create_rectangle - : ?bottom:float - -> ?left:float - -> ?message:message - -> ?properties:property_bag - -> ?right:float - -> ?top:float - -> unit - -> rectangle - -(** Validate a value of type {!type:rectangle}. *) -val validate_rectangle - : Atdgen_runtime.Util.Validation.path - -> rectangle - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:region}. *) -val create_region - : ?byte_length:int64 - -> ?byte_offset:int64 - -> ?char_length:int64 - -> ?char_offset:int64 - -> ?end_column:int64 - -> ?end_line:int64 - -> ?message:message - -> ?properties:property_bag - -> ?snippet:artifact_content - -> ?source_language:string - -> ?start_column:int64 - -> ?start_line:int64 - -> unit - -> region - -(** Validate a value of type {!type:region}. *) -val validate_region - : Atdgen_runtime.Util.Validation.path - -> region - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:attachment}. *) -val create_attachment - : artifact_location:artifact_location - -> ?description:message - -> ?properties:property_bag - -> ?rectangles:rectangle list - -> ?regions:region list - -> unit - -> attachment - -(** Validate a value of type {!type:attachment}. *) -val validate_attachment - : Atdgen_runtime.Util.Validation.path - -> attachment - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:physical_location}. *) -val create_physical_location - : ?address:address - -> ?artifact_location:artifact_location - -> ?context_region:region - -> ?properties:property_bag - -> ?region:region - -> unit - -> physical_location - -(** Validate a value of type {!type:physical_location}. *) -val validate_physical_location - : Atdgen_runtime.Util.Validation.path - -> physical_location - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:location}. *) -val create_location - : ?annotations:region list - -> ?id:int64 - -> ?logical_locations:logical_location list - -> ?message:message - -> ?physical_location:physical_location - -> ?properties:property_bag - -> ?relationships:location_relationship list - -> unit - -> location - -(** Validate a value of type {!type:location}. *) -val validate_location - : Atdgen_runtime.Util.Validation.path - -> location - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:replacement}. *) -val create_replacement - : deleted_region:region - -> ?inserted_content:artifact_content - -> ?properties:property_bag - -> unit - -> replacement - -(** Validate a value of type {!type:replacement}. *) -val validate_replacement - : Atdgen_runtime.Util.Validation.path - -> replacement - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:artifact_change}. *) -val create_artifact_change - : artifact_location:artifact_location - -> ?properties:property_bag - -> replacements:replacement list - -> unit - -> artifact_change - -(** Validate a value of type {!type:artifact_change}. *) -val validate_artifact_change - : Atdgen_runtime.Util.Validation.path - -> artifact_change - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:fix}. *) -val create_fix - : artifact_changes:artifact_change list - -> ?description:message - -> ?properties:property_bag - -> unit - -> fix - -(** Validate a value of type {!type:fix}. *) -val validate_fix - : Atdgen_runtime.Util.Validation.path - -> fix - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:reporting_configuration_level}. *) -val validate_reporting_configuration_level - : Atdgen_runtime.Util.Validation.path - -> reporting_configuration_level - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:reporting_configuration}. *) -val create_reporting_configuration - : ?enabled:bool - -> ?level:reporting_configuration_level - -> ?parameters:property_bag - -> ?properties:property_bag - -> ?rank:int64 - -> unit - -> reporting_configuration - -(** Validate a value of type {!type:reporting_configuration}. *) -val validate_reporting_configuration - : Atdgen_runtime.Util.Validation.path - -> reporting_configuration - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:reporting_descriptor_deprecated_guids_item}. *) -val validate_reporting_descriptor_deprecated_guids_item - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor_deprecated_guids_item - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:reporting_descriptor_guid}. *) -val validate_reporting_descriptor_guid - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:reporting_descriptor_reference_guid}. *) -val validate_reporting_descriptor_reference_guid - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor_reference_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_baseline_state}. *) -val validate_result_baseline_state - : Atdgen_runtime.Util.Validation.path - -> result_baseline_state - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_correlation_guid}. *) -val validate_result_correlation_guid - : Atdgen_runtime.Util.Validation.path - -> result_correlation_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_guid}. *) -val validate_result_guid - : Atdgen_runtime.Util.Validation.path - -> result_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_kind}. *) -val validate_result_kind - : Atdgen_runtime.Util.Validation.path - -> result_kind - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_level}. *) -val validate_result_level - : Atdgen_runtime.Util.Validation.path - -> result_level - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_provenance_first_detection_run_guid}. *) -val validate_result_provenance_first_detection_run_guid - : Atdgen_runtime.Util.Validation.path - -> result_provenance_first_detection_run_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:result_provenance_last_detection_run_guid}. *) -val validate_result_provenance_last_detection_run_guid - : Atdgen_runtime.Util.Validation.path - -> result_provenance_last_detection_run_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:result_provenance}. *) -val create_result_provenance - : ?conversion_sources:physical_location list - -> ?first_detection_run_guid:result_provenance_first_detection_run_guid - -> ?first_detection_time_utc:string - -> ?invocation_index:int64 - -> ?last_detection_run_guid:result_provenance_last_detection_run_guid - -> ?last_detection_time_utc:string - -> ?properties:property_bag - -> unit - -> result_provenance - -(** Validate a value of type {!type:result_provenance}. *) -val validate_result_provenance - : Atdgen_runtime.Util.Validation.path - -> result_provenance - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:stack_frame}. *) -val create_stack_frame - : ?location:location - -> ?module_:string - -> ?parameters:string list - -> ?properties:property_bag - -> ?thread_id:int64 - -> unit - -> stack_frame - -(** Validate a value of type {!type:stack_frame}. *) -val validate_stack_frame - : Atdgen_runtime.Util.Validation.path - -> stack_frame - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:stack}. *) -val create_stack - : frames:stack_frame list - -> ?message:message - -> ?properties:property_bag - -> unit - -> stack - -(** Validate a value of type {!type:stack}. *) -val validate_stack - : Atdgen_runtime.Util.Validation.path - -> stack - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:suppression_guid}. *) -val validate_suppression_guid - : Atdgen_runtime.Util.Validation.path - -> suppression_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:suppression_kind}. *) -val validate_suppression_kind - : Atdgen_runtime.Util.Validation.path - -> suppression_kind - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:suppression_status}. *) -val validate_suppression_status - : Atdgen_runtime.Util.Validation.path - -> suppression_status - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:suppression}. *) -val create_suppression - : ?guid:suppression_guid - -> ?justification:string - -> kind:suppression_kind - -> ?location:location - -> ?properties:property_bag - -> ?status:suppression_status - -> unit - -> suppression - -(** Validate a value of type {!type:suppression}. *) -val validate_suppression - : Atdgen_runtime.Util.Validation.path - -> suppression - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:thread_flow_location_importance}. *) -val validate_thread_flow_location_importance - : Atdgen_runtime.Util.Validation.path - -> thread_flow_location_importance - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:tool_component_contents_item}. *) -val validate_tool_component_contents_item - : Atdgen_runtime.Util.Validation.path - -> tool_component_contents_item - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:tool_component_dotted_quad_file_version}. *) -val validate_tool_component_dotted_quad_file_version - : Atdgen_runtime.Util.Validation.path - -> tool_component_dotted_quad_file_version - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:tool_component_guid}. *) -val validate_tool_component_guid - : Atdgen_runtime.Util.Validation.path - -> tool_component_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:tool_component_language}. *) -val validate_tool_component_language - : Atdgen_runtime.Util.Validation.path - -> tool_component_language - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:tool_component_reference_guid}. *) -val validate_tool_component_reference_guid - : Atdgen_runtime.Util.Validation.path - -> tool_component_reference_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:tool_component_reference}. *) -val create_tool_component_reference - : ?guid:tool_component_reference_guid - -> ?index:int64 - -> ?name:string - -> ?properties:property_bag - -> unit - -> tool_component_reference - -(** Validate a value of type {!type:tool_component_reference}. *) -val validate_tool_component_reference - : Atdgen_runtime.Util.Validation.path - -> tool_component_reference - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:reporting_descriptor_reference}. *) -val create_reporting_descriptor_reference - : ?guid:reporting_descriptor_reference_guid - -> ?id:string - -> ?index:int64 - -> ?properties:property_bag - -> ?tool_component:tool_component_reference - -> unit - -> reporting_descriptor_reference - -(** Validate a value of type {!type:reporting_descriptor_reference}. *) -val validate_reporting_descriptor_reference - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor_reference - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:configuration_override}. *) -val create_configuration_override - : configuration:reporting_configuration - -> descriptor:reporting_descriptor_reference - -> ?properties:property_bag - -> unit - -> configuration_override - -(** Validate a value of type {!type:configuration_override}. *) -val validate_configuration_override - : Atdgen_runtime.Util.Validation.path - -> configuration_override - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:reporting_descriptor_relationship}. *) -val create_reporting_descriptor_relationship - : ?description:message - -> ?kinds:string list - -> ?properties:property_bag - -> target:reporting_descriptor_reference - -> unit - -> reporting_descriptor_relationship - -(** Validate a value of type {!type:reporting_descriptor_relationship}. *) -val validate_reporting_descriptor_relationship - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor_relationship - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:reporting_descriptor}. *) -val create_reporting_descriptor - : ?default_configuration:reporting_configuration - -> ?deprecated_guids:reporting_descriptor_deprecated_guids_item list - -> ?deprecated_ids:string list - -> ?deprecated_names:string list - -> ?full_description:multiformat_message_string - -> ?guid:reporting_descriptor_guid - -> ?help:multiformat_message_string - -> ?help_uri:string - -> id:string - -> ?message_strings:hm_str_mms - -> ?name:string - -> ?properties:property_bag - -> ?relationships:reporting_descriptor_relationship list - -> ?short_description:multiformat_message_string - -> unit - -> reporting_descriptor - -(** Validate a value of type {!type:reporting_descriptor}. *) -val validate_reporting_descriptor - : Atdgen_runtime.Util.Validation.path - -> reporting_descriptor - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:translation_metadata}. *) -val create_translation_metadata - : ?download_uri:string - -> ?full_description:multiformat_message_string - -> ?full_name:string - -> ?information_uri:string - -> name:string - -> ?properties:property_bag - -> ?short_description:multiformat_message_string - -> unit - -> translation_metadata - -(** Validate a value of type {!type:translation_metadata}. *) -val validate_translation_metadata - : Atdgen_runtime.Util.Validation.path - -> translation_metadata - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:tool_component}. *) -val create_tool_component - : ?associated_component:tool_component_reference - -> ?contents:tool_component_contents_item list - -> ?dotted_quad_file_version:tool_component_dotted_quad_file_version - -> ?download_uri:string - -> ?full_description:multiformat_message_string - -> ?full_name:string - -> ?global_message_strings:hm_str_mms - -> ?guid:tool_component_guid - -> ?information_uri:string - -> ?is_comprehensive:bool - -> ?language:tool_component_language - -> ?localized_data_semantic_version:string - -> ?locations:artifact_location list - -> ?minimum_required_localized_data_semantic_version:string - -> name:string - -> ?notifications:reporting_descriptor list - -> ?organization:string - -> ?product:string - -> ?product_suite:string - -> ?properties:property_bag - -> ?release_date_utc:string - -> ?rules:reporting_descriptor list - -> ?semantic_version:string - -> ?short_description:multiformat_message_string - -> ?supported_taxonomies:tool_component_reference list - -> ?taxa:reporting_descriptor list - -> ?translation_metadata:translation_metadata - -> ?version:string - -> unit - -> tool_component - -(** Validate a value of type {!type:tool_component}. *) -val validate_tool_component - : Atdgen_runtime.Util.Validation.path - -> tool_component - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:tool}. *) -val create_tool - : driver:tool_component - -> ?extensions:tool_component list - -> ?properties:property_bag - -> unit - -> tool - -(** Validate a value of type {!type:tool}. *) -val validate_tool - : Atdgen_runtime.Util.Validation.path - -> tool - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:web_request}. *) -val create_web_request - : ?body:artifact_content - -> ?headers:hm_str_str - -> ?index:int64 - -> ?method_:string - -> ?parameters:hm_str_str - -> ?properties:property_bag - -> ?protocol:string - -> ?target:string - -> ?version:string - -> unit - -> web_request - -(** Validate a value of type {!type:web_request}. *) -val validate_web_request - : Atdgen_runtime.Util.Validation.path - -> web_request - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:web_response}. *) -val create_web_response - : ?body:artifact_content - -> ?headers:hm_str_str - -> ?index:int64 - -> ?no_response_received:bool - -> ?properties:property_bag - -> ?protocol:string - -> ?reason_phrase:string - -> ?status_code:string - -> ?version:string - -> unit - -> web_response - -(** Validate a value of type {!type:web_response}. *) -val validate_web_response - : Atdgen_runtime.Util.Validation.path - -> web_response - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:thread_flow_location}. *) -val create_thread_flow_location - : ?execution_order:int64 - -> ?execution_time_utc:string - -> ?importance:thread_flow_location_importance - -> ?index:int64 - -> ?kinds:string list - -> ?location:location - -> ?module_:string - -> ?nesting_level:int64 - -> ?properties:property_bag - -> ?stack:stack - -> ?state:hm_str_mms - -> ?taxa:reporting_descriptor_reference list - -> ?web_request:web_request - -> ?web_response:web_response - -> unit - -> thread_flow_location - -(** Validate a value of type {!type:thread_flow_location}. *) -val validate_thread_flow_location - : Atdgen_runtime.Util.Validation.path - -> thread_flow_location - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:thread_flow}. *) -val create_thread_flow - : ?id:string - -> ?immutable_state:hm_str_mms - -> ?initial_state:hm_str_mms - -> locations:thread_flow_location list - -> ?message:message - -> ?properties:property_bag - -> unit - -> thread_flow - -(** Validate a value of type {!type:thread_flow}. *) -val validate_thread_flow - : Atdgen_runtime.Util.Validation.path - -> thread_flow - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:code_flow}. *) -val create_code_flow - : ?message:message - -> ?properties:property_bag - -> thread_flows:thread_flow list - -> unit - -> code_flow - -(** Validate a value of type {!type:code_flow}. *) -val validate_code_flow - : Atdgen_runtime.Util.Validation.path - -> code_flow - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:node}. *) -val create_node - : ?children:node list - -> id:string - -> ?label:message - -> ?location:location - -> ?properties:property_bag - -> unit - -> node - -(** Validate a value of type {!type:node}. *) -val validate_node - : Atdgen_runtime.Util.Validation.path - -> node - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:exception_}. *) -val create_exception_ - : ?inner_exceptions:exception_ list - -> ?kind:string - -> ?message:string - -> ?properties:property_bag - -> ?stack:stack - -> unit - -> exception_ - -(** Validate a value of type {!type:exception_}. *) -val validate_exception_ - : Atdgen_runtime.Util.Validation.path - -> exception_ - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:graph}. *) -val create_graph - : ?description:message - -> ?edges:edge list - -> ?nodes:node list - -> ?properties:property_bag - -> unit - -> graph - -(** Validate a value of type {!type:graph}. *) -val validate_graph - : Atdgen_runtime.Util.Validation.path - -> graph - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:result}. *) -val create_result - : ?analysis_target:artifact_location - -> ?attachments:attachment list - -> ?baseline_state:result_baseline_state - -> ?code_flows:code_flow list - -> ?correlation_guid:result_correlation_guid - -> ?fingerprints:hm_str_str - -> ?fixes:fix list - -> ?graph_traversals:graph_traversal list - -> ?graphs:graph list - -> ?guid:result_guid - -> ?hosted_viewer_uri:string - -> ?kind:result_kind - -> ?level:result_level - -> ?locations:location list - -> message:message - -> ?occurrence_count:int64 - -> ?partial_fingerprints:hm_str_str - -> ?properties:property_bag - -> ?provenance:result_provenance - -> ?rank:int64 - -> ?related_locations:location list - -> ?rule:reporting_descriptor_reference - -> ?rule_id:string - -> ?rule_index:int64 - -> ?stacks:stack list - -> ?suppressions:suppression list - -> ?taxa:reporting_descriptor_reference list - -> ?web_request:web_request - -> ?web_response:web_response - -> ?work_item_uris:string list - -> unit - -> result - -(** Validate a value of type {!type:result}. *) -val validate_result - : Atdgen_runtime.Util.Validation.path - -> result - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:notification}. *) -val create_notification - : ?associated_rule:reporting_descriptor_reference - -> ?descriptor:reporting_descriptor_reference - -> ?exception_:exception_ - -> ?level:notification_level - -> ?locations:location list - -> message:message - -> ?properties:property_bag - -> ?thread_id:int64 - -> ?time_utc:string - -> unit - -> notification - -(** Validate a value of type {!type:notification}. *) -val validate_notification - : Atdgen_runtime.Util.Validation.path - -> notification - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:invocation}. *) -val create_invocation - : ?account:string - -> ?arguments:string - -> ?command_line:string - -> ?end_time_utc:string - -> ?environment_variables:hm_str_str - -> ?executable_location:artifact_location - -> execution_successful:bool - -> ?exit_code:int64 - -> ?exit_code_description:string - -> ?exit_signal_name:string - -> ?exit_signal_number:int64 - -> ?notification_configuration_overrides:configuration_override list - -> ?process_id:int64 - -> ?process_start_failure_message:string - -> ?properties:property_bag - -> ?response_files:artifact_location list - -> ?rule_configuration_overrides:configuration_override list - -> ?start_time_utc:string - -> ?stderr:artifact_location - -> ?stdin:artifact_location - -> ?stdout:artifact_location - -> ?stdout_stderr:artifact_location - -> ?tool_configuration_notifications:notification list - -> ?tool_execution_notifications:notification list - -> ?working_directory:artifact_location - -> unit - -> invocation - -(** Validate a value of type {!type:invocation}. *) -val validate_invocation - : Atdgen_runtime.Util.Validation.path - -> invocation - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:conversion}. *) -val create_conversion - : ?analysis_tool_log_files:artifact_location list - -> ?invocation:invocation - -> ?properties:property_bag - -> tool:tool - -> unit - -> conversion - -(** Validate a value of type {!type:conversion}. *) -val validate_conversion - : Atdgen_runtime.Util.Validation.path - -> conversion - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:artifact}. *) -val create_artifact - : ?contents:artifact_content - -> ?description:message - -> ?encoding:string - -> ?hashes:hm_str_str - -> ?last_modified_time_utc:string - -> ?length:int64 - -> ?location:artifact_location - -> ?mime_type:artifact_mimetype - -> ?offset:int64 - -> ?parent_index:int64 - -> ?properties:external_properties - -> ?roles:artifact_roles_item list - -> ?source_language:string - -> unit - -> artifact - -(** Validate a value of type {!type:artifact}. *) -val validate_artifact - : Atdgen_runtime.Util.Validation.path - -> artifact - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:external_properties}. *) -val create_external_properties - : ?addresses:address list - -> ?artifacts:artifact list - -> ?conversion:conversion - -> ?driver:tool_component - -> ?extensions:tool_component list - -> ?externalized_properties:property_bag - -> ?graph:graph list - -> ?guid:external_properties_guid - -> ?invocations:invocation - -> ?logical_locations:logical_location list - -> ?policies:tool_component list - -> ?properties:property_bag - -> ?results:result - -> ?run_guid:external_properties_run_guid - -> ?schema:string - -> ?taxonomies:tool_component list - -> ?thread_flow_locations:thread_flow_location list - -> ?translations:tool_component list - -> ?version:external_properties_version - -> ?web_requests:web_request list - -> ?web_responses:web_response list - -> unit - -> external_properties - -(** Validate a value of type {!type:external_properties}. *) -val validate_external_properties - : Atdgen_runtime.Util.Validation.path - -> external_properties - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:version_control_details}. *) -val create_version_control_details - : ?as_of_time_utc:string - -> ?branch:string - -> ?mapped_to:artifact_location - -> ?properties:property_bag - -> repository_uri:string - -> ?revision_id:string - -> ?revision_tag:string - -> unit - -> version_control_details - -(** Validate a value of type {!type:version_control_details}. *) -val validate_version_control_details - : Atdgen_runtime.Util.Validation.path - -> version_control_details - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:special_locations}. *) -val create_special_locations - : ?display_base:artifact_location - -> ?properties:property_bag - -> unit - -> special_locations - -(** Validate a value of type {!type:special_locations}. *) -val validate_special_locations - : Atdgen_runtime.Util.Validation.path - -> special_locations - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:sarif_version}. *) -val validate_sarif_version - : Atdgen_runtime.Util.Validation.path - -> sarif_version - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:run_language}. *) -val validate_run_language - : Atdgen_runtime.Util.Validation.path - -> run_language - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:run_column_kind}. *) -val validate_run_column_kind - : Atdgen_runtime.Util.Validation.path - -> run_column_kind - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:run_baseline_guid}. *) -val validate_run_baseline_guid - : Atdgen_runtime.Util.Validation.path - -> run_baseline_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:run_automation_details_guid}. *) -val validate_run_automation_details_guid - : Atdgen_runtime.Util.Validation.path - -> run_automation_details_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:run_automation_details_correlation_guid}. *) -val validate_run_automation_details_correlation_guid - : Atdgen_runtime.Util.Validation.path - -> run_automation_details_correlation_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:run_automation_details}. *) -val create_run_automation_details - : ?correlation_guid:run_automation_details_correlation_guid - -> ?description:message - -> ?guid:run_automation_details_guid - -> ?id:string - -> ?properties:property_bag - -> unit - -> run_automation_details - -(** Validate a value of type {!type:run_automation_details}. *) -val validate_run_automation_details - : Atdgen_runtime.Util.Validation.path - -> run_automation_details - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:hm_str_al}. *) -val validate_hm_str_al - : Atdgen_runtime.Util.Validation.path - -> hm_str_al - -> Atdgen_runtime.Util.Validation.error option - -(** Validate a value of type {!type:external_property_file_reference_guid}. *) -val validate_external_property_file_reference_guid - : Atdgen_runtime.Util.Validation.path - -> external_property_file_reference_guid - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:external_property_file_reference}. *) -val create_external_property_file_reference - : ?guid:external_property_file_reference_guid - -> ?item_count:int64 - -> ?location:artifact_location - -> ?properties:property_bag - -> unit - -> external_property_file_reference - -(** Validate a value of type {!type:external_property_file_reference}. *) -val validate_external_property_file_reference - : Atdgen_runtime.Util.Validation.path - -> external_property_file_reference - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:external_property_file_references}. *) -val create_external_property_file_references - : ?addresses:external_property_file_reference list - -> ?artifacts:external_property_file_reference list - -> ?conversion:external_property_file_reference - -> ?driver:external_property_file_reference - -> ?extensions:external_property_file_reference list - -> ?externalized_properties:external_property_file_reference - -> ?graphs:external_property_file_reference list - -> ?invocations:external_property_file_reference list - -> ?logical_locations:external_property_file_reference list - -> ?policies:external_property_file_reference list - -> ?properties:property_bag - -> ?results:external_property_file_reference list - -> ?taxonomies:external_property_file_reference list - -> ?thread_flow_locations:external_property_file_reference list - -> ?translations:external_property_file_reference list - -> ?web_requests:external_property_file_reference list - -> ?web_responses:external_property_file_reference list - -> unit - -> external_property_file_references - -(** Validate a value of type {!type:external_property_file_references}. *) -val validate_external_property_file_references - : Atdgen_runtime.Util.Validation.path - -> external_property_file_references - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:run}. *) -val create_run - : ?addresses:address list - -> ?artifacts:artifact list - -> ?automation_details:run_automation_details - -> ?baseline_guid:run_baseline_guid - -> ?column_kind:run_column_kind - -> ?conversion:conversion - -> ?default_encoding:string - -> ?default_source_language:string - -> ?external_property_file_references:external_property_file_references - -> ?graphs:graph list - -> ?invocations:invocation list - -> ?language:run_language - -> ?logical_locations:logical_location list - -> ?newline_sequences:string list - -> ?original_uri_base_ids:hm_str_al - -> ?policies:tool_component list - -> ?properties:property_bag - -> ?redaction_tokens:string list - -> ?results:result list - -> ?run_aggregates:run_automation_details list - -> ?special_locations:special_locations - -> ?taxonomies:tool_component list - -> ?thread_flow_locations:thread_flow_location list - -> tool:tool - -> ?translations:tool_component list - -> ?version_control_provenance:version_control_details list - -> ?web_requests:web_request list - -> ?web_responses:web_response list - -> unit - -> run - -(** Validate a value of type {!type:run}. *) -val validate_run - : Atdgen_runtime.Util.Validation.path - -> run - -> Atdgen_runtime.Util.Validation.error option - -(** Create a record of type {!type:sarif_json_schema}. *) -val create_sarif_json_schema - : version:sarif_version - -> ?inline_external_properties:external_properties list - -> ?properties:property_bag - -> runs:run list - -> ?schema:string - -> unit - -> sarif_json_schema - -(** Validate a value of type {!type:sarif_json_schema}. *) -val validate_sarif_json_schema - : Atdgen_runtime.Util.Validation.path - -> sarif_json_schema - -> Atdgen_runtime.Util.Validation.error option + the like) is identical for all aggregated files. + *); + translations: tool_component list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + version_control_provenance: version_control_details list option + (** + Specifies the revision in version control of the artifacts that were + scanned. + *); + web_requests: web_request list option + (** An array of request objects cached at run level. *); + web_responses: web_response list option + (** An array of response objects cached at run level. *) +} + [@@deriving show,eq] + +(** + Core type: Static Analysis Results Format (SARIF) Version 2.1.0 JSON + Schema: a standard format for the output of static analysis tools. +*) +type sarif_json_schema = Sarif_v_2_1_0_t.sarif_json_schema = { + version: sarif_version (** The SARIF format version of this log file. *); + inline_external_properties: external_properties list option + (** + References to external property files that share data between runs. + *); + properties: property_bag option + (** + Key/value pairs that provide additional information about the log file. + *); + runs: run list (** The set of runs contained in this log file. *); + schema: string option + (** The URI of the JSON schema corresponding to the version. *) +} + [@@deriving show,eq] + +val validate_artifact_mimetype : + Atdgen_runtime.Util.Validation.path -> artifact_mimetype -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact_mimetype}. *) + +val validate_artifact_roles_item : + Atdgen_runtime.Util.Validation.path -> artifact_roles_item -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact_roles_item}. *) + +val validate_external_properties_guid : + Atdgen_runtime.Util.Validation.path -> external_properties_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_properties_guid}. *) + +val validate_external_properties_run_guid : + Atdgen_runtime.Util.Validation.path -> external_properties_run_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_properties_run_guid}. *) + +val validate_external_properties_version : + Atdgen_runtime.Util.Validation.path -> external_properties_version -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_properties_version}. *) + +val validate_hm_str_str : + Atdgen_runtime.Util.Validation.path -> hm_str_str -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:hm_str_str}. *) + +val validate_int64 : + Atdgen_runtime.Util.Validation.path -> int64 -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:int64}. *) + +val validate_notification_level : + Atdgen_runtime.Util.Validation.path -> notification_level -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:notification_level}. *) + +val validate_property_bag : + Atdgen_runtime.Util.Validation.path -> property_bag -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:property_bag}. *) + +val create_address : + ?absolute_address: int64 -> + ?fully_qualified_name: string -> + ?index: int64 -> + ?kind: string -> + ?length: int64 -> + ?name: string -> + ?offset_from_parent: int64 -> + ?parent_index: int64 -> + ?properties: property_bag -> + ?relative_address: int64 -> + unit -> address + (** Create a record of type {!type:address}. *) + +val validate_address : + Atdgen_runtime.Util.Validation.path -> address -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:address}. *) + +val create_logical_location : + ?decorated_name: string -> + ?fully_qualified_name: string -> + ?index: int64 -> + ?kind: string -> + ?name: string -> + ?parent_index: int64 -> + ?properties: property_bag -> + unit -> logical_location + (** Create a record of type {!type:logical_location}. *) + +val validate_logical_location : + Atdgen_runtime.Util.Validation.path -> logical_location -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:logical_location}. *) + +val create_message : + ?arguments: string list -> + ?id: string -> + ?markdown: string -> + ?properties: property_bag -> + ?text: string -> + unit -> message + (** Create a record of type {!type:message}. *) + +val validate_message : + Atdgen_runtime.Util.Validation.path -> message -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:message}. *) + +val create_artifact_location : + ?description: message -> + ?index: int64 -> + ?properties: property_bag -> + ?uri: string -> + ?uri_base_id: string -> + unit -> artifact_location + (** Create a record of type {!type:artifact_location}. *) + +val validate_artifact_location : + Atdgen_runtime.Util.Validation.path -> artifact_location -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact_location}. *) + +val create_edge : + id: string -> + ?label: message -> + ?properties: property_bag -> + source_node_id: string -> + target_node_id: string -> + unit -> edge + (** Create a record of type {!type:edge}. *) + +val validate_edge : + Atdgen_runtime.Util.Validation.path -> edge -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:edge}. *) + +val create_location_relationship : + ?description: message -> + ?kinds: string list -> + ?properties: property_bag -> + target: int64 -> + unit -> location_relationship + (** Create a record of type {!type:location_relationship}. *) + +val validate_location_relationship : + Atdgen_runtime.Util.Validation.path -> location_relationship -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:location_relationship}. *) + +val create_multiformat_message_string : + ?markdown: string -> + ?properties: property_bag -> + text: string -> + unit -> multiformat_message_string + (** Create a record of type {!type:multiformat_message_string}. *) + +val validate_multiformat_message_string : + Atdgen_runtime.Util.Validation.path -> multiformat_message_string -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:multiformat_message_string}. *) + +val create_artifact_content : + ?binary: string -> + ?properties: property_bag -> + ?rendered: multiformat_message_string -> + ?text: string -> + unit -> artifact_content + (** Create a record of type {!type:artifact_content}. *) + +val validate_artifact_content : + Atdgen_runtime.Util.Validation.path -> artifact_content -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact_content}. *) + +val validate_hm_str_mms : + Atdgen_runtime.Util.Validation.path -> hm_str_mms -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:hm_str_mms}. *) + +val create_edge_traversal : + edge_id: string -> + ?final_state: hm_str_mms -> + ?message: message -> + ?properties: property_bag -> + ?step_over_edge_count: int64 -> + unit -> edge_traversal + (** Create a record of type {!type:edge_traversal}. *) + +val validate_edge_traversal : + Atdgen_runtime.Util.Validation.path -> edge_traversal -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:edge_traversal}. *) + +val create_graph_traversal_variant0 : + ?description: message -> + ?edge_traversals: edge_traversal list -> + ?immutable_state: hm_str_mms -> + ?initial_state: hm_str_mms -> + ?properties: property_bag -> + ?result_graph_index: int64 -> + ?run_graph_index: int64 -> + unit -> graph_traversal_variant0 + (** Create a record of type {!type:graph_traversal_variant0}. *) + +val validate_graph_traversal_variant0 : + Atdgen_runtime.Util.Validation.path -> graph_traversal_variant0 -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:graph_traversal_variant0}. *) + +val create_graph_traversal_variant1 : + ?description: message -> + ?edge_traversals: edge_traversal list -> + ?immutable_state: hm_str_mms -> + ?initial_state: hm_str_mms -> + ?properties: property_bag -> + ?result_graph_index: int64 -> + ?run_graph_index: int64 -> + unit -> graph_traversal_variant1 + (** Create a record of type {!type:graph_traversal_variant1}. *) + +val validate_graph_traversal_variant1 : + Atdgen_runtime.Util.Validation.path -> graph_traversal_variant1 -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:graph_traversal_variant1}. *) + +val validate_graph_traversal : + Atdgen_runtime.Util.Validation.path -> graph_traversal -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:graph_traversal}. *) + +val create_rectangle : + ?bottom: float -> + ?left: float -> + ?message: message -> + ?properties: property_bag -> + ?right: float -> + ?top: float -> + unit -> rectangle + (** Create a record of type {!type:rectangle}. *) + +val validate_rectangle : + Atdgen_runtime.Util.Validation.path -> rectangle -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:rectangle}. *) + +val create_region : + ?byte_length: int64 -> + ?byte_offset: int64 -> + ?char_length: int64 -> + ?char_offset: int64 -> + ?end_column: int64 -> + ?end_line: int64 -> + ?message: message -> + ?properties: property_bag -> + ?snippet: artifact_content -> + ?source_language: string -> + ?start_column: int64 -> + ?start_line: int64 -> + unit -> region + (** Create a record of type {!type:region}. *) + +val validate_region : + Atdgen_runtime.Util.Validation.path -> region -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:region}. *) + +val create_attachment : + artifact_location: artifact_location -> + ?description: message -> + ?properties: property_bag -> + ?rectangles: rectangle list -> + ?regions: region list -> + unit -> attachment + (** Create a record of type {!type:attachment}. *) + +val validate_attachment : + Atdgen_runtime.Util.Validation.path -> attachment -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:attachment}. *) + +val create_physical_location : + ?address: address -> + ?artifact_location: artifact_location -> + ?context_region: region -> + ?properties: property_bag -> + ?region: region -> + unit -> physical_location + (** Create a record of type {!type:physical_location}. *) + +val validate_physical_location : + Atdgen_runtime.Util.Validation.path -> physical_location -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:physical_location}. *) + +val create_location : + ?annotations: region list -> + ?id: int64 -> + ?logical_locations: logical_location list -> + ?message: message -> + ?physical_location: physical_location -> + ?properties: property_bag -> + ?relationships: location_relationship list -> + unit -> location + (** Create a record of type {!type:location}. *) + +val validate_location : + Atdgen_runtime.Util.Validation.path -> location -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:location}. *) + +val create_replacement : + deleted_region: region -> + ?inserted_content: artifact_content -> + ?properties: property_bag -> + unit -> replacement + (** Create a record of type {!type:replacement}. *) + +val validate_replacement : + Atdgen_runtime.Util.Validation.path -> replacement -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:replacement}. *) + +val create_artifact_change : + artifact_location: artifact_location -> + ?properties: property_bag -> + replacements: replacement list -> + unit -> artifact_change + (** Create a record of type {!type:artifact_change}. *) + +val validate_artifact_change : + Atdgen_runtime.Util.Validation.path -> artifact_change -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact_change}. *) + +val create_fix : + artifact_changes: artifact_change list -> + ?description: message -> + ?properties: property_bag -> + unit -> fix + (** Create a record of type {!type:fix}. *) + +val validate_fix : + Atdgen_runtime.Util.Validation.path -> fix -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:fix}. *) + +val validate_reporting_configuration_level : + Atdgen_runtime.Util.Validation.path -> reporting_configuration_level -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_configuration_level}. *) + +val create_reporting_configuration : + ?enabled: bool -> + ?level: reporting_configuration_level -> + ?parameters: property_bag -> + ?properties: property_bag -> + ?rank: int64 -> + unit -> reporting_configuration + (** Create a record of type {!type:reporting_configuration}. *) + +val validate_reporting_configuration : + Atdgen_runtime.Util.Validation.path -> reporting_configuration -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_configuration}. *) + +val validate_reporting_descriptor_deprecated_guids_item : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor_deprecated_guids_item -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor_deprecated_guids_item}. *) + +val validate_reporting_descriptor_guid : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor_guid}. *) + +val validate_reporting_descriptor_reference_guid : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor_reference_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor_reference_guid}. *) + +val validate_result_baseline_state : + Atdgen_runtime.Util.Validation.path -> result_baseline_state -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_baseline_state}. *) + +val validate_result_correlation_guid : + Atdgen_runtime.Util.Validation.path -> result_correlation_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_correlation_guid}. *) + +val validate_result_guid : + Atdgen_runtime.Util.Validation.path -> result_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_guid}. *) + +val validate_result_kind : + Atdgen_runtime.Util.Validation.path -> result_kind -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_kind}. *) + +val validate_result_level : + Atdgen_runtime.Util.Validation.path -> result_level -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_level}. *) + +val validate_result_provenance_first_detection_run_guid : + Atdgen_runtime.Util.Validation.path -> result_provenance_first_detection_run_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_provenance_first_detection_run_guid}. *) + +val validate_result_provenance_last_detection_run_guid : + Atdgen_runtime.Util.Validation.path -> result_provenance_last_detection_run_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_provenance_last_detection_run_guid}. *) + +val create_result_provenance : + ?conversion_sources: physical_location list -> + ?first_detection_run_guid: result_provenance_first_detection_run_guid -> + ?first_detection_time_utc: string -> + ?invocation_index: int64 -> + ?last_detection_run_guid: result_provenance_last_detection_run_guid -> + ?last_detection_time_utc: string -> + ?properties: property_bag -> + unit -> result_provenance + (** Create a record of type {!type:result_provenance}. *) + +val validate_result_provenance : + Atdgen_runtime.Util.Validation.path -> result_provenance -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result_provenance}. *) + +val create_stack_frame : + ?location: location -> + ?module_: string -> + ?parameters: string list -> + ?properties: property_bag -> + ?thread_id: int64 -> + unit -> stack_frame + (** Create a record of type {!type:stack_frame}. *) + +val validate_stack_frame : + Atdgen_runtime.Util.Validation.path -> stack_frame -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:stack_frame}. *) + +val create_stack : + frames: stack_frame list -> + ?message: message -> + ?properties: property_bag -> + unit -> stack + (** Create a record of type {!type:stack}. *) + +val validate_stack : + Atdgen_runtime.Util.Validation.path -> stack -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:stack}. *) + +val validate_suppression_guid : + Atdgen_runtime.Util.Validation.path -> suppression_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:suppression_guid}. *) + +val validate_suppression_kind : + Atdgen_runtime.Util.Validation.path -> suppression_kind -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:suppression_kind}. *) + +val validate_suppression_status : + Atdgen_runtime.Util.Validation.path -> suppression_status -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:suppression_status}. *) + +val create_suppression : + ?guid: suppression_guid -> + ?justification: string -> + kind: suppression_kind -> + ?location: location -> + ?properties: property_bag -> + ?status: suppression_status -> + unit -> suppression + (** Create a record of type {!type:suppression}. *) + +val validate_suppression : + Atdgen_runtime.Util.Validation.path -> suppression -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:suppression}. *) + +val validate_thread_flow_location_importance : + Atdgen_runtime.Util.Validation.path -> thread_flow_location_importance -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:thread_flow_location_importance}. *) + +val validate_tool_component_contents_item : + Atdgen_runtime.Util.Validation.path -> tool_component_contents_item -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_contents_item}. *) + +val validate_tool_component_dotted_quad_file_version : + Atdgen_runtime.Util.Validation.path -> tool_component_dotted_quad_file_version -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_dotted_quad_file_version}. *) + +val validate_tool_component_guid : + Atdgen_runtime.Util.Validation.path -> tool_component_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_guid}. *) + +val validate_tool_component_language : + Atdgen_runtime.Util.Validation.path -> tool_component_language -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_language}. *) + +val validate_tool_component_reference_guid : + Atdgen_runtime.Util.Validation.path -> tool_component_reference_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_reference_guid}. *) + +val create_tool_component_reference : + ?guid: tool_component_reference_guid -> + ?index: int64 -> + ?name: string -> + ?properties: property_bag -> + unit -> tool_component_reference + (** Create a record of type {!type:tool_component_reference}. *) + +val validate_tool_component_reference : + Atdgen_runtime.Util.Validation.path -> tool_component_reference -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component_reference}. *) + +val create_reporting_descriptor_reference : + ?guid: reporting_descriptor_reference_guid -> + ?id: string -> + ?index: int64 -> + ?properties: property_bag -> + ?tool_component: tool_component_reference -> + unit -> reporting_descriptor_reference + (** Create a record of type {!type:reporting_descriptor_reference}. *) + +val validate_reporting_descriptor_reference : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor_reference -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor_reference}. *) + +val create_configuration_override : + configuration: reporting_configuration -> + descriptor: reporting_descriptor_reference -> + ?properties: property_bag -> + unit -> configuration_override + (** Create a record of type {!type:configuration_override}. *) + +val validate_configuration_override : + Atdgen_runtime.Util.Validation.path -> configuration_override -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:configuration_override}. *) + +val create_reporting_descriptor_relationship : + ?description: message -> + ?kinds: string list -> + ?properties: property_bag -> + target: reporting_descriptor_reference -> + unit -> reporting_descriptor_relationship + (** Create a record of type {!type:reporting_descriptor_relationship}. *) + +val validate_reporting_descriptor_relationship : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor_relationship -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor_relationship}. *) + +val create_reporting_descriptor : + ?default_configuration: reporting_configuration -> + ?deprecated_guids: reporting_descriptor_deprecated_guids_item list -> + ?deprecated_ids: string list -> + ?deprecated_names: string list -> + ?full_description: multiformat_message_string -> + ?guid: reporting_descriptor_guid -> + ?help: multiformat_message_string -> + ?help_uri: string -> + id: string -> + ?message_strings: hm_str_mms -> + ?name: string -> + ?properties: property_bag -> + ?relationships: reporting_descriptor_relationship list -> + ?short_description: multiformat_message_string -> + unit -> reporting_descriptor + (** Create a record of type {!type:reporting_descriptor}. *) + +val validate_reporting_descriptor : + Atdgen_runtime.Util.Validation.path -> reporting_descriptor -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:reporting_descriptor}. *) + +val create_translation_metadata : + ?download_uri: string -> + ?full_description: multiformat_message_string -> + ?full_name: string -> + ?information_uri: string -> + name: string -> + ?properties: property_bag -> + ?short_description: multiformat_message_string -> + unit -> translation_metadata + (** Create a record of type {!type:translation_metadata}. *) + +val validate_translation_metadata : + Atdgen_runtime.Util.Validation.path -> translation_metadata -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:translation_metadata}. *) + +val create_tool_component : + ?associated_component: tool_component_reference -> + ?contents: tool_component_contents_item list -> + ?dotted_quad_file_version: tool_component_dotted_quad_file_version -> + ?download_uri: string -> + ?full_description: multiformat_message_string -> + ?full_name: string -> + ?global_message_strings: hm_str_mms -> + ?guid: tool_component_guid -> + ?information_uri: string -> + ?is_comprehensive: bool -> + ?language: tool_component_language -> + ?localized_data_semantic_version: string -> + ?locations: artifact_location list -> + ?minimum_required_localized_data_semantic_version: string -> + name: string -> + ?notifications: reporting_descriptor list -> + ?organization: string -> + ?product: string -> + ?product_suite: string -> + ?properties: property_bag -> + ?release_date_utc: string -> + ?rules: reporting_descriptor list -> + ?semantic_version: string -> + ?short_description: multiformat_message_string -> + ?supported_taxonomies: tool_component_reference list -> + ?taxa: reporting_descriptor list -> + ?translation_metadata: translation_metadata -> + ?version: string -> + unit -> tool_component + (** Create a record of type {!type:tool_component}. *) + +val validate_tool_component : + Atdgen_runtime.Util.Validation.path -> tool_component -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool_component}. *) + +val create_tool : + driver: tool_component -> + ?extensions: tool_component list -> + ?properties: property_bag -> + unit -> tool + (** Create a record of type {!type:tool}. *) + +val validate_tool : + Atdgen_runtime.Util.Validation.path -> tool -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:tool}. *) + +val create_web_request : + ?body: artifact_content -> + ?headers: hm_str_str -> + ?index: int64 -> + ?method_: string -> + ?parameters: hm_str_str -> + ?properties: property_bag -> + ?protocol: string -> + ?target: string -> + ?version: string -> + unit -> web_request + (** Create a record of type {!type:web_request}. *) + +val validate_web_request : + Atdgen_runtime.Util.Validation.path -> web_request -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:web_request}. *) + +val create_web_response : + ?body: artifact_content -> + ?headers: hm_str_str -> + ?index: int64 -> + ?no_response_received: bool -> + ?properties: property_bag -> + ?protocol: string -> + ?reason_phrase: string -> + ?status_code: string -> + ?version: string -> + unit -> web_response + (** Create a record of type {!type:web_response}. *) + +val validate_web_response : + Atdgen_runtime.Util.Validation.path -> web_response -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:web_response}. *) + +val create_thread_flow_location : + ?execution_order: int64 -> + ?execution_time_utc: string -> + ?importance: thread_flow_location_importance -> + ?index: int64 -> + ?kinds: string list -> + ?location: location -> + ?module_: string -> + ?nesting_level: int64 -> + ?properties: property_bag -> + ?stack: stack -> + ?state: hm_str_mms -> + ?taxa: reporting_descriptor_reference list -> + ?web_request: web_request -> + ?web_response: web_response -> + unit -> thread_flow_location + (** Create a record of type {!type:thread_flow_location}. *) + +val validate_thread_flow_location : + Atdgen_runtime.Util.Validation.path -> thread_flow_location -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:thread_flow_location}. *) + +val create_thread_flow : + ?id: string -> + ?immutable_state: hm_str_mms -> + ?initial_state: hm_str_mms -> + locations: thread_flow_location list -> + ?message: message -> + ?properties: property_bag -> + unit -> thread_flow + (** Create a record of type {!type:thread_flow}. *) + +val validate_thread_flow : + Atdgen_runtime.Util.Validation.path -> thread_flow -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:thread_flow}. *) + +val create_code_flow : + ?message: message -> + ?properties: property_bag -> + thread_flows: thread_flow list -> + unit -> code_flow + (** Create a record of type {!type:code_flow}. *) + +val validate_code_flow : + Atdgen_runtime.Util.Validation.path -> code_flow -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:code_flow}. *) + +val create_node : + ?children: node list -> + id: string -> + ?label: message -> + ?location: location -> + ?properties: property_bag -> + unit -> node + (** Create a record of type {!type:node}. *) + +val validate_node : + Atdgen_runtime.Util.Validation.path -> node -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:node}. *) + +val create_exception_ : + ?inner_exceptions: exception_ list -> + ?kind: string -> + ?message: string -> + ?properties: property_bag -> + ?stack: stack -> + unit -> exception_ + (** Create a record of type {!type:exception_}. *) + +val validate_exception_ : + Atdgen_runtime.Util.Validation.path -> exception_ -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:exception_}. *) + +val create_graph : + ?description: message -> + ?edges: edge list -> + ?nodes: node list -> + ?properties: property_bag -> + unit -> graph + (** Create a record of type {!type:graph}. *) + +val validate_graph : + Atdgen_runtime.Util.Validation.path -> graph -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:graph}. *) + +val create_result : + ?analysis_target: artifact_location -> + ?attachments: attachment list -> + ?baseline_state: result_baseline_state -> + ?code_flows: code_flow list -> + ?correlation_guid: result_correlation_guid -> + ?fingerprints: hm_str_str -> + ?fixes: fix list -> + ?graph_traversals: graph_traversal list -> + ?graphs: graph list -> + ?guid: result_guid -> + ?hosted_viewer_uri: string -> + ?kind: result_kind -> + ?level: result_level -> + ?locations: location list -> + message: message -> + ?occurrence_count: int64 -> + ?partial_fingerprints: hm_str_str -> + ?properties: property_bag -> + ?provenance: result_provenance -> + ?rank: int64 -> + ?related_locations: location list -> + ?rule: reporting_descriptor_reference -> + ?rule_id: string -> + ?rule_index: int64 -> + ?stacks: stack list -> + ?suppressions: suppression list -> + ?taxa: reporting_descriptor_reference list -> + ?web_request: web_request -> + ?web_response: web_response -> + ?work_item_uris: string list -> + unit -> result + (** Create a record of type {!type:result}. *) + +val validate_result : + Atdgen_runtime.Util.Validation.path -> result -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:result}. *) + +val create_notification : + ?associated_rule: reporting_descriptor_reference -> + ?descriptor: reporting_descriptor_reference -> + ?exception_: exception_ -> + ?level: notification_level -> + ?locations: location list -> + message: message -> + ?properties: property_bag -> + ?thread_id: int64 -> + ?time_utc: string -> + unit -> notification + (** Create a record of type {!type:notification}. *) + +val validate_notification : + Atdgen_runtime.Util.Validation.path -> notification -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:notification}. *) + +val create_invocation : + ?account: string -> + ?arguments: string -> + ?command_line: string -> + ?end_time_utc: string -> + ?environment_variables: hm_str_str -> + ?executable_location: artifact_location -> + execution_successful: bool -> + ?exit_code: int64 -> + ?exit_code_description: string -> + ?exit_signal_name: string -> + ?exit_signal_number: int64 -> + ?notification_configuration_overrides: configuration_override list -> + ?process_id: int64 -> + ?process_start_failure_message: string -> + ?properties: property_bag -> + ?response_files: artifact_location list -> + ?rule_configuration_overrides: configuration_override list -> + ?start_time_utc: string -> + ?stderr: artifact_location -> + ?stdin: artifact_location -> + ?stdout: artifact_location -> + ?stdout_stderr: artifact_location -> + ?tool_configuration_notifications: notification list -> + ?tool_execution_notifications: notification list -> + ?working_directory: artifact_location -> + unit -> invocation + (** Create a record of type {!type:invocation}. *) + +val validate_invocation : + Atdgen_runtime.Util.Validation.path -> invocation -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:invocation}. *) + +val create_conversion : + ?analysis_tool_log_files: artifact_location list -> + ?invocation: invocation -> + ?properties: property_bag -> + tool: tool -> + unit -> conversion + (** Create a record of type {!type:conversion}. *) + +val validate_conversion : + Atdgen_runtime.Util.Validation.path -> conversion -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:conversion}. *) + +val create_artifact : + ?contents: artifact_content -> + ?description: message -> + ?encoding: string -> + ?hashes: hm_str_str -> + ?last_modified_time_utc: string -> + ?length: int64 -> + ?location: artifact_location -> + ?mime_type: artifact_mimetype -> + ?offset: int64 -> + ?parent_index: int64 -> + ?properties: external_properties -> + ?roles: artifact_roles_item list -> + ?source_language: string -> + unit -> artifact + (** Create a record of type {!type:artifact}. *) + +val validate_artifact : + Atdgen_runtime.Util.Validation.path -> artifact -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:artifact}. *) + +val create_external_properties : + ?addresses: address list -> + ?artifacts: artifact list -> + ?conversion: conversion -> + ?driver: tool_component -> + ?extensions: tool_component list -> + ?externalized_properties: property_bag -> + ?graph: graph list -> + ?guid: external_properties_guid -> + ?invocations: invocation -> + ?logical_locations: logical_location list -> + ?policies: tool_component list -> + ?properties: property_bag -> + ?results: result -> + ?run_guid: external_properties_run_guid -> + ?schema: string -> + ?taxonomies: tool_component list -> + ?thread_flow_locations: thread_flow_location list -> + ?translations: tool_component list -> + ?version: external_properties_version -> + ?web_requests: web_request list -> + ?web_responses: web_response list -> + unit -> external_properties + (** Create a record of type {!type:external_properties}. *) + +val validate_external_properties : + Atdgen_runtime.Util.Validation.path -> external_properties -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_properties}. *) + +val create_version_control_details : + ?as_of_time_utc: string -> + ?branch: string -> + ?mapped_to: artifact_location -> + ?properties: property_bag -> + repository_uri: string -> + ?revision_id: string -> + ?revision_tag: string -> + unit -> version_control_details + (** Create a record of type {!type:version_control_details}. *) + +val validate_version_control_details : + Atdgen_runtime.Util.Validation.path -> version_control_details -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:version_control_details}. *) + +val create_special_locations : + ?display_base: artifact_location -> + ?properties: property_bag -> + unit -> special_locations + (** Create a record of type {!type:special_locations}. *) + +val validate_special_locations : + Atdgen_runtime.Util.Validation.path -> special_locations -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:special_locations}. *) + +val validate_sarif_version : + Atdgen_runtime.Util.Validation.path -> sarif_version -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:sarif_version}. *) + +val validate_run_language : + Atdgen_runtime.Util.Validation.path -> run_language -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_language}. *) + +val validate_run_column_kind : + Atdgen_runtime.Util.Validation.path -> run_column_kind -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_column_kind}. *) + +val validate_run_baseline_guid : + Atdgen_runtime.Util.Validation.path -> run_baseline_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_baseline_guid}. *) + +val validate_run_automation_details_guid : + Atdgen_runtime.Util.Validation.path -> run_automation_details_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_automation_details_guid}. *) + +val validate_run_automation_details_correlation_guid : + Atdgen_runtime.Util.Validation.path -> run_automation_details_correlation_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_automation_details_correlation_guid}. *) + +val create_run_automation_details : + ?correlation_guid: run_automation_details_correlation_guid -> + ?description: message -> + ?guid: run_automation_details_guid -> + ?id: string -> + ?properties: property_bag -> + unit -> run_automation_details + (** Create a record of type {!type:run_automation_details}. *) + +val validate_run_automation_details : + Atdgen_runtime.Util.Validation.path -> run_automation_details -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run_automation_details}. *) + +val validate_hm_str_al : + Atdgen_runtime.Util.Validation.path -> hm_str_al -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:hm_str_al}. *) + +val validate_external_property_file_reference_guid : + Atdgen_runtime.Util.Validation.path -> external_property_file_reference_guid -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_property_file_reference_guid}. *) + +val create_external_property_file_reference : + ?guid: external_property_file_reference_guid -> + ?item_count: int64 -> + ?location: artifact_location -> + ?properties: property_bag -> + unit -> external_property_file_reference + (** Create a record of type {!type:external_property_file_reference}. *) + +val validate_external_property_file_reference : + Atdgen_runtime.Util.Validation.path -> external_property_file_reference -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_property_file_reference}. *) + +val create_external_property_file_references : + ?addresses: external_property_file_reference list -> + ?artifacts: external_property_file_reference list -> + ?conversion: external_property_file_reference -> + ?driver: external_property_file_reference -> + ?extensions: external_property_file_reference list -> + ?externalized_properties: external_property_file_reference -> + ?graphs: external_property_file_reference list -> + ?invocations: external_property_file_reference list -> + ?logical_locations: external_property_file_reference list -> + ?policies: external_property_file_reference list -> + ?properties: property_bag -> + ?results: external_property_file_reference list -> + ?taxonomies: external_property_file_reference list -> + ?thread_flow_locations: external_property_file_reference list -> + ?translations: external_property_file_reference list -> + ?web_requests: external_property_file_reference list -> + ?web_responses: external_property_file_reference list -> + unit -> external_property_file_references + (** Create a record of type {!type:external_property_file_references}. *) + +val validate_external_property_file_references : + Atdgen_runtime.Util.Validation.path -> external_property_file_references -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:external_property_file_references}. *) + +val create_run : + ?addresses: address list -> + ?artifacts: artifact list -> + ?automation_details: run_automation_details -> + ?baseline_guid: run_baseline_guid -> + ?column_kind: run_column_kind -> + ?conversion: conversion -> + ?default_encoding: string -> + ?default_source_language: string -> + ?external_property_file_references: external_property_file_references -> + ?graphs: graph list -> + ?invocations: invocation list -> + ?language: run_language -> + ?logical_locations: logical_location list -> + ?newline_sequences: string list -> + ?original_uri_base_ids: hm_str_al -> + ?policies: tool_component list -> + ?properties: property_bag -> + ?redaction_tokens: string list -> + ?results: result list -> + ?run_aggregates: run_automation_details list -> + ?special_locations: special_locations -> + ?taxonomies: tool_component list -> + ?thread_flow_locations: thread_flow_location list -> + tool: tool -> + ?translations: tool_component list -> + ?version_control_provenance: version_control_details list -> + ?web_requests: web_request list -> + ?web_responses: web_response list -> + unit -> run + (** Create a record of type {!type:run}. *) + +val validate_run : + Atdgen_runtime.Util.Validation.path -> run -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:run}. *) + +val create_sarif_json_schema : + version: sarif_version -> + ?inline_external_properties: external_properties list -> + ?properties: property_bag -> + runs: run list -> + ?schema: string -> + unit -> sarif_json_schema + (** Create a record of type {!type:sarif_json_schema}. *) + +val validate_sarif_json_schema : + Atdgen_runtime.Util.Validation.path -> sarif_json_schema -> Atdgen_runtime.Util.Validation.error option + (** Validate a value of type {!type:sarif_json_schema}. *) + diff --git a/sarif.opam b/sarif.opam index 2e257fd..5218d5b 100644 --- a/sarif.opam +++ b/sarif.opam @@ -15,7 +15,7 @@ depends: [ "dune" {>= "3.12"} "re" "atdgen" {>= "2.10.0"} - "atdgen-runtime" {>= "2.10.0"} + "atdgen-runtime" {>= "2.12.0"} "timedesc" "ppx_expect" {with-test} "ppx_deriving"