MCPcopy Create free account
hub / github.com/crownengine/crown / skip_comments

Function skip_comments

src/core/json/sjson.cpp:95–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93 }
94
95 static const char *skip_comments(const char *json)
96 {
97 if (json == NULL) {
98 fatal("json is NULL");
99 return NULL;
100 }
101
102 if (*json == '/') {
103 ++json;
104 if (*json == '/') {
105 NEXT_OR_RETURN(json, '/', NULL);
106 while (*json && *json != '\n')
107 ++json;
108 } else if (*json == '*') {
109 ++json;
110 while (*json && *json != '*')
111 ++json;
112 NEXT_OR_RETURN(json, '*', NULL);
113 NEXT_OR_RETURN(json, '/', NULL);
114 } else {
115 fatal("Bad comment");
116 return NULL;
117 }
118 }
119
120 return json;
121 }
122
123 static const char *skip_spaces(const char *json)
124 {

Callers 2

skip_spacesFunction · 0.85
skip_valueFunction · 0.85

Calls 1

fatalFunction · 0.70

Tested by

no test coverage detected