diff options
| author | Florent Revest <revest@chromium.org> | 2026-01-21 15:38:10 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-25 20:14:51 +0000 |
| commit | 02bac03162280236ef7a33993358cb7dcff443d1 (patch) | |
| tree | fd98d9c42a355463260042cffc3379a9f23f17f7 /pkg/codesearch/testdata/source0.c.json | |
| parent | 40acda8acc843b8f5cc068eaad3b6b217e5a9de6 (diff) | |
tools/clang/json: escape strings properly
When preparing a codesearch index, I encountered errors which I narrowed
down to lines like the following in the json output of codesearch:
"type": "void (void __attribute__((btf_type_tag("user")))*, const void *, size_t, size_t)",
After this change, the line gets formatted like this:
"type": "void (void __attribute__((btf_type_tag(\"user\")))*, const void *, size_t, size_t)",
This fixes the errors I encountered
Diffstat (limited to 'pkg/codesearch/testdata/source0.c.json')
| -rw-r--r-- | pkg/codesearch/testdata/source0.c.json | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/pkg/codesearch/testdata/source0.c.json b/pkg/codesearch/testdata/source0.c.json index c2c2de3e4..5d347ae1b 100644 --- a/pkg/codesearch/testdata/source0.c.json +++ b/pkg/codesearch/testdata/source0.c.json @@ -1,16 +1,6 @@ { "definitions": [ { - "name": "some_enum", - "kind": "enum", - "body": { - "file": "source0.h", - "start_line": 45, - "end_line": 48 - }, - "comment": {} - }, - { "name": "close", "type": "int ()", "kind": "function", @@ -90,6 +80,17 @@ ] }, { + "name": "function_with_quotes_in_type", + "type": "void (void __attribute__((btf_type_tag(\"user\")))*)", + "kind": "function", + "body": { + "file": "source0.c", + "start_line": 35, + "end_line": 37 + }, + "comment": {} + }, + { "name": "open", "type": "int ()", "kind": "function", @@ -149,6 +150,26 @@ "comment": {} }, { + "name": "some_union", + "kind": "union", + "body": { + "file": "source0.h", + "start_line": 40, + "end_line": 43 + }, + "comment": {} + }, + { + "name": "some_enum", + "kind": "enum", + "body": { + "file": "source0.h", + "start_line": 45, + "end_line": 48 + }, + "comment": {} + }, + { "name": "another_struct_t", "kind": "typedef", "body": { @@ -187,16 +208,6 @@ "end_line": 34 }, "comment": {} - }, - { - "name": "some_union", - "kind": "union", - "body": { - "file": "source0.h", - "start_line": 40, - "end_line": 43 - }, - "comment": {} } ] }
\ No newline at end of file |
