| 160 | } |
| 161 | |
| 162 | void fxCheckGenerator(txParser* parser) |
| 163 | { |
| 164 | txNode* node = parser->root; |
| 165 | if (node->description->token == XS_TOKEN_PROGRAM) { |
| 166 | node = ((txProgramNode*)node)->body; |
| 167 | if (node->description->token == XS_TOKEN_STATEMENT) { |
| 168 | node = ((txStatementNode*)node)->expression; |
| 169 | if (node->description->token == XS_TOKEN_EXPRESSIONS) { |
| 170 | txNodeList* list = ((txExpressionsNode*)node)->items; |
| 171 | if (list->length == 1) { |
| 172 | node = list->first; |
| 173 | if (node->description->token == XS_TOKEN_GENERATOR) |
| 174 | return; |
| 175 | } |
| 176 | } |
| 177 | } |
| 178 | } |
| 179 | fxReportParserError(parser, node->line, "no generator function"); |
| 180 | } |
| 181 | |
| 182 | void fxSkipShebang(txParser* parser) |
| 183 | { |
no test coverage detected