| 1274 | |
| 1275 | |
| 1276 | static int |
| 1277 | yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column) |
| 1278 | { |
| 1279 | yaml_token_t token; |
| 1280 | |
| 1281 | /* In the flow context, do nothing. */ |
| 1282 | |
| 1283 | if (parser->flow_level) |
| 1284 | return 1; |
| 1285 | |
| 1286 | /* Loop through the indentation levels in the stack. */ |
| 1287 | |
| 1288 | while (parser->indent > column) |
| 1289 | { |
| 1290 | /* Create a token and append it to the queue. */ |
| 1291 | |
| 1292 | TOKEN_INIT(token, YAML_BLOCK_END_TOKEN, parser->mark, parser->mark); |
| 1293 | |
| 1294 | if (!ENQUEUE(parser, parser->tokens, token)) |
| 1295 | return 0; |
| 1296 | |
| 1297 | /* Pop the indentation level. */ |
| 1298 | |
| 1299 | parser->indent = POP(parser, parser->indents); |
| 1300 | } |
| 1301 | |
| 1302 | return 1; |
| 1303 | } |
| 1304 | |
| 1305 | /* |
| 1306 | * Initialize the scanner and produce the STREAM-START token. |
no outgoing calls
no test coverage detected