Home
last modified time | relevance | path

Searched refs:json (Results 1 – 25 of 294) sorted by relevance

12345678910>>...12

/openbsd-src/gnu/usr.bin/perl/cpan/JSON-PP/t/
H A D018_json_checker.t3 # use the testsuite from http://www.json.org/JSON_checker/
4 # except for fail18.json, as we do not support a depth of 20 (but 16 and 32).
16 my $json = JSON::PP->new->utf8->max_depth(32)->canonical;
28 if ($vax_float && $name =~ /pass1.json/) {
32 if (my $perl = eval { $json->decode ($test) }) {
34 is ($json->encode ($json->decode ($json->encode ($perl))), $json->encode ($perl));
42 # fail10.json
44 # fail11.json
46 # fail12.json
48 # fail13.json
[all …]
H A D020_unknown.t10 my $json = JSON::PP->new;
12 eval q| $json->encode( [ sub {} ] ) |;
15 eval q| $json->encode( [ \-1 ] ) |;
18 eval q| $json->encode( [ \undef ] ) |;
21 eval q| $json->encode( [ \{} ] ) |;
24 $json->allow_unknown;
26 is( $json->encode( [ sub {} ] ), '[null]' );
27 is( $json->encode( [ \-1 ] ), '[null]' );
28 is( $json->encode( [ \undef ] ), '[null]' );
29 is( $json->encode( [ \{} ] ), '[null]' );
[all …]
H A D109_encode.t16 my $json = JSON::PP->new->allow_nonref;
19 is($json->encode("¶"), q|"¶"|); # as is
21 $json->ascii;
23 is($json->encode("\xb6"), q|"\u00b6"|); # latin1
26 is($json->encode("\xc2\xb6"), q|"\u00c2\u00b6"|); # utf8
27 is($json->encode("¶"), q|"\u00c2\u00b6"|); # utf8
28 is($json->encode('あ'), q|"\u00e3\u0081\u0082"|);
32 is($json->encode("\x80\x65"), q|"\u0080\u0065"|); # utf8
33 is($json->encode("¶"), q|"\u0080\u0065"|); # utf8
36 is($json->encode("\x78\x64"), q|"\u0078\u0064"|); # utf8
[all …]
H A D017_relaxed.t14 my $json = JSON::PP->new->relaxed;
16 ok ('[1,2,3]' eq encode_json $json->decode (' [1,2, 3]'));
17 ok ('[1,2,4]' eq encode_json $json->decode ('[1,2, 4 , ]'));
18 ok (!eval { $json->decode ('[1,2, 3,4,,]') });
19 ok (!eval { $json->decode ('[,1]') });
21 ok ('{"1":2}' eq encode_json $json->decode (' {"1":2}'));
22 ok ('{"1":2}' eq encode_json $json->decode ('{"1":2,}'));
23 ok (!eval { $json->decode ('{,}') });
25 ok ('[1,2]' eq encode_json $json->decode ("[1#,2\n ,2,# ] \n\t]"));
H A D114_decode_prefix.t11 my $json = JSON::PP->new;
18 is( ( $json->decode_prefix( $complete_text ) ) [1], 13 );
19 is( ( $json->decode_prefix( $garbaged_text ) ) [1], 13 );
20 is( ( $json->decode_prefix( $garbaged_text2 ) ) [1], 13 );
21 is( ( $json->decode_prefix( $garbaged_text3 ) ) [1], 13 );
23 eval { $json->decode( "\n" ) }; ok( $@ =~ /malformed JSON/ );
24 eval { $json->allow_nonref(0)->decode('null') }; ok $@ =~ /allow_nonref/;
26 eval { $json->decode_prefix( "\n" ) }; ok( $@ =~ /malformed JSON/ );
27 eval { $json->allow_nonref(0)->decode_prefix('null') }; ok $@ =~ /allow_nonref/;
H A D110_bignum.t24 my $json = JSON::PP->new;
26 $json->allow_nonref->allow_bignum(1);
27 $json->convert_blessed->allow_blessed;
29 my $num = $json->decode(q|100000000000000000000000000000000000000|);
33 is($json->encode($num), $fix . '100000000000000000000000000000000000000');
36 $num = $json->decode(q|10|);
42 $num = $json->decode(q|2.0000000000000000001|);
46 is($json->encode($num), '2.0000000000000000001');
49 is($json->encode([Math::BigInt->new("0")]), "[${fix}0]", "zero bigint is 0 (the number), not '0' (t…
H A D118_boolean_values.t40 my $json = JSON::PP->new;
44 my $ret = $json->boolean_values($false, $true);
45 is $ret => $json, "returns the same object";
46 my ($new_false, $new_true) = $json->get_boolean_values;
57 my $should_true = $json->allow_nonref(1)->decode('true');
60 my $should_false = $json->allow_nonref(1)->decode('false');
65 my $should_true_json = eval { $json->allow_nonref(1)->encode($new_true); };
68 my $should_false_json = eval { $json->allow_nonref(1)->encode($new_false); };
72 $ret = $json->boolean_values();
73 is $ret => $json, "returns the same object";
[all …]
/openbsd-src/gnu/llvm/lldb/tools/lldb-vscode/
H A DJSONUtils.h33 void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key,
44 llvm::StringRef GetAsString(const llvm::json::Value &value);
59 llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key);
60 llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key);
75 uint64_t GetUnsigned(const llvm::json::Object &obj, llvm::StringRef key,
77 uint64_t GetUnsigned(const llvm::json::Object *obj, llvm::StringRef key,
93 bool GetBoolean(const llvm::json::Object &obj, llvm::StringRef key,
95 bool GetBoolean(const llvm::json::Object *obj, llvm::StringRef key,
111 int64_t GetSigned(const llvm::json::Object &obj, llvm::StringRef key,
113 int64_t GetSigned(const llvm::json::Object *obj, llvm::StringRef key,
[all …]
H A DJSONUtils.cpp34 void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key, in EmplaceSafeString()
36 if (LLVM_LIKELY(llvm::json::isUTF8(str))) in EmplaceSafeString()
39 obj.try_emplace(key, llvm::json::fixUTF8(str)); in EmplaceSafeString()
42 llvm::StringRef GetAsString(const llvm::json::Value &value) { in GetAsString()
49 llvm::StringRef GetString(const llvm::json::Object &obj, llvm::StringRef key) { in GetString()
55 llvm::StringRef GetString(const llvm::json::Object *obj, llvm::StringRef key) { in GetString()
63 uint64_t GetUnsigned(const llvm::json::Object &obj, llvm::StringRef key, in GetUnsigned()
70 uint64_t GetUnsigned(const llvm::json::Object *obj, llvm::StringRef key, in GetUnsigned()
77 bool GetBoolean(const llvm::json::Object &obj, llvm::StringRef key, in GetBoolean()
86 bool GetBoolean(const llvm::json::Object *obj, llvm::StringRef key, in GetBoolean()
[all …]
H A Dlldb-vscode.cpp104 typedef void (*RequestCallback)(const llvm::json::Object &command);
174 llvm::json::Object event(CreateEventObject("exited")); in SendProcessExitedEvent()
175 llvm::json::Object body; in SendProcessExitedEvent()
178 g_vsc.SendJSON(llvm::json::Value(std::move(event))); in SendProcessExitedEvent()
182 llvm::json::Object event(CreateEventObject("thread")); in SendThreadExitedEvent()
183 llvm::json::Object body; in SendThreadExitedEvent()
187 g_vsc.SendJSON(llvm::json::Value(std::move(event))); in SendThreadExitedEvent()
210 llvm::json::Object event(CreateTerminatedEventObject()); in SendTerminatedEvent()
211 g_vsc.SendJSON(llvm::json::Value(std::move(event))); in SendTerminatedEvent()
351 llvm::json::Object event(CreateEventObject("process")); in SendProcessEvent()
[all …]
H A DRunInTerminal.cpp45 json::Value RunInTerminalMessagePid::ToJSON() const { in ToJSON()
46 return json::Object{{"kind", "pid"}, {"pid", static_cast<int64_t>(pid)}}; in ToJSON()
52 json::Value RunInTerminalMessageError::ToJSON() const { in ToJSON()
53 return json::Object{{"kind", "error"}, {"value", error}}; in ToJSON()
59 json::Value RunInTerminalMessageDidAttach::ToJSON() const { in ToJSON()
60 return json::Object{{"kind", "didAttach"}}; in ToJSON()
64 ParseJSONMessage(const json::Value &json) { in ParseJSONMessage() argument
65 if (const json::Object *obj = json.getAsObject()) { in ParseJSONMessage()
81 "Incorrect JSON message: " + JSONToString(json)); in ParseJSONMessage()
86 if (Expected<json::Value> json = io.ReadJSON(timeout)) in GetNextMessage() local
[all …]
H A DVSCode.cpp105 void VSCode::SendJSON(const llvm::json::Value &json) { in SendJSON() argument
108 strm << json; in SendJSON()
208 llvm::json::Object event(CreateEventObject("output")); in SendOutput()
209 llvm::json::Object body; in SendOutput()
228 SendJSON(llvm::json::Value(std::move(event))); in SendOutput()
367 lldb::SBThread VSCode::GetLLDBThread(const llvm::json::Object &arguments) { in GetLLDBThread()
372 lldb::SBFrame VSCode::GetLLDBFrame(const llvm::json::Object &arguments) { in GetLLDBFrame()
382 llvm::json::Value VSCode::CreateTopLevelScopes() { in CreateTopLevelScopes()
383 llvm::json::Array scopes; in CreateTopLevelScopes()
390 return llvm::json::Value(std::move(scopes)); in CreateTopLevelScopes()
[all …]
/openbsd-src/gnu/llvm/lldb/include/lldb/Utility/
H A DTraceGDBRemotePackets.h35 bool fromJSON(const llvm::json::Value &value, TraceSupportedResponse &info,
36 llvm::json::Path path);
38 llvm::json::Value toJSON(const TraceSupportedResponse &packet);
56 bool fromJSON(const llvm::json::Value &value, TraceStartRequest &packet,
57 llvm::json::Path path);
59 llvm::json::Value toJSON(const TraceStartRequest &packet);
80 bool fromJSON(const llvm::json::Value &value, TraceStopRequest &packet,
81 llvm::json::Path path);
83 llvm::json::Value toJSON(const TraceStopRequest &packet);
93 bool fromJSON(const llvm::json::Value &value, TraceGetStateRequest &packet,
[all …]
H A DTraceIntelPTGDBRemotePackets.h61 bool fromJSON(const llvm::json::Value &value, TraceIntelPTStartRequest &packet,
62 llvm::json::Path path);
64 llvm::json::Value toJSON(const TraceIntelPTStartRequest &packet);
76 llvm::json::Value toJSON(const JSONUINT64 &uint64, bool hex);
78 bool fromJSON(const llvm::json::Value &value, JSONUINT64 &uint64,
79 llvm::json::Path path);
118 bool fromJSON(const llvm::json::Value &value,
119 LinuxPerfZeroTscConversion &packet, llvm::json::Path path);
121 llvm::json::Value toJSON(const LinuxPerfZeroTscConversion &packet);
123 bool fromJSON(const llvm::json::Value &value,
[all …]
/openbsd-src/gnu/llvm/clang/lib/Basic/
H A DSarif.cpp145 json::Object createMessage(StringRef Text) { in createMessage()
146 return json::Object{{"text", Text.str()}}; in createMessage()
151 static json::Object createTextRegion(const SourceManager &SM, in createTextRegion()
155 json::Object Region{{"startLine", BeginCharLoc.getExpansionLineNumber()}, in createTextRegion()
167 static json::Object createLocation(json::Object &&PhysicalLocation, in createLocation()
169 json::Object Ret{{"physicalLocation", std::move(PhysicalLocation)}}; in createLocation()
202 static json::Object
203 createThreadFlowLocation(json::Object &&Location, in createThreadFlowLocation()
205 return json::Object{{"location", std::move(Location)}, in createThreadFlowLocation()
210 json::Object
[all …]
/openbsd-src/gnu/llvm/lldb/source/Utility/
H A DTraceGDBRemotePackets.cpp12 using namespace llvm::json;
17 bool fromJSON(const json::Value &value, TraceSupportedResponse &packet, in fromJSON()
24 json::Value toJSON(const TraceSupportedResponse &packet) { in toJSON()
25 return json::Value( in toJSON()
34 bool fromJSON(const json::Value &value, TraceStartRequest &packet, Path path) { in fromJSON()
39 json::Value toJSON(const TraceStartRequest &packet) { in toJSON()
40 return json::Value(Object{{"tids", packet.tids}, {"type", packet.type}}); in toJSON()
56 bool fromJSON(const json::Value &value, TraceStopRequest &packet, Path path) { in fromJSON()
61 json::Value toJSON(const TraceStopRequest &packet) { in toJSON()
62 return json::Value(Object{{"type", packet.type}, {"tids", packet.tids}}); in toJSON()
[all …]
H A DTraceIntelPTGDBRemotePackets.cpp12 using namespace llvm::json;
25 json::Value toJSON(const JSONUINT64 &uint64, bool hex) { in toJSON()
27 return json::Value(formatv("{0:x+}", uint64.value)); in toJSON()
29 return json::Value(formatv("{0}", uint64.value)); in toJSON()
32 bool fromJSON(const json::Value &value, JSONUINT64 &uint64, Path path) { in fromJSON()
45 bool fromJSON(const json::Value &value, TraceIntelPTStartRequest &packet, in fromJSON()
63 json::Value toJSON(const TraceIntelPTStartRequest &packet) { in toJSON()
64 json::Value base = toJSON((const TraceStartRequest &)packet); in toJSON()
65 json::Object &obj = *base.getAsObject(); in toJSON()
89 json::Value toJSON(const LinuxPerfZeroTscConversion &packet) { in toJSON()
[all …]
H A DStructuredData.cpp20 static StructuredData::ObjectSP ParseJSONValue(json::Value &value);
21 static StructuredData::ObjectSP ParseJSONObject(json::Object *object);
22 static StructuredData::ObjectSP ParseJSONArray(json::Array *array);
26 llvm::Expected<json::Value> value = json::parse(json_text); in ParseJSON()
45 llvm::Expected<json::Value> value = in ParseJSONFromFile()
46 json::parse(buffer_or_error.get()->getBuffer().str()); in ParseJSONFromFile()
58 static StructuredData::ObjectSP ParseJSONValue(json::Value &value) { in ParseJSONValue()
59 if (json::Object *O = value.getAsObject()) in ParseJSONValue()
62 if (json::Array *A = value.getAsArray()) in ParseJSONValue()
83 static StructuredData::ObjectSP ParseJSONObject(json::Object *object) { in ParseJSONObject()
[all …]
/openbsd-src/gnu/llvm/llvm/tools/llvm-cov/
H A DCoverageExporterJson.cpp79 json::Array renderSegment(const coverage::CoverageSegment &Segment) { in renderSegment()
80 return json::Array({Segment.Line, Segment.Col, in renderSegment()
85 json::Array renderRegion(const coverage::CountedRegion &Region) { in renderRegion()
86 return json::Array({Region.LineStart, Region.ColumnStart, Region.LineEnd, in renderRegion()
92 json::Array renderBranch(const coverage::CountedRegion &Region) { in renderBranch()
93 return json::Array( in renderBranch()
100 json::Array renderRegions(ArrayRef<coverage::CountedRegion> Regions) { in renderRegions()
101 json::Array RegionArray; in renderRegions()
107 json::Array renderBranchRegions(ArrayRef<coverage::CountedRegion> Regions) { in renderBranchRegions()
108 json::Array RegionArray; in renderBranchRegions()
[all …]
/openbsd-src/gnu/llvm/lldb/source/Plugins/Trace/intel-pt/
H A DTraceIntelPTJSONStructs.h63 llvm::json::Value toJSON(const JSONModule &module);
65 llvm::json::Value toJSON(const JSONThread &thread);
67 llvm::json::Value toJSON(const JSONProcess &process);
69 llvm::json::Value toJSON(const JSONCpu &cpu);
71 llvm::json::Value toJSON(const pt_cpu &cpu_info);
73 llvm::json::Value toJSON(const JSONKernel &kernel);
75 llvm::json::Value toJSON(const JSONTraceBundleDescription &bundle_description);
77 bool fromJSON(const llvm::json::Value &value, JSONModule &module,
78 llvm::json::Path path);
80 bool fromJSON(const llvm::json::Value &value, JSONThread &thread,
[all …]
H A DTraceIntelPTJSONStructs.cpp18 using namespace llvm::json;
33 json::Value toJSON(const JSONModule &module) { in toJSON()
34 json::Object json_module; in toJSON()
44 bool fromJSON(const json::Value &value, JSONModule &module, Path path) { in fromJSON()
52 json::Value toJSON(const JSONThread &thread) { in toJSON()
53 json::Object obj{{"tid", thread.tid}}; in toJSON()
59 bool fromJSON(const json::Value &value, JSONThread &thread, Path path) { in fromJSON()
64 json::Value toJSON(const JSONProcess &process) { in toJSON()
73 bool fromJSON(const json::Value &value, JSONProcess &process, Path path) { in fromJSON()
79 json::Value toJSON(const JSONCpu &cpu) { in toJSON()
[all …]
/openbsd-src/regress/lib/libcrypto/wycheproof/
H A Dwycheproof.go80 "encoding/json"
129 Crv string `json:"crv"`
130 KID string `json:"kid"`
131 KTY string `json:"kty"`
132 X string `json:"x"`
133 Y string `json:"y"`
137 Crv string `json:"crv"`
138 D string `json:"d"`
139 KID string `json:"kid"`
140 KTY string `json
[all...]
/openbsd-src/gnu/llvm/llvm/lib/TableGen/
H A DJSONBackend.cpp31 json::Value translateInit(const Init &I);
43 json::Value JSONEmitter::translateInit(const Init &I) { in translateInit()
53 json::Array array; in translateInit()
62 json::Array array; in translateInit()
73 json::Object obj; in translateInit()
96 json::Array args; in translateInit()
98 json::Array arg; in translateInit()
120 json::Object root; in run()
130 std::map<std::string, json::Array> instance_lists; in run()
141 json::Object obj; in run()
[all …]
/openbsd-src/gnu/llvm/lldb/source/Target/
H A DStatistics.cpp22 static void EmplaceSafeString(llvm::json::Object &obj, llvm::StringRef key, in EmplaceSafeString()
26 if (LLVM_LIKELY(llvm::json::isUTF8(str))) in EmplaceSafeString()
29 obj.try_emplace(key, llvm::json::fixUTF8(str)); in EmplaceSafeString()
32 json::Value StatsSuccessFail::ToJSON() const { in ToJSON()
33 return json::Object{{"successes", successes}, {"failures", failures}}; in ToJSON()
48 json::Value ModuleStats::ToJSON() const { in ToJSON()
49 json::Object module; in ToJSON()
75 json::Array symfile_ids; in ToJSON()
82 json::Array type_systems; in ToJSON()
84 json::Object obj; in ToJSON()
[all …]
/openbsd-src/gnu/llvm/clang/lib/Tooling/DumpTool/
H A DASTSrcLocProcessor.cpp52 llvm::json::Object toJSON(llvm::StringMap<std::vector<StringRef>> const &Obj) { in toJSON()
53 using llvm::json::toJSON; in toJSON()
55 llvm::json::Object JsonObj; in toJSON()
62 llvm::json::Object toJSON(llvm::StringMap<std::string> const &Obj) { in toJSON()
63 using llvm::json::toJSON; in toJSON()
65 llvm::json::Object JsonObj; in toJSON()
72 llvm::json::Object toJSON(ClassData const &Obj) { in toJSON()
73 llvm::json::Object JsonObj; in toJSON()
92 llvm::json::Object toJSON(llvm::StringMap<ClassData> const &Obj) { in toJSON()
93 using llvm::json::toJSON; in toJSON()
[all …]

12345678910>>...12