MCPcopy Create free account
hub / github.com/OpenPTrack/open_ptrack_v2 / tokenize

Method tokenize

opt_utils/src/json.cpp:917–1023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915 }
916
917 void Parser::tokenize()
918 {
919 Token token = T_UNKNOWN;
920 std::string valueBuffer;
921 bool saveBuffer;
922
923 char c = '\0';
924 for (; cursor < jsonSize; ++cursor)
925 {
926 c = json.at(cursor);
927
928 if (IsWhitespace(c))
929 continue;
930
931 saveBuffer = true;
932
933 switch (c)
934 {
935 case '{' :
936 {
937 token = T_OBJ_BEGIN;
938 break;
939 }
940 case '}' :
941 {
942 token = T_OBJ_END;
943 break;
944 }
945 case '[' :
946 {
947 token = T_ARRAY_BEGIN;
948 break;
949 }
950 case ']' :
951 {
952 token = T_ARRAY_END;
953 break;
954 }
955 case ',' :
956 {
957 token = T_SEPARATOR_NODE;
958 break;
959 }
960 case ':' :
961 {
962 token = T_SEPARATOR_NAME;
963 break;
964 }
965 case '"' :
966 {
967 token = T_VALUE;
968 readString();
969 break;
970 }
971 case '/' :
972 {
973 char p = peek();
974 if (p == '*')

Callers

nothing calls this directly

Calls 4

IsWhitespaceFunction · 0.85
MakePairFunction · 0.85
pushMethod · 0.80
clearMethod · 0.80

Tested by

no test coverage detected