| 75 | /* The following functions construct the "leaves" of the abstract syntax tree. */ |
| 76 | |
| 77 | RET parse_keyword(PARAMS, const char *keyword, const char *errmsg) { |
| 78 | struct graphql_token *tok = list_top(tokens, struct graphql_token, node); |
| 79 | if (!tok || tok->token_type != 'a') { |
| 80 | *err = errmsg; return NULL; |
| 81 | } |
| 82 | if (!streq(tok->token_string, keyword)) { |
| 83 | *err = errmsg; return NULL; |
| 84 | } |
| 85 | CONSUME_ONE; |
| 86 | return tok; |
| 87 | } |
| 88 | |
| 89 | // Note: a static buffer is used here. |
| 90 | RET parse_punct(PARAMS, int punct) { |
no outgoing calls
no test coverage detected