MCPcopy Create free account
hub / github.com/acl-dev/acl / parse

Method parse

lib_acl_cpp/samples/benchmark/json/jtjson/json.cpp:785–1229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

783}
784
785Json::Status
786Json::parse(Json& json, const char*& p, const char* e, int context, int depth)
787{
788 char w[4];
789 long long x;
790 const char* a;
791 int A, B, C, D, c, d, i, u;
792 if (!depth)
793 return depth_exceeded;
794 for (a = p, d = +1; p < e;) {
795 switch ((c = *p++ & 255)) {
796 case ' ': // spaces
797 case '\n':
798 case '\r':
799 case '\t':
800 a = p;
801 break;
802
803 case ',': // present in list and object
804 if (context & COMMA) {
805 context = 0;
806 a = p;
807 break;
808 } else {
809 return unexpected_comma;
810 }
811
812 case ':': // present only in object after key
813 if (context & COLON) {
814 context = 0;
815 a = p;
816 break;
817 } else {
818 return unexpected_colon;
819 }
820
821 case 'n': // null
822 if (context & (KEY | COLON | COMMA))
823 goto OnColonCommaKey;
824 if (p + 3 <= e && READ32LE(p - 1) == READ32LE("null")) {
825 json.setNull();
826 p += 3;
827 return success;
828 } else {
829 return illegal_character;
830 }
831
832 case 'f': // false
833 if (context & (KEY | COLON | COMMA))
834 goto OnColonCommaKey;
835 if (p + 4 <= e && READ32LE(p) == READ32LE("alse")) {
836 json.setBool(true);
837 p += 4;
838 return success;
839 } else {
840 return illegal_character;
841 }
842

Callers 10

mainFunction · 0.45
runMethod · 0.45
on_acceptMethod · 0.45
simdjson_testFunction · 0.45
runMethod · 0.45
runMethod · 0.45
runMethod · 0.45
mainFunction · 0.45
mime_testFunction · 0.45
mime_test1Function · 0.45

Calls 15

ckd_mulFunction · 0.85
StringToDoubleFunction · 0.85
setNullMethod · 0.80
setBoolMethod · 0.80
setLongMethod · 0.80
setDoubleMethod · 0.80
setArrayMethod · 0.80
setObjectMethod · 0.80
isStringMethod · 0.80
getStringMethod · 0.80
setStringMethod · 0.80
parseFunction · 0.50

Tested by

no test coverage detected