Push the current indentation level to the stack and set the new level the current column is greater than the indentation level. In this case, append or insert the specified token into the token queue.
(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t)
| 993 | // the current column is greater than the indentation level. In this case, |
| 994 | // append or insert the specified token into the token queue. |
| 995 | func yaml_parser_roll_indent(parser *yaml_parser_t, column, number int, typ yaml_token_type_t, mark yaml_mark_t) bool { |
| 996 | // In the flow context, do nothing. |
| 997 | if parser.flow_level > 0 { |
| 998 | return true |
| 999 | } |
| 1000 | |
| 1001 | if parser.indent < column { |
| 1002 | // Push the current indentation level to the stack and set the new |
| 1003 | // indentation level. |
| 1004 | parser.indents = append(parser.indents, parser.indent) |
| 1005 | parser.indent = column |
| 1006 | if len(parser.indents) > max_indents { |
| 1007 | return yaml_parser_set_scanner_error(parser, |
| 1008 | "while increasing indent level", parser.simple_keys[len(parser.simple_keys)-1].mark, |
| 1009 | fmt.Sprintf("exceeded max depth of %d", max_indents)) |
| 1010 | } |
| 1011 | |
| 1012 | // Create a token and insert it into the queue. |
| 1013 | token := yaml_token_t{ |
| 1014 | typ: typ, |
| 1015 | start_mark: mark, |
| 1016 | end_mark: mark, |
| 1017 | } |
| 1018 | if number > -1 { |
| 1019 | number -= parser.tokens_parsed |
| 1020 | } |
| 1021 | yaml_insert_token(parser, number, &token) |
| 1022 | } |
| 1023 | return true |
| 1024 | } |
| 1025 | |
| 1026 | // Pop indentation levels from the indents stack until the current level |
| 1027 | // becomes less or equal to the column. For each indentation level, append |
no test coverage detected