MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lex_single_char

Function lex_single_char

src/cypher/cypher.c:251–286  ·  view source on GitHub ↗

Try to match a single-character token. Returns TOK_EOF if not matched. */

Source from the content-addressed store, hash-verified

249
250/* Try to match a single-character token. Returns TOK_EOF if not matched. */
251static cbm_token_type_t lex_single_char(char c) {
252 switch (c) {
253 case '(':
254 return TOK_LPAREN;
255 case ')':
256 return TOK_RPAREN;
257 case '[':
258 return TOK_LBRACKET;
259 case ']':
260 return TOK_RBRACKET;
261 case '-':
262 return TOK_DASH;
263 case '>':
264 return TOK_GT;
265 case '<':
266 return TOK_LT;
267 case ':':
268 return TOK_COLON;
269 case '.':
270 return TOK_DOT;
271 case '{':
272 return TOK_LBRACE;
273 case '}':
274 return TOK_RBRACE;
275 case '*':
276 return TOK_STAR;
277 case ',':
278 return TOK_COMMA;
279 case '=':
280 return TOK_EQ;
281 case '|':
282 return TOK_PIPE;
283 default:
284 return TOK_EOF;
285 }
286}
287
288/* Try to lex an identifier or keyword starting at position i. Returns true if matched. */
289static bool lex_try_ident(const char *input, int len, int *i, cbm_lex_result_t *out) {

Callers 1

cbm_lexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected