diff --git a/semgrep_output_v1.atd b/semgrep_output_v1.atd index 65cdd2b..db65e76 100644 --- a/semgrep_output_v1.atd +++ b/semgrep_output_v1.atd @@ -2197,8 +2197,8 @@ type core_output = { do not necessarily want to share with the cli_output. *) type core_output_extra = { - (* since semgrep 1.108.0 *) - ?symbol_analysis: symbol_analysis option; + (* since semgrep 1.128.0 *) + ?ungrouped_symbol_analysis: ungrouped_symbol_analysis option; } (* TODO: now only core_match_extra differ, otherwise it's just like cli_match *) @@ -2770,7 +2770,16 @@ type symbol_usage = { locs: location list; } -type symbol_analysis = symbol_usage list +type ungrouped_symbol_analysis = symbol_usage list + +type subproject_symbol_analysis = { + subproject_root_dir: fpath; + symbol_analysis: symbol_usage list; +} + + +type symbol_analysis = subproject_symbol_analysis list + (* ----------------------------- *) (* The call *) diff --git a/semgrep_output_v1.jsonschema b/semgrep_output_v1.jsonschema index 1c8bd48..ae9969e 100644 --- a/semgrep_output_v1.jsonschema +++ b/semgrep_output_v1.jsonschema @@ -1899,14 +1899,18 @@ "type": "array", "items": { "$ref": "#/definitions/cli_output_subproject_info" } }, - "symbol_analysis": { "$ref": "#/definitions/symbol_analysis" } + "ungrouped_symbol_analysis": { + "$ref": "#/definitions/ungrouped_symbol_analysis" + } } }, "core_output_extra": { "type": "object", "required": [], "properties": { - "symbol_analysis": { "$ref": "#/definitions/symbol_analysis" } + "ungrouped_symbol_analysis": { + "$ref": "#/definitions/ungrouped_symbol_analysis" + } } }, "core_match": { @@ -2537,10 +2541,25 @@ } } }, - "symbol_analysis": { + "ungrouped_symbol_analysis": { "type": "array", "items": { "$ref": "#/definitions/symbol_usage" } }, + "subproject_symbol_analysis": { + "type": "object", + "required": [ "subproject_root_dir", "symbol_analysis" ], + "properties": { + "subproject_root_dir": { "$ref": "#/definitions/fpath" }, + "symbol_analysis": { + "type": "array", + "items": { "$ref": "#/definitions/symbol_usage" } + } + } + }, + "symbol_analysis": { + "type": "array", + "items": { "$ref": "#/definitions/subproject_symbol_analysis" } + }, "function_call": { "oneOf": [ { "const": "CallContributions" }, diff --git a/semgrep_output_v1.proto b/semgrep_output_v1.proto index 003f4de..4b01173 100644 --- a/semgrep_output_v1.proto +++ b/semgrep_output_v1.proto @@ -1,6 +1,6 @@ // Generated by jsonschema2protobuf. DO NOT EDIT! // Source file: semgrep_output_v1.jsonschema -// Source file sha256 digest: d4c897d4ec731ebfe30409b6b0308b7bc1510bdd3471e0bc6219019dc1b0889c +// Source file sha256 digest: 12c1844bd7d9b7b4d3cf9bc9d33cdd7e3e8a3cef42ec73f7ae84a3c3d71e1002 syntax = "proto3"; @@ -744,11 +744,11 @@ message CoreOutput { repeated string interfile_languages_used = 314311072; repeated SkippedRule skipped_rules = 55568936; repeated CliOutputSubprojectInfo subprojects = 475733982; - repeated SymbolUsage symbol_analysis = 299212646; + repeated SymbolUsage ungrouped_symbol_analysis = 228099713; } message CoreOutputExtra { - repeated SymbolUsage symbol_analysis = 299212646; + repeated SymbolUsage ungrouped_symbol_analysis = 228099713; } message CoreMatch { @@ -919,6 +919,11 @@ message SymbolUsage { repeated Location locs = 3524653; } +message SubprojectSymbolAnalysis { + string subproject_root_dir = 324806749; + repeated SymbolUsage symbol_analysis = 299212646; +} + message DiffFile { string filename = 228703562; repeated string diffs = 109344974; diff --git a/semgrep_output_v1.py b/semgrep_output_v1.py index afbd621..b0c7a97 100644 --- a/semgrep_output_v1.py +++ b/semgrep_output_v1.py @@ -4575,6 +4575,86 @@ def to_json_string(self, **kw: Any) -> str: return json.dumps(self.to_json(), **kw) +@dataclass +class Symbol: + """Original type: symbol = { ... }""" + + fqn: List[str] + + @classmethod + def from_json(cls, x: Any) -> 'Symbol': + if isinstance(x, dict): + return cls( + fqn=_atd_read_list(_atd_read_string)(x['fqn']) if 'fqn' in x else _atd_missing_json_field('Symbol', 'fqn'), + ) + else: + _atd_bad_json('Symbol', x) + + def to_json(self) -> Any: + res: Dict[str, Any] = {} + res['fqn'] = _atd_write_list(_atd_write_string)(self.fqn) + return res + + @classmethod + def from_json_string(cls, x: str) -> 'Symbol': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class SymbolUsage: + """Original type: symbol_usage = { ... }""" + + symbol: Symbol + locs: List[Location] + + @classmethod + def from_json(cls, x: Any) -> 'SymbolUsage': + if isinstance(x, dict): + return cls( + symbol=Symbol.from_json(x['symbol']) if 'symbol' in x else _atd_missing_json_field('SymbolUsage', 'symbol'), + locs=_atd_read_list(Location.from_json)(x['locs']) if 'locs' in x else _atd_missing_json_field('SymbolUsage', 'locs'), + ) + else: + _atd_bad_json('SymbolUsage', x) + + def to_json(self) -> Any: + res: Dict[str, Any] = {} + res['symbol'] = (lambda x: x.to_json())(self.symbol) + res['locs'] = _atd_write_list((lambda x: x.to_json()))(self.locs) + return res + + @classmethod + def from_json_string(cls, x: str) -> 'SymbolUsage': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + +@dataclass +class UngroupedSymbolAnalysis: + """Original type: ungrouped_symbol_analysis""" + + value: List[SymbolUsage] + + @classmethod + def from_json(cls, x: Any) -> 'UngroupedSymbolAnalysis': + return cls(_atd_read_list(SymbolUsage.from_json)(x)) + + def to_json(self) -> Any: + return _atd_write_list((lambda x: x.to_json()))(self.value) + + @classmethod + def from_json_string(cls, x: str) -> 'UngroupedSymbolAnalysis': + return cls.from_json(json.loads(x)) + + def to_json_string(self, **kw: Any) -> str: + return json.dumps(self.to_json(), **kw) + + @dataclass class Snippet: """Original type: snippet = { ... }""" @@ -7352,58 +7432,27 @@ def to_json_string(self, **kw: Any) -> str: @dataclass -class Symbol: - """Original type: symbol = { ... }""" - - fqn: List[str] - - @classmethod - def from_json(cls, x: Any) -> 'Symbol': - if isinstance(x, dict): - return cls( - fqn=_atd_read_list(_atd_read_string)(x['fqn']) if 'fqn' in x else _atd_missing_json_field('Symbol', 'fqn'), - ) - else: - _atd_bad_json('Symbol', x) - - def to_json(self) -> Any: - res: Dict[str, Any] = {} - res['fqn'] = _atd_write_list(_atd_write_string)(self.fqn) - return res - - @classmethod - def from_json_string(cls, x: str) -> 'Symbol': - return cls.from_json(json.loads(x)) - - def to_json_string(self, **kw: Any) -> str: - return json.dumps(self.to_json(), **kw) - - -@dataclass -class SymbolUsage: - """Original type: symbol_usage = { ... }""" +class SymbolAnalysisUploadResponse: + """Original type: symbol_analysis_upload_response = { ... }""" - symbol: Symbol - locs: List[Location] + upload_url: Uri @classmethod - def from_json(cls, x: Any) -> 'SymbolUsage': + def from_json(cls, x: Any) -> 'SymbolAnalysisUploadResponse': if isinstance(x, dict): return cls( - symbol=Symbol.from_json(x['symbol']) if 'symbol' in x else _atd_missing_json_field('SymbolUsage', 'symbol'), - locs=_atd_read_list(Location.from_json)(x['locs']) if 'locs' in x else _atd_missing_json_field('SymbolUsage', 'locs'), + upload_url=Uri.from_json(x['upload_url']) if 'upload_url' in x else _atd_missing_json_field('SymbolAnalysisUploadResponse', 'upload_url'), ) else: - _atd_bad_json('SymbolUsage', x) + _atd_bad_json('SymbolAnalysisUploadResponse', x) def to_json(self) -> Any: res: Dict[str, Any] = {} - res['symbol'] = (lambda x: x.to_json())(self.symbol) - res['locs'] = _atd_write_list((lambda x: x.to_json()))(self.locs) + res['upload_url'] = (lambda x: x.to_json())(self.upload_url) return res @classmethod - def from_json_string(cls, x: str) -> 'SymbolUsage': + def from_json_string(cls, x: str) -> 'SymbolAnalysisUploadResponse': return cls.from_json(json.loads(x)) def to_json_string(self, **kw: Any) -> str: @@ -7411,27 +7460,30 @@ def to_json_string(self, **kw: Any) -> str: @dataclass -class SymbolAnalysisUploadResponse: - """Original type: symbol_analysis_upload_response = { ... }""" +class SubprojectSymbolAnalysis: + """Original type: subproject_symbol_analysis = { ... }""" - upload_url: Uri + subproject_root_dir: Fpath + symbol_analysis: List[SymbolUsage] @classmethod - def from_json(cls, x: Any) -> 'SymbolAnalysisUploadResponse': + def from_json(cls, x: Any) -> 'SubprojectSymbolAnalysis': if isinstance(x, dict): return cls( - upload_url=Uri.from_json(x['upload_url']) if 'upload_url' in x else _atd_missing_json_field('SymbolAnalysisUploadResponse', 'upload_url'), + subproject_root_dir=Fpath.from_json(x['subproject_root_dir']) if 'subproject_root_dir' in x else _atd_missing_json_field('SubprojectSymbolAnalysis', 'subproject_root_dir'), + symbol_analysis=_atd_read_list(SymbolUsage.from_json)(x['symbol_analysis']) if 'symbol_analysis' in x else _atd_missing_json_field('SubprojectSymbolAnalysis', 'symbol_analysis'), ) else: - _atd_bad_json('SymbolAnalysisUploadResponse', x) + _atd_bad_json('SubprojectSymbolAnalysis', x) def to_json(self) -> Any: res: Dict[str, Any] = {} - res['upload_url'] = (lambda x: x.to_json())(self.upload_url) + res['subproject_root_dir'] = (lambda x: x.to_json())(self.subproject_root_dir) + res['symbol_analysis'] = _atd_write_list((lambda x: x.to_json()))(self.symbol_analysis) return res @classmethod - def from_json_string(cls, x: str) -> 'SymbolAnalysisUploadResponse': + def from_json_string(cls, x: str) -> 'SubprojectSymbolAnalysis': return cls.from_json(json.loads(x)) def to_json_string(self, **kw: Any) -> str: @@ -7442,11 +7494,11 @@ def to_json_string(self, **kw: Any) -> str: class SymbolAnalysis: """Original type: symbol_analysis""" - value: List[SymbolUsage] + value: List[SubprojectSymbolAnalysis] @classmethod def from_json(cls, x: Any) -> 'SymbolAnalysis': - return cls(_atd_read_list(SymbolUsage.from_json)(x)) + return cls(_atd_read_list(SubprojectSymbolAnalysis.from_json)(x)) def to_json(self) -> Any: return _atd_write_list((lambda x: x.to_json()))(self.value) @@ -11075,21 +11127,21 @@ def to_json_string(self, **kw: Any) -> str: class CoreOutputExtra: """Original type: core_output_extra = { ... }""" - symbol_analysis: Optional[SymbolAnalysis] = None + ungrouped_symbol_analysis: Optional[UngroupedSymbolAnalysis] = None @classmethod def from_json(cls, x: Any) -> 'CoreOutputExtra': if isinstance(x, dict): return cls( - symbol_analysis=SymbolAnalysis.from_json(x['symbol_analysis']) if 'symbol_analysis' in x else None, + ungrouped_symbol_analysis=UngroupedSymbolAnalysis.from_json(x['ungrouped_symbol_analysis']) if 'ungrouped_symbol_analysis' in x else None, ) else: _atd_bad_json('CoreOutputExtra', x) def to_json(self) -> Any: res: Dict[str, Any] = {} - if self.symbol_analysis is not None: - res['symbol_analysis'] = (lambda x: x.to_json())(self.symbol_analysis) + if self.ungrouped_symbol_analysis is not None: + res['ungrouped_symbol_analysis'] = (lambda x: x.to_json())(self.ungrouped_symbol_analysis) return res @classmethod @@ -11115,7 +11167,7 @@ class CoreOutput: interfile_languages_used: Optional[List[str]] = None skipped_rules: List[SkippedRule] = field(default_factory=lambda: []) subprojects: Optional[List[CliOutputSubprojectInfo]] = None - symbol_analysis: Optional[SymbolAnalysis] = None + ungrouped_symbol_analysis: Optional[UngroupedSymbolAnalysis] = None @classmethod def from_json(cls, x: Any) -> 'CoreOutput': @@ -11132,7 +11184,7 @@ def from_json(cls, x: Any) -> 'CoreOutput': interfile_languages_used=_atd_read_list(_atd_read_string)(x['interfile_languages_used']) if 'interfile_languages_used' in x else None, skipped_rules=_atd_read_list(SkippedRule.from_json)(x['skipped_rules']) if 'skipped_rules' in x else [], subprojects=_atd_read_list(CliOutputSubprojectInfo.from_json)(x['subprojects']) if 'subprojects' in x else None, - symbol_analysis=SymbolAnalysis.from_json(x['symbol_analysis']) if 'symbol_analysis' in x else None, + ungrouped_symbol_analysis=UngroupedSymbolAnalysis.from_json(x['ungrouped_symbol_analysis']) if 'ungrouped_symbol_analysis' in x else None, ) else: _atd_bad_json('CoreOutput', x) @@ -11156,8 +11208,8 @@ def to_json(self) -> Any: res['skipped_rules'] = _atd_write_list((lambda x: x.to_json()))(self.skipped_rules) if self.subprojects is not None: res['subprojects'] = _atd_write_list((lambda x: x.to_json()))(self.subprojects) - if self.symbol_analysis is not None: - res['symbol_analysis'] = (lambda x: x.to_json())(self.symbol_analysis) + if self.ungrouped_symbol_analysis is not None: + res['ungrouped_symbol_analysis'] = (lambda x: x.to_json())(self.ungrouped_symbol_analysis) return res @classmethod diff --git a/semgrep_output_v1.ts b/semgrep_output_v1.ts index 8b7524c..9a0f611 100644 --- a/semgrep_output_v1.ts +++ b/semgrep_output_v1.ts @@ -974,11 +974,11 @@ export type CoreOutput = { interfile_languages_used?: string[]; skipped_rules: SkippedRule[]; subprojects?: CliOutputSubprojectInfo[]; - symbol_analysis?: SymbolAnalysis; + ungrouped_symbol_analysis?: UngroupedSymbolAnalysis; } export type CoreOutputExtra = { - symbol_analysis?: SymbolAnalysis; + ungrouped_symbol_analysis?: UngroupedSymbolAnalysis; } export type CoreMatch = { @@ -1251,7 +1251,14 @@ export type SymbolUsage = { locs: Location[]; } -export type SymbolAnalysis = SymbolUsage[] +export type UngroupedSymbolAnalysis = SymbolUsage[] + +export type SubprojectSymbolAnalysis = { + subproject_root_dir: Fpath; + symbol_analysis: SymbolUsage[]; +} + +export type SymbolAnalysis = SubprojectSymbolAnalysis[] export type FunctionCall = | { kind: 'CallContributions' } @@ -4195,7 +4202,7 @@ export function writeCoreOutput(x: CoreOutput, context: any = x): any { 'interfile_languages_used': _atd_write_optional_field(_atd_write_array(_atd_write_string), x.interfile_languages_used, x), 'skipped_rules': _atd_write_field_with_default(_atd_write_array(writeSkippedRule), [], x.skipped_rules, x), 'subprojects': _atd_write_optional_field(_atd_write_array(writeCliOutputSubprojectInfo), x.subprojects, x), - 'symbol_analysis': _atd_write_optional_field(writeSymbolAnalysis, x.symbol_analysis, x), + 'ungrouped_symbol_analysis': _atd_write_optional_field(writeUngroupedSymbolAnalysis, x.ungrouped_symbol_analysis, x), }; } @@ -4212,19 +4219,19 @@ export function readCoreOutput(x: any, context: any = x): CoreOutput { interfile_languages_used: _atd_read_optional_field(_atd_read_array(_atd_read_string), x['interfile_languages_used'], x), skipped_rules: _atd_read_field_with_default(_atd_read_array(readSkippedRule), [], x['skipped_rules'], x), subprojects: _atd_read_optional_field(_atd_read_array(readCliOutputSubprojectInfo), x['subprojects'], x), - symbol_analysis: _atd_read_optional_field(readSymbolAnalysis, x['symbol_analysis'], x), + ungrouped_symbol_analysis: _atd_read_optional_field(readUngroupedSymbolAnalysis, x['ungrouped_symbol_analysis'], x), }; } export function writeCoreOutputExtra(x: CoreOutputExtra, context: any = x): any { return { - 'symbol_analysis': _atd_write_optional_field(writeSymbolAnalysis, x.symbol_analysis, x), + 'ungrouped_symbol_analysis': _atd_write_optional_field(writeUngroupedSymbolAnalysis, x.ungrouped_symbol_analysis, x), }; } export function readCoreOutputExtra(x: any, context: any = x): CoreOutputExtra { return { - symbol_analysis: _atd_read_optional_field(readSymbolAnalysis, x['symbol_analysis'], x), + ungrouped_symbol_analysis: _atd_read_optional_field(readUngroupedSymbolAnalysis, x['ungrouped_symbol_analysis'], x), }; } @@ -5147,14 +5154,36 @@ export function readSymbolUsage(x: any, context: any = x): SymbolUsage { }; } -export function writeSymbolAnalysis(x: SymbolAnalysis, context: any = x): any { +export function writeUngroupedSymbolAnalysis(x: UngroupedSymbolAnalysis, context: any = x): any { return _atd_write_array(writeSymbolUsage)(x, context); } -export function readSymbolAnalysis(x: any, context: any = x): SymbolAnalysis { +export function readUngroupedSymbolAnalysis(x: any, context: any = x): UngroupedSymbolAnalysis { return _atd_read_array(readSymbolUsage)(x, context); } +export function writeSubprojectSymbolAnalysis(x: SubprojectSymbolAnalysis, context: any = x): any { + return { + 'subproject_root_dir': _atd_write_required_field('SubprojectSymbolAnalysis', 'subproject_root_dir', writeFpath, x.subproject_root_dir, x), + 'symbol_analysis': _atd_write_required_field('SubprojectSymbolAnalysis', 'symbol_analysis', _atd_write_array(writeSymbolUsage), x.symbol_analysis, x), + }; +} + +export function readSubprojectSymbolAnalysis(x: any, context: any = x): SubprojectSymbolAnalysis { + return { + subproject_root_dir: _atd_read_required_field('SubprojectSymbolAnalysis', 'subproject_root_dir', readFpath, x['subproject_root_dir'], x), + symbol_analysis: _atd_read_required_field('SubprojectSymbolAnalysis', 'symbol_analysis', _atd_read_array(readSymbolUsage), x['symbol_analysis'], x), + }; +} + +export function writeSymbolAnalysis(x: SymbolAnalysis, context: any = x): any { + return _atd_write_array(writeSubprojectSymbolAnalysis)(x, context); +} + +export function readSymbolAnalysis(x: any, context: any = x): SymbolAnalysis { + return _atd_read_array(readSubprojectSymbolAnalysis)(x, context); +} + export function writeFunctionCall(x: FunctionCall, context: any = x): any { switch (x.kind) { case 'CallContributions': diff --git a/semgrep_output_v1_j.ml b/semgrep_output_v1_j.ml index f2f5145..49cda60 100644 --- a/semgrep_output_v1_j.ml +++ b/semgrep_output_v1_j.ml @@ -356,6 +356,19 @@ type unresolved_subproject = Semgrep_output_v1_t.unresolved_subproject = { errors: sca_error list } +type symbol = Semgrep_output_v1_t.symbol = { fqn: string list } + [@@deriving show] + +type symbol_usage = Semgrep_output_v1_t.symbol_usage = { + symbol: symbol; + locs: location list +} + [@@deriving show] + +type ungrouped_symbol_analysis = + Semgrep_output_v1_t.ungrouped_symbol_analysis + [@@deriving show] + type snippet = Semgrep_output_v1_t.snippet = { line: int; text: string } type killing_parent_kind = Semgrep_output_v1_t.killing_parent_kind @@ -625,20 +638,18 @@ type tainting_time = Semgrep_output_v1_t.tainting_time = { type tag = Semgrep_output_v1_t.tag -type symbol = Semgrep_output_v1_t.symbol = { fqn: string list } - [@@deriving show] - -type symbol_usage = Semgrep_output_v1_t.symbol_usage = { - symbol: symbol; - locs: location list -} - [@@deriving show] - type symbol_analysis_upload_response = Semgrep_output_v1_t.symbol_analysis_upload_response = { upload_url: uri } +type subproject_symbol_analysis = + Semgrep_output_v1_t.subproject_symbol_analysis = { + subproject_root_dir: fpath; + symbol_analysis: symbol_usage list +} + [@@deriving show] + type symbol_analysis = Semgrep_output_v1_t.symbol_analysis [@@deriving show] type resolution_method = Semgrep_output_v1_t.resolution_method @@ -1153,7 +1164,7 @@ type deployment_response = Semgrep_output_v1_t.deployment_response = { } type core_output_extra = Semgrep_output_v1_t.core_output_extra = { - symbol_analysis: symbol_analysis option + ungrouped_symbol_analysis: ungrouped_symbol_analysis option } type core_output = Semgrep_output_v1_t.core_output = { @@ -1168,7 +1179,7 @@ type core_output = Semgrep_output_v1_t.core_output = { interfile_languages_used: string list option; skipped_rules: skipped_rule list; subprojects: cli_output_subproject_info list option; - symbol_analysis: symbol_analysis option + ungrouped_symbol_analysis: ungrouped_symbol_analysis option } type cli_output_extra = Semgrep_output_v1_t.cli_output_extra = { @@ -12708,6 +12719,301 @@ let read_unresolved_subproject = ( ) let unresolved_subproject_of_string s = read_unresolved_subproject (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_symbol : _ -> symbol -> _ = ( + fun ob (x : symbol) -> + 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 "\"fqn\":"; + ( + write__string_list + ) + ob x.fqn; + Buffer.add_char ob '}'; +) +let string_of_symbol ?(len = 1024) x = + let ob = Buffer.create len in + write_symbol ob x; + Buffer.contents ob +let read_symbol = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_fqn = ref (None) in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end 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); + if len = 3 && String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'q' && String.unsafe_get s (pos+2) = 'n' then ( + 0 + ) + else ( + -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_fqn := ( + 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); + if len = 3 && String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'q' && String.unsafe_get s (pos+2) = 'n' then ( + 0 + ) + else ( + -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_fqn := ( + Some ( + ( + read__string_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + fqn = (match !field_fqn with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "fqn"); + } + : symbol) + ) +) +let symbol_of_string s = + read_symbol (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +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 _location_list_of_string s = + read__location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_symbol_usage : _ -> symbol_usage -> _ = ( + fun ob (x : symbol_usage) -> + 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 "\"symbol\":"; + ( + write_symbol + ) + ob x.symbol; + if !is_first then + is_first := false + else + Buffer.add_char ob ','; + Buffer.add_string ob "\"locs\":"; + ( + write__location_list + ) + ob x.locs; + Buffer.add_char ob '}'; +) +let string_of_symbol_usage ?(len = 1024) x = + let ob = Buffer.create len in + write_symbol_usage ob x; + Buffer.contents ob +let read_symbol_usage = ( + fun p lb -> + Yojson.Safe.read_space p lb; + Yojson.Safe.read_lcurl p lb; + let field_symbol = ref (None) in + let field_locs = ref (None) in + try + Yojson.Safe.read_space p lb; + Yojson.Safe.read_object_end 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 = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' 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_symbol := ( + Some ( + ( + read_symbol + ) p lb + ) + ); + | 1 -> + field_locs := ( + Some ( + ( + read__location_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 = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 's' then ( + 1 + ) + else ( + -1 + ) + ) + | 6 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' 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_symbol := ( + Some ( + ( + read_symbol + ) p lb + ) + ); + | 1 -> + field_locs := ( + Some ( + ( + read__location_list + ) p lb + ) + ); + | _ -> ( + Yojson.Safe.skip_json p lb + ) + ); + done; + assert false; + with Yojson.End_of_object -> ( + ( + { + symbol = (match !field_symbol with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "symbol"); + locs = (match !field_locs with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "locs"); + } + : symbol_usage) + ) +) +let symbol_usage_of_string s = + read_symbol_usage (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__symbol_usage_list = ( + Atdgen_runtime.Oj_run.write_list ( + write_symbol_usage + ) +) +let string_of__symbol_usage_list ?(len = 1024) x = + let ob = Buffer.create len in + write__symbol_usage_list ob x; + Buffer.contents ob +let read__symbol_usage_list = ( + Atdgen_runtime.Oj_run.read_list ( + read_symbol_usage + ) +) +let _symbol_usage_list_of_string s = + read__symbol_usage_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_ungrouped_symbol_analysis = ( + write__symbol_usage_list +) +let string_of_ungrouped_symbol_analysis ?(len = 1024) x = + let ob = Buffer.create len in + write_ungrouped_symbol_analysis ob x; + Buffer.contents ob +let read_ungrouped_symbol_analysis = ( + read__symbol_usage_list +) +let ungrouped_symbol_analysis_of_string s = + read_ungrouped_symbol_analysis (Yojson.Safe.init_lexer ()) (Lexing.from_string s) let write_snippet : _ -> snippet -> _ = ( fun ob (x : snippet) -> Buffer.add_char ob '{'; @@ -19498,22 +19804,6 @@ let read_incompatible_rule = ( ) let incompatible_rule_of_string s = read_incompatible_rule (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -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 _location_list_of_string s = - read__location_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) let write_error_type : _ -> error_type -> _ = ( fun ob (x : error_type) -> match x with @@ -21209,30 +21499,30 @@ let read_tag = ( ) let tag_of_string s = read_tag (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write_symbol : _ -> symbol -> _ = ( - fun ob (x : symbol) -> +let write_symbol_analysis_upload_response : _ -> symbol_analysis_upload_response -> _ = ( + fun ob (x : symbol_analysis_upload_response) -> 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 "\"fqn\":"; + Buffer.add_string ob "\"upload_url\":"; ( - write__string_list + write_uri ) - ob x.fqn; + ob x.upload_url; Buffer.add_char ob '}'; ) -let string_of_symbol ?(len = 1024) x = +let string_of_symbol_analysis_upload_response ?(len = 1024) x = let ob = Buffer.create len in - write_symbol ob x; + write_symbol_analysis_upload_response ob x; Buffer.contents ob -let read_symbol = ( +let read_symbol_analysis_upload_response = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_fqn = ref (None) in + let field_upload_url = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -21241,7 +21531,7 @@ let read_symbol = ( 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); - if len = 3 && String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'q' && String.unsafe_get s (pos+2) = 'n' then ( + if len = 10 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( 0 ) else ( @@ -21253,10 +21543,10 @@ let read_symbol = ( ( match i with | 0 -> - field_fqn := ( + field_upload_url := ( Some ( ( - read__string_list + read_uri ) p lb ) ); @@ -21272,7 +21562,7 @@ let read_symbol = ( 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); - if len = 3 && String.unsafe_get s pos = 'f' && String.unsafe_get s (pos+1) = 'q' && String.unsafe_get s (pos+2) = 'n' then ( + if len = 10 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( 0 ) else ( @@ -21284,10 +21574,10 @@ let read_symbol = ( ( match i with | 0 -> - field_fqn := ( + field_upload_url := ( Some ( ( - read__string_list + read_uri ) p lb ) ); @@ -21300,47 +21590,47 @@ let read_symbol = ( with Yojson.End_of_object -> ( ( { - fqn = (match !field_fqn with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "fqn"); + upload_url = (match !field_upload_url with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "upload_url"); } - : symbol) + : symbol_analysis_upload_response) ) ) -let symbol_of_string s = - read_symbol (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write_symbol_usage : _ -> symbol_usage -> _ = ( - fun ob (x : symbol_usage) -> +let symbol_analysis_upload_response_of_string s = + read_symbol_analysis_upload_response (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write_subproject_symbol_analysis : _ -> subproject_symbol_analysis -> _ = ( + fun ob (x : subproject_symbol_analysis) -> 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 "\"symbol\":"; + Buffer.add_string ob "\"subproject_root_dir\":"; ( - write_symbol + write_fpath ) - ob x.symbol; + ob x.subproject_root_dir; if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"locs\":"; + Buffer.add_string ob "\"symbol_analysis\":"; ( - write__location_list + write__symbol_usage_list ) - ob x.locs; + ob x.symbol_analysis; Buffer.add_char ob '}'; ) -let string_of_symbol_usage ?(len = 1024) x = +let string_of_subproject_symbol_analysis ?(len = 1024) x = let ob = Buffer.create len in - write_symbol_usage ob x; + write_subproject_symbol_analysis ob x; Buffer.contents ob -let read_symbol_usage = ( +let read_subproject_symbol_analysis = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_symbol = ref (None) in - let field_locs = ref (None) in + let field_subproject_root_dir = ref (None) in + let field_symbol_analysis = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -21350,16 +21640,16 @@ let read_symbol_usage = ( 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 = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 's' then ( + | 15 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( 1 ) else ( -1 ) ) - | 6 -> ( - if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' then ( + | 19 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'j' && 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) = '_' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'd' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'r' then ( 0 ) else ( @@ -21375,18 +21665,18 @@ let read_symbol_usage = ( ( match i with | 0 -> - field_symbol := ( + field_subproject_root_dir := ( Some ( ( - read_symbol + read_fpath ) p lb ) ); | 1 -> - field_locs := ( + field_symbol_analysis := ( Some ( ( - read__location_list + read__symbol_usage_list ) p lb ) ); @@ -21403,16 +21693,16 @@ let read_symbol_usage = ( 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 = 'l' && String.unsafe_get s (pos+1) = 'o' && String.unsafe_get s (pos+2) = 'c' && String.unsafe_get s (pos+3) = 's' then ( + | 15 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( 1 ) else ( -1 ) ) - | 6 -> ( - if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' then ( + | 19 -> ( + if String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'u' && String.unsafe_get s (pos+2) = 'b' && String.unsafe_get s (pos+3) = 'p' && String.unsafe_get s (pos+4) = 'r' && String.unsafe_get s (pos+5) = 'o' && String.unsafe_get s (pos+6) = 'j' && 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) = '_' && String.unsafe_get s (pos+11) = 'r' && String.unsafe_get s (pos+12) = 'o' && String.unsafe_get s (pos+13) = 'o' && String.unsafe_get s (pos+14) = 't' && String.unsafe_get s (pos+15) = '_' && String.unsafe_get s (pos+16) = 'd' && String.unsafe_get s (pos+17) = 'i' && String.unsafe_get s (pos+18) = 'r' then ( 0 ) else ( @@ -21428,117 +21718,18 @@ let read_symbol_usage = ( ( match i with | 0 -> - field_symbol := ( + field_subproject_root_dir := ( Some ( ( - read_symbol + read_fpath ) p lb ) ); | 1 -> - field_locs := ( - Some ( - ( - read__location_list - ) p lb - ) - ); - | _ -> ( - Yojson.Safe.skip_json p lb - ) - ); - done; - assert false; - with Yojson.End_of_object -> ( - ( - { - symbol = (match !field_symbol with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "symbol"); - locs = (match !field_locs with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "locs"); - } - : symbol_usage) - ) -) -let symbol_usage_of_string s = - read_symbol_usage (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write_symbol_analysis_upload_response : _ -> symbol_analysis_upload_response -> _ = ( - fun ob (x : symbol_analysis_upload_response) -> - 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 "\"upload_url\":"; - ( - write_uri - ) - ob x.upload_url; - Buffer.add_char ob '}'; -) -let string_of_symbol_analysis_upload_response ?(len = 1024) x = - let ob = Buffer.create len in - write_symbol_analysis_upload_response ob x; - Buffer.contents ob -let read_symbol_analysis_upload_response = ( - fun p lb -> - Yojson.Safe.read_space p lb; - Yojson.Safe.read_lcurl p lb; - let field_upload_url = ref (None) in - try - Yojson.Safe.read_space p lb; - Yojson.Safe.read_object_end 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); - if len = 10 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 0 - ) - else ( - -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_upload_url := ( - Some ( - ( - read_uri - ) 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); - if len = 10 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'p' && String.unsafe_get s (pos+2) = 'l' && String.unsafe_get s (pos+3) = 'o' && String.unsafe_get s (pos+4) = 'a' && String.unsafe_get s (pos+5) = 'd' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'u' && String.unsafe_get s (pos+8) = 'r' && String.unsafe_get s (pos+9) = 'l' then ( - 0 - ) - else ( - -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_upload_url := ( + field_symbol_analysis := ( Some ( ( - read_uri + read__symbol_usage_list ) p lb ) ); @@ -21551,38 +21742,39 @@ let read_symbol_analysis_upload_response = ( with Yojson.End_of_object -> ( ( { - upload_url = (match !field_upload_url with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "upload_url"); + subproject_root_dir = (match !field_subproject_root_dir with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "subproject_root_dir"); + symbol_analysis = (match !field_symbol_analysis with Some x -> x | None -> Atdgen_runtime.Oj_run.missing_field p "symbol_analysis"); } - : symbol_analysis_upload_response) + : subproject_symbol_analysis) ) ) -let symbol_analysis_upload_response_of_string s = - read_symbol_analysis_upload_response (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__symbol_usage_list = ( +let subproject_symbol_analysis_of_string s = + read_subproject_symbol_analysis (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let write__subproject_symbol_analysis_list = ( Atdgen_runtime.Oj_run.write_list ( - write_symbol_usage + write_subproject_symbol_analysis ) ) -let string_of__symbol_usage_list ?(len = 1024) x = +let string_of__subproject_symbol_analysis_list ?(len = 1024) x = let ob = Buffer.create len in - write__symbol_usage_list ob x; + write__subproject_symbol_analysis_list ob x; Buffer.contents ob -let read__symbol_usage_list = ( +let read__subproject_symbol_analysis_list = ( Atdgen_runtime.Oj_run.read_list ( - read_symbol_usage + read_subproject_symbol_analysis ) ) -let _symbol_usage_list_of_string s = - read__symbol_usage_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let _subproject_symbol_analysis_list_of_string s = + read__subproject_symbol_analysis_list (Yojson.Safe.init_lexer ()) (Lexing.from_string s) let write_symbol_analysis = ( - write__symbol_usage_list + write__subproject_symbol_analysis_list ) let string_of_symbol_analysis ?(len = 1024) x = let ob = Buffer.create len in write_symbol_analysis ob x; Buffer.contents ob let read_symbol_analysis = ( - read__symbol_usage_list + read__subproject_symbol_analysis_list ) let symbol_analysis_of_string s = read_symbol_analysis (Yojson.Safe.init_lexer ()) (Lexing.from_string s) @@ -43881,16 +44073,16 @@ let read_deployment_response = ( ) let deployment_response_of_string s = read_deployment_response (Yojson.Safe.init_lexer ()) (Lexing.from_string s) -let write__symbol_analysis_option = ( +let write__ungrouped_symbol_analysis_option = ( Atdgen_runtime.Oj_run.write_std_option ( - write_symbol_analysis + write_ungrouped_symbol_analysis ) ) -let string_of__symbol_analysis_option ?(len = 1024) x = +let string_of__ungrouped_symbol_analysis_option ?(len = 1024) x = let ob = Buffer.create len in - write__symbol_analysis_option ob x; + write__ungrouped_symbol_analysis_option ob x; Buffer.contents ob -let read__symbol_analysis_option = ( +let read__ungrouped_symbol_analysis_option = ( fun p lb -> Yojson.Safe.read_space p lb; match Yojson.Safe.start_any_variant p lb with @@ -43903,7 +44095,7 @@ let read__symbol_analysis_option = ( | "Some" -> Atdgen_runtime.Oj_run.read_until_field_value p lb; let x = ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb in Yojson.Safe.read_space p lb; @@ -43926,7 +44118,7 @@ let read__symbol_analysis_option = ( Yojson.Safe.read_comma p lb; Yojson.Safe.read_space p lb; let x = ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb in Yojson.Safe.read_space p lb; @@ -43936,20 +44128,20 @@ let read__symbol_analysis_option = ( Atdgen_runtime.Oj_run.invalid_variant_tag p x ) ) -let _symbol_analysis_option_of_string s = - read__symbol_analysis_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) +let _ungrouped_symbol_analysis_option_of_string s = + read__ungrouped_symbol_analysis_option (Yojson.Safe.init_lexer ()) (Lexing.from_string s) let write_core_output_extra : _ -> core_output_extra -> _ = ( fun ob (x : core_output_extra) -> Buffer.add_char ob '{'; let is_first = ref true in - (match x.symbol_analysis with None -> () | Some x -> + (match x.ungrouped_symbol_analysis with None -> () | Some x -> if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"symbol_analysis\":"; + Buffer.add_string ob "\"ungrouped_symbol_analysis\":"; ( - write_symbol_analysis + write_ungrouped_symbol_analysis ) ob x; ); @@ -43963,7 +44155,7 @@ let read_core_output_extra = ( fun p lb -> Yojson.Safe.read_space p lb; Yojson.Safe.read_lcurl p lb; - let field_symbol_analysis = ref (None) in + let field_ungrouped_symbol_analysis = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -43972,7 +44164,7 @@ let read_core_output_extra = ( 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); - if len = 15 && String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( + if len = 25 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'a' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'l' && String.unsafe_get s (pos+21) = 'y' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'i' && String.unsafe_get s (pos+24) = 's' then ( 0 ) else ( @@ -43985,10 +44177,10 @@ let read_core_output_extra = ( match i with | 0 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_symbol_analysis := ( + field_ungrouped_symbol_analysis := ( Some ( ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb ) ); @@ -44005,7 +44197,7 @@ let read_core_output_extra = ( 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); - if len = 15 && String.unsafe_get s pos = 's' && String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( + if len = 25 && String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'a' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'l' && String.unsafe_get s (pos+21) = 'y' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'i' && String.unsafe_get s (pos+24) = 's' then ( 0 ) else ( @@ -44018,10 +44210,10 @@ let read_core_output_extra = ( match i with | 0 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_symbol_analysis := ( + field_ungrouped_symbol_analysis := ( Some ( ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb ) ); @@ -44035,7 +44227,7 @@ let read_core_output_extra = ( with Yojson.End_of_object -> ( ( { - symbol_analysis = !field_symbol_analysis; + ungrouped_symbol_analysis = !field_ungrouped_symbol_analysis; } : core_output_extra) ) @@ -44157,14 +44349,14 @@ let write_core_output : _ -> core_output -> _ = ( ) ob x; ); - (match x.symbol_analysis with None -> () | Some x -> + (match x.ungrouped_symbol_analysis with None -> () | Some x -> if !is_first then is_first := false else Buffer.add_char ob ','; - Buffer.add_string ob "\"symbol_analysis\":"; + Buffer.add_string ob "\"ungrouped_symbol_analysis\":"; ( - write_symbol_analysis + write_ungrouped_symbol_analysis ) ob x; ); @@ -44189,7 +44381,7 @@ let read_core_output = ( let field_interfile_languages_used = ref (None) in let field_skipped_rules = ref ([]) in let field_subprojects = ref (None) in - let field_symbol_analysis = ref (None) in + let field_ungrouped_symbol_analysis = ref (None) in try Yojson.Safe.read_space p lb; Yojson.Safe.read_object_end lb; @@ -44270,26 +44462,12 @@ let read_core_output = ( ) ) | 15 -> ( - match String.unsafe_get s pos with - | '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) = 's' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'y' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'e' then ( - 6 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( - 11 - ) - else ( - -1 - ) - ) - | _ -> ( - -1 - ) + 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' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'y' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'e' then ( + 6 + ) + else ( + -1 + ) ) | 16 -> ( if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && 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) = '_' && 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) = 'e' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'd' then ( @@ -44307,6 +44485,14 @@ let read_core_output = ( -1 ) ) + | 25 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'a' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'l' && String.unsafe_get s (pos+21) = 'y' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'i' && String.unsafe_get s (pos+24) = 's' then ( + 11 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -44417,10 +44603,10 @@ let read_core_output = ( ) | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_symbol_analysis := ( + field_ungrouped_symbol_analysis := ( Some ( ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb ) ); @@ -44509,26 +44695,12 @@ let read_core_output = ( ) ) | 15 -> ( - match String.unsafe_get s pos with - | '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) = 's' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'y' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'e' then ( - 6 - ) - else ( - -1 - ) - ) - | 's' -> ( - if String.unsafe_get s (pos+1) = 'y' && String.unsafe_get s (pos+2) = 'm' && String.unsafe_get s (pos+3) = 'b' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'l' && String.unsafe_get s (pos+6) = '_' && String.unsafe_get s (pos+7) = 'a' && String.unsafe_get s (pos+8) = 'n' && String.unsafe_get s (pos+9) = 'a' && String.unsafe_get s (pos+10) = 'l' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 'i' && String.unsafe_get s (pos+14) = 's' then ( - 11 - ) - else ( - -1 - ) - ) - | _ -> ( - -1 - ) + 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' && String.unsafe_get s (pos+5) = '_' && String.unsafe_get s (pos+6) = 'b' && String.unsafe_get s (pos+7) = 'y' && String.unsafe_get s (pos+8) = '_' && String.unsafe_get s (pos+9) = 'e' && String.unsafe_get s (pos+10) = 'n' && String.unsafe_get s (pos+11) = 'g' && String.unsafe_get s (pos+12) = 'i' && String.unsafe_get s (pos+13) = 'n' && String.unsafe_get s (pos+14) = 'e' then ( + 6 + ) + else ( + -1 + ) ) | 16 -> ( if String.unsafe_get s pos = 'e' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && 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) = '_' && 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) = 'e' && String.unsafe_get s (pos+12) = 's' && String.unsafe_get s (pos+13) = 't' && String.unsafe_get s (pos+14) = 'e' && String.unsafe_get s (pos+15) = 'd' then ( @@ -44546,6 +44718,14 @@ let read_core_output = ( -1 ) ) + | 25 -> ( + if String.unsafe_get s pos = 'u' && String.unsafe_get s (pos+1) = 'n' && String.unsafe_get s (pos+2) = 'g' && String.unsafe_get s (pos+3) = 'r' && String.unsafe_get s (pos+4) = 'o' && String.unsafe_get s (pos+5) = 'u' && String.unsafe_get s (pos+6) = 'p' && String.unsafe_get s (pos+7) = 'e' && String.unsafe_get s (pos+8) = 'd' && String.unsafe_get s (pos+9) = '_' && String.unsafe_get s (pos+10) = 's' && String.unsafe_get s (pos+11) = 'y' && String.unsafe_get s (pos+12) = 'm' && String.unsafe_get s (pos+13) = 'b' && String.unsafe_get s (pos+14) = 'o' && String.unsafe_get s (pos+15) = 'l' && String.unsafe_get s (pos+16) = '_' && String.unsafe_get s (pos+17) = 'a' && String.unsafe_get s (pos+18) = 'n' && String.unsafe_get s (pos+19) = 'a' && String.unsafe_get s (pos+20) = 'l' && String.unsafe_get s (pos+21) = 'y' && String.unsafe_get s (pos+22) = 's' && String.unsafe_get s (pos+23) = 'i' && String.unsafe_get s (pos+24) = 's' then ( + 11 + ) + else ( + -1 + ) + ) | _ -> ( -1 ) @@ -44656,10 +44836,10 @@ let read_core_output = ( ) | 11 -> if not (Yojson.Safe.read_null_if_possible p lb) then ( - field_symbol_analysis := ( + field_ungrouped_symbol_analysis := ( Some ( ( - read_symbol_analysis + read_ungrouped_symbol_analysis ) p lb ) ); @@ -44684,7 +44864,7 @@ let read_core_output = ( interfile_languages_used = !field_interfile_languages_used; skipped_rules = !field_skipped_rules; subprojects = !field_subprojects; - symbol_analysis = !field_symbol_analysis; + ungrouped_symbol_analysis = !field_ungrouped_symbol_analysis; } : core_output) ) diff --git a/semgrep_output_v1_j.mli b/semgrep_output_v1_j.mli index 98004a4..72b52f7 100644 --- a/semgrep_output_v1_j.mli +++ b/semgrep_output_v1_j.mli @@ -356,6 +356,19 @@ type unresolved_subproject = Semgrep_output_v1_t.unresolved_subproject = { errors: sca_error list } +type symbol = Semgrep_output_v1_t.symbol = { fqn: string list } + [@@deriving show] + +type symbol_usage = Semgrep_output_v1_t.symbol_usage = { + symbol: symbol; + locs: location list +} + [@@deriving show] + +type ungrouped_symbol_analysis = + Semgrep_output_v1_t.ungrouped_symbol_analysis + [@@deriving show] + type snippet = Semgrep_output_v1_t.snippet = { line: int; text: string } type killing_parent_kind = Semgrep_output_v1_t.killing_parent_kind @@ -625,20 +638,18 @@ type tainting_time = Semgrep_output_v1_t.tainting_time = { type tag = Semgrep_output_v1_t.tag -type symbol = Semgrep_output_v1_t.symbol = { fqn: string list } - [@@deriving show] - -type symbol_usage = Semgrep_output_v1_t.symbol_usage = { - symbol: symbol; - locs: location list -} - [@@deriving show] - type symbol_analysis_upload_response = Semgrep_output_v1_t.symbol_analysis_upload_response = { upload_url: uri } +type subproject_symbol_analysis = + Semgrep_output_v1_t.subproject_symbol_analysis = { + subproject_root_dir: fpath; + symbol_analysis: symbol_usage list +} + [@@deriving show] + type symbol_analysis = Semgrep_output_v1_t.symbol_analysis [@@deriving show] type resolution_method = Semgrep_output_v1_t.resolution_method @@ -1153,7 +1164,7 @@ type deployment_response = Semgrep_output_v1_t.deployment_response = { } type core_output_extra = Semgrep_output_v1_t.core_output_extra = { - symbol_analysis: symbol_analysis option + ungrouped_symbol_analysis: ungrouped_symbol_analysis option } type core_output = Semgrep_output_v1_t.core_output = { @@ -1168,7 +1179,7 @@ type core_output = Semgrep_output_v1_t.core_output = { interfile_languages_used: string list option; skipped_rules: skipped_rule list; subprojects: cli_output_subproject_info list option; - symbol_analysis: symbol_analysis option + ungrouped_symbol_analysis: ungrouped_symbol_analysis option } type cli_output_extra = Semgrep_output_v1_t.cli_output_extra = { @@ -2304,6 +2315,66 @@ val unresolved_subproject_of_string : string -> unresolved_subproject (** Deserialize JSON data of type {!type:unresolved_subproject}. *) +val write_symbol : + Buffer.t -> symbol -> unit + (** Output a JSON value of type {!type:symbol}. *) + +val string_of_symbol : + ?len:int -> symbol -> string + (** Serialize a value of type {!type:symbol} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_symbol : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> symbol + (** Input JSON data of type {!type:symbol}. *) + +val symbol_of_string : + string -> symbol + (** Deserialize JSON data of type {!type:symbol}. *) + +val write_symbol_usage : + Buffer.t -> symbol_usage -> unit + (** Output a JSON value of type {!type:symbol_usage}. *) + +val string_of_symbol_usage : + ?len:int -> symbol_usage -> string + (** Serialize a value of type {!type:symbol_usage} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_symbol_usage : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> symbol_usage + (** Input JSON data of type {!type:symbol_usage}. *) + +val symbol_usage_of_string : + string -> symbol_usage + (** Deserialize JSON data of type {!type:symbol_usage}. *) + +val write_ungrouped_symbol_analysis : + Buffer.t -> ungrouped_symbol_analysis -> unit + (** Output a JSON value of type {!type:ungrouped_symbol_analysis}. *) + +val string_of_ungrouped_symbol_analysis : + ?len:int -> ungrouped_symbol_analysis -> string + (** Serialize a value of type {!type:ungrouped_symbol_analysis} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_ungrouped_symbol_analysis : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> ungrouped_symbol_analysis + (** Input JSON data of type {!type:ungrouped_symbol_analysis}. *) + +val ungrouped_symbol_analysis_of_string : + string -> ungrouped_symbol_analysis + (** Deserialize JSON data of type {!type:ungrouped_symbol_analysis}. *) + val write_snippet : Buffer.t -> snippet -> unit (** Output a JSON value of type {!type:snippet}. *) @@ -3264,46 +3335,6 @@ val tag_of_string : string -> tag (** Deserialize JSON data of type {!type:tag}. *) -val write_symbol : - Buffer.t -> symbol -> unit - (** Output a JSON value of type {!type:symbol}. *) - -val string_of_symbol : - ?len:int -> symbol -> string - (** Serialize a value of type {!type:symbol} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_symbol : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> symbol - (** Input JSON data of type {!type:symbol}. *) - -val symbol_of_string : - string -> symbol - (** Deserialize JSON data of type {!type:symbol}. *) - -val write_symbol_usage : - Buffer.t -> symbol_usage -> unit - (** Output a JSON value of type {!type:symbol_usage}. *) - -val string_of_symbol_usage : - ?len:int -> symbol_usage -> string - (** Serialize a value of type {!type:symbol_usage} - into a JSON string. - @param len specifies the initial length - of the buffer used internally. - Default: 1024. *) - -val read_symbol_usage : - Yojson.Safe.lexer_state -> Lexing.lexbuf -> symbol_usage - (** Input JSON data of type {!type:symbol_usage}. *) - -val symbol_usage_of_string : - string -> symbol_usage - (** Deserialize JSON data of type {!type:symbol_usage}. *) - val write_symbol_analysis_upload_response : Buffer.t -> symbol_analysis_upload_response -> unit (** Output a JSON value of type {!type:symbol_analysis_upload_response}. *) @@ -3324,6 +3355,26 @@ val symbol_analysis_upload_response_of_string : string -> symbol_analysis_upload_response (** Deserialize JSON data of type {!type:symbol_analysis_upload_response}. *) +val write_subproject_symbol_analysis : + Buffer.t -> subproject_symbol_analysis -> unit + (** Output a JSON value of type {!type:subproject_symbol_analysis}. *) + +val string_of_subproject_symbol_analysis : + ?len:int -> subproject_symbol_analysis -> string + (** Serialize a value of type {!type:subproject_symbol_analysis} + into a JSON string. + @param len specifies the initial length + of the buffer used internally. + Default: 1024. *) + +val read_subproject_symbol_analysis : + Yojson.Safe.lexer_state -> Lexing.lexbuf -> subproject_symbol_analysis + (** Input JSON data of type {!type:subproject_symbol_analysis}. *) + +val subproject_symbol_analysis_of_string : + string -> subproject_symbol_analysis + (** Deserialize JSON data of type {!type:subproject_symbol_analysis}. *) + val write_symbol_analysis : Buffer.t -> symbol_analysis -> unit (** Output a JSON value of type {!type:symbol_analysis}. *)