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

Function lex_single_char

src/cypher/cypher.c:259–294  ·  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

257
258/* Try to match a single-character token. Returns TOK_EOF if not matched. */
259static cbm_token_type_t lex_single_char(char c) {
260 switch (c) {
261 case '(':
262 return TOK_LPAREN;
263 case ')':
264 return TOK_RPAREN;
265 case '[':
266 return TOK_LBRACKET;
267 case ']':
268 return TOK_RBRACKET;
269 case '-':
270 return TOK_DASH;
271 case '>':
272 return TOK_GT;
273 case '<':
274 return TOK_LT;
275 case ':':
276 return TOK_COLON;
277 case '.':
278 return TOK_DOT;
279 case '{':
280 return TOK_LBRACE;
281 case '}':
282 return TOK_RBRACE;
283 case '*':
284 return TOK_STAR;
285 case ',':
286 return TOK_COMMA;
287 case '=':
288 return TOK_EQ;
289 case '|':
290 return TOK_PIPE;
291 default:
292 return TOK_EOF;
293 }
294}
295
296/* Try to lex an identifier or keyword starting at position i. Returns true if matched. */
297static 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