485 #define CACHE(parser,length) \ 486 (parser->unread >= (length) \ 488 : yaml_parser_update_buffer(parser, (length))) 494 #define SKIP(parser) \ 495 (parser->mark.index ++, \ 496 parser->mark.column ++, \ 498 parser->buffer.pointer += WIDTH(parser->buffer)) 500 #define SKIP_LINE(parser) \ 501 (IS_CRLF(parser->buffer) ? \ 502 (parser->mark.index += 2, \ 503 parser->mark.column = 0, \ 504 parser->mark.line ++, \ 505 parser->unread -= 2, \ 506 parser->buffer.pointer += 2) : \ 507 IS_BREAK(parser->buffer) ? \ 508 (parser->mark.index ++, \ 509 parser->mark.column = 0, \ 510 parser->mark.line ++, \ 512 parser->buffer.pointer += WIDTH(parser->buffer)) : 0) 518 #define READ(parser,string) \ 519 (STRING_EXTEND(parser,string) ? \ 520 (COPY(string,parser->buffer), \ 521 parser->mark.index ++, \ 522 parser->mark.column ++, \ 530 #define READ_LINE(parser,string) \ 531 (STRING_EXTEND(parser,string) ? \ 532 (((CHECK_AT(parser->buffer,'\r',0) \ 533 && CHECK_AT(parser->buffer,'\n',1)) ? \ 534 (*((string).pointer++) = (yaml_char_t) '\n', \ 535 parser->buffer.pointer += 2, \ 536 parser->mark.index += 2, \ 537 parser->mark.column = 0, \ 538 parser->mark.line ++, \ 539 parser->unread -= 2) : \ 540 (CHECK_AT(parser->buffer,'\r',0) \ 541 || CHECK_AT(parser->buffer,'\n',0)) ? \ 542 (*((string).pointer++) = (yaml_char_t) '\n', \ 543 parser->buffer.pointer ++, \ 544 parser->mark.index ++, \ 545 parser->mark.column = 0, \ 546 parser->mark.line ++, \ 547 parser->unread --) : \ 548 (CHECK_AT(parser->buffer,'\xC2',0) \ 549 && CHECK_AT(parser->buffer,'\x85',1)) ? \ 550 (*((string).pointer++) = (yaml_char_t) '\n', \ 551 parser->buffer.pointer += 2, \ 552 parser->mark.index ++, \ 553 parser->mark.column = 0, \ 554 parser->mark.line ++, \ 555 parser->unread --) : \ 556 (CHECK_AT(parser->buffer,'\xE2',0) && \ 557 CHECK_AT(parser->buffer,'\x80',1) && \ 558 (CHECK_AT(parser->buffer,'\xA8',2) || \ 559 CHECK_AT(parser->buffer,'\xA9',2))) ? \ 560 (*((string).pointer++) = *(parser->buffer.pointer++), \ 561 *((string).pointer++) = *(parser->buffer.pointer++), \ 562 *((string).pointer++) = *(parser->buffer.pointer++), \ 563 parser->mark.index ++, \ 564 parser->mark.column = 0, \ 565 parser->mark.line ++, \ 566 parser->unread --) : 0), \ 753 if (parser->stream_end_produced || parser->error) {
759 if (!parser->token_available) {
766 *token =
DEQUEUE(parser, parser->tokens);
767 parser->token_available = 0;
768 parser->tokens_parsed ++;
771 parser->stream_end_produced = 1;
802 int need_more_tokens;
812 need_more_tokens = 0;
814 if (parser->tokens.head == parser->tokens.tail)
818 need_more_tokens = 1;
829 for (simple_key = parser->simple_keys.start;
830 simple_key != parser->simple_keys.top; simple_key++) {
833 need_more_tokens = 1;
841 if (!need_more_tokens)
850 parser->token_available = 1;
864 if (!
CACHE(parser, 1))
892 if (!
CACHE(parser, 4))
1046 "while scanning for the next token", parser->
mark,
1047 "found character that cannot start any token");
1080 "while scanning a simple key", simple_key->
mark,
1081 "could not find expected ':'");
1144 "while scanning a simple key", simple_key->
mark,
1145 "could not find expected ':'");
1217 if (parser->
indent < column)
1227 if (column > INT_MAX) {
1271 while (parser->
indent > column)
1425 start_mark = parser->
mark;
1431 end_mark = parser->
mark;
1435 TOKEN_INIT(token, type, start_mark, end_mark);
1472 start_mark = parser->
mark;
1474 end_mark = parser->
mark;
1478 TOKEN_INIT(token, type, start_mark, end_mark);
1515 start_mark = parser->
mark;
1517 end_mark = parser->
mark;
1521 TOKEN_INIT(token, type, start_mark, end_mark);
1552 start_mark = parser->
mark;
1554 end_mark = parser->
mark;
1584 "block sequence entries are not allowed in this context");
1613 start_mark = parser->
mark;
1615 end_mark = parser->
mark;
1645 "mapping keys are not allowed in this context");
1666 start_mark = parser->
mark;
1668 end_mark = parser->
mark;
1731 "mapping values are not allowed in this context");
1748 start_mark = parser->
mark;
1750 end_mark = parser->
mark;
1929 if (!
CACHE(parser, 1))
return 0;
1944 if (!
CACHE(parser, 1))
return 0;
1950 if (!
CACHE(parser, 1))
return 0;
1958 if (!
CACHE(parser, 1))
return 0;
1966 if (!
CACHE(parser, 2))
return 0;
2006 start_mark = parser->
mark;
2017 if (strcmp((
char *)name,
"YAML") == 0)
2025 end_mark = parser->
mark;
2030 start_mark, end_mark);
2035 else if (strcmp((
char *)name,
"TAG") == 0)
2043 end_mark = parser->
mark;
2048 start_mark, end_mark);
2056 start_mark,
"found unknown directive name");
2062 if (!
CACHE(parser, 1))
goto error;
2066 if (!
CACHE(parser, 1))
goto error;
2072 if (!
CACHE(parser, 1))
goto error;
2080 start_mark,
"did not find expected comment or line break");
2087 if (!
CACHE(parser, 2))
goto error;
2122 if (!
CACHE(parser, 1))
goto error;
2126 if (!
READ(parser,
string))
goto error;
2127 if (!
CACHE(parser, 1))
goto error;
2132 if (
string.start ==
string.pointer) {
2134 start_mark,
"could not find expected directive name");
2142 start_mark,
"found unexpected non-alphabetical character");
2146 *name =
string.start;
2169 if (!
CACHE(parser, 1))
return 0;
2173 if (!
CACHE(parser, 1))
return 0;
2185 start_mark,
"did not find expected digit or '.' character");
2198 #define MAX_NUMBER_LENGTH 9 2219 if (!
CACHE(parser, 1))
return 0;
2227 start_mark,
"found extremely long version number");
2234 if (!
CACHE(parser, 1))
return 0;
2241 start_mark,
"did not find expected version number");
2266 if (!
CACHE(parser, 1))
goto error;
2270 if (!
CACHE(parser, 1))
goto error;
2280 if (!
CACHE(parser, 1))
goto error;
2284 start_mark,
"did not find expected whitespace");
2292 if (!
CACHE(parser, 1))
goto error;
2302 if (!
CACHE(parser, 1))
goto error;
2306 start_mark,
"did not find expected whitespace or line break");
2310 *handle = handle_value;
2311 *prefix = prefix_value;
2333 start_mark = parser->
mark;
2339 if (!
CACHE(parser, 1))
goto error;
2342 if (!
READ(parser,
string))
goto error;
2343 if (!
CACHE(parser, 1))
goto error;
2347 end_mark = parser->
mark;
2362 "while scanning an anchor" :
"while scanning an alias", start_mark,
2363 "did not find expected alphabetic or numeric character");
2394 start_mark = parser->
mark;
2398 if (!
CACHE(parser, 2))
goto error;
2405 if (!handle)
goto error;
2422 start_mark,
"did not find the expected '>'");
2439 if (handle[0] ==
'!' && handle[1] !=
'\0' && handle[
strlen((
char *)handle)-1] ==
'!')
2457 if (!handle)
goto error;
2466 if (suffix[0] ==
'\0') {
2476 if (!
CACHE(parser, 1))
goto error;
2480 start_mark,
"did not find expected whitespace or line break");
2484 end_mark = parser->
mark;
2512 if (!
CACHE(parser, 1))
goto error;
2516 "while scanning a tag directive" :
"while scanning a tag",
2517 start_mark,
"did not find expected '!'");
2523 if (!
READ(parser,
string))
goto error;
2527 if (!
CACHE(parser, 1))
goto error;
2531 if (!
READ(parser,
string))
goto error;
2532 if (!
CACHE(parser, 1))
goto error;
2539 if (!
READ(parser,
string))
goto error;
2549 if (directive && !(
string.start[0] ==
'!' &&
string.start[1] ==
'\0')) {
2551 start_mark,
"did not find expected '!'");
2556 *handle =
string.start;
2573 size_t length = head ?
strlen((
char *)head) : 0;
2580 while ((
size_t)(
string.end -
string.start) <= length) {
2594 memcpy(
string.start, head+1, length-1);
2595 string.pointer += length-1;
2600 if (!
CACHE(parser, 1))
goto error;
2629 directive, start_mark, &
string))
goto error;
2632 if (!
READ(parser,
string))
goto error;
2636 if (!
CACHE(parser, 1))
goto error;
2646 "while parsing a %TAG directive" :
"while parsing a tag",
2647 start_mark,
"did not find expected tag URI");
2651 *uri =
string.start;
2674 unsigned char octet = 0;
2678 if (!
CACHE(parser, 3))
return 0;
2684 "while parsing a %TAG directive" :
"while parsing a tag",
2685 start_mark,
"did not find URI escaped octet");
2696 width = (octet & 0x80) == 0x00 ? 1 :
2697 (octet & 0xE0) == 0xC0 ? 2 :
2698 (octet & 0xF0) == 0xE0 ? 3 :
2699 (octet & 0xF8) == 0xF0 ? 4 : 0;
2702 "while parsing a %TAG directive" :
"while parsing a tag",
2703 start_mark,
"found an incorrect leading UTF-8 octet");
2710 if ((octet & 0xC0) != 0x80) {
2712 "while parsing a %TAG directive" :
"while parsing a tag",
2713 start_mark,
"found an incorrect trailing UTF-8 octet");
2719 *(
string->pointer++) = octet;
2745 int leading_blank = 0;
2746 int trailing_blank = 0;
2754 start_mark = parser->
mark;
2760 if (!
CACHE(parser, 1))
goto error;
2774 if (!
CACHE(parser, 1))
goto error;
2782 start_mark,
"found an indentation indicator equal to 0");
2800 start_mark,
"found an indentation indicator equal to 0");
2808 if (!
CACHE(parser, 1))
goto error;
2819 if (!
CACHE(parser, 1))
goto error;
2823 if (!
CACHE(parser, 1))
goto error;
2829 if (!
CACHE(parser, 1))
goto error;
2837 start_mark,
"did not find expected comment or line break");
2844 if (!
CACHE(parser, 2))
goto error;
2848 end_mark = parser->
mark;
2853 indent = parser->
indent >= 0 ? parser->
indent+increment : increment;
2859 start_mark, &end_mark))
goto error;
2863 if (!
CACHE(parser, 1))
goto error;
2877 if (!literal && (*leading_break.
start ==
'\n')
2878 && !leading_blank && !trailing_blank)
2882 if (*trailing_breaks.
start ==
'\0') {
2884 *(
string.pointer ++) =
' ';
2887 CLEAR(parser, leading_break);
2890 if (!
JOIN(parser,
string, leading_break))
goto error;
2891 CLEAR(parser, leading_break);
2896 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2897 CLEAR(parser, trailing_breaks);
2906 if (!
READ(parser,
string))
goto error;
2907 if (!
CACHE(parser, 1))
goto error;
2912 if (!
CACHE(parser, 2))
goto error;
2914 if (!
READ_LINE(parser, leading_break))
goto error;
2919 &indent, &trailing_breaks, start_mark, &end_mark))
goto error;
2924 if (chomping != -1) {
2925 if (!
JOIN(parser,
string, leading_break))
goto error;
2927 if (chomping == 1) {
2928 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2935 start_mark, end_mark);
2962 *end_mark = parser->
mark;
2970 if (!
CACHE(parser, 1))
return 0;
2972 while ((!*indent || (
int)parser->
mark.
column < *indent)
2975 if (!
CACHE(parser, 1))
return 0;
2986 start_mark,
"found a tab character where an indentation space is expected");
2995 if (!
CACHE(parser, 2))
return 0;
2996 if (!
READ_LINE(parser, *breaks))
return 0;
2997 *end_mark = parser->
mark;
3003 *indent = max_indent;
3004 if (*indent < parser->indent + 1)
3005 *indent = parser->
indent + 1;
3036 start_mark = parser->
mark;
3046 if (!
CACHE(parser, 4))
goto error;
3058 start_mark,
"found unexpected document indicator");
3066 start_mark,
"found unexpected end of stream");
3072 if (!
CACHE(parser, 2))
goto error;
3084 *(
string.pointer++) =
'\'';
3091 else if (
CHECK(parser->
buffer, single ?
'\'' :
'"'))
3101 if (!
CACHE(parser, 3))
goto error;
3112 size_t code_length = 0;
3121 *(
string.pointer++) =
'\0';
3125 *(
string.pointer++) =
'\x07';
3129 *(
string.pointer++) =
'\x08';
3134 *(
string.pointer++) =
'\x09';
3138 *(
string.pointer++) =
'\x0A';
3142 *(
string.pointer++) =
'\x0B';
3146 *(
string.pointer++) =
'\x0C';
3150 *(
string.pointer++) =
'\x0D';
3154 *(
string.pointer++) =
'\x1B';
3158 *(
string.pointer++) =
'\x20';
3162 *(
string.pointer++) =
'"';
3166 *(
string.pointer++) =
'\'';
3170 *(
string.pointer++) =
'\\';
3174 *(
string.pointer++) =
'\xC2';
3175 *(
string.pointer++) =
'\x85';
3179 *(
string.pointer++) =
'\xC2';
3180 *(
string.pointer++) =
'\xA0';
3184 *(
string.pointer++) =
'\xE2';
3185 *(
string.pointer++) =
'\x80';
3186 *(
string.pointer++) =
'\xA8';
3190 *(
string.pointer++) =
'\xE2';
3191 *(
string.pointer++) =
'\x80';
3192 *(
string.pointer++) =
'\xA9';
3209 start_mark,
"found unknown escape character");
3220 unsigned int value = 0;
3225 if (!
CACHE(parser, code_length))
goto error;
3227 for (k = 0; k < code_length; k ++) {
3230 start_mark,
"did not find expected hexdecimal number");
3238 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
3240 start_mark,
"found invalid Unicode character escape code");
3244 if (value <= 0x7F) {
3245 *(
string.pointer++) = value;
3247 else if (value <= 0x7FF) {
3248 *(
string.pointer++) = 0xC0 + (value >> 6);
3249 *(
string.pointer++) = 0x80 + (value & 0x3F);
3251 else if (value <= 0xFFFF) {
3252 *(
string.pointer++) = 0xE0 + (value >> 12);
3253 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3254 *(
string.pointer++) = 0x80 + (value & 0x3F);
3257 *(
string.pointer++) = 0xF0 + (value >> 18);
3258 *(
string.pointer++) = 0x80 + ((value >> 12) & 0x3F);
3259 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3260 *(
string.pointer++) = 0x80 + (value & 0x3F);
3265 for (k = 0; k < code_length; k ++) {
3275 if (!
READ(parser,
string))
goto error;
3278 if (!
CACHE(parser, 2))
goto error;
3288 if (!
CACHE(parser, 1))
goto error;
3296 if (!leading_blanks) {
3297 if (!
READ(parser, whitespaces))
goto error;
3305 if (!
CACHE(parser, 2))
goto error;
3309 if (!leading_blanks)
3311 CLEAR(parser, whitespaces);
3312 if (!
READ_LINE(parser, leading_break))
goto error;
3317 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3320 if (!
CACHE(parser, 1))
goto error;
3329 if (leading_break.
start[0] ==
'\n') {
3330 if (trailing_breaks.
start[0] ==
'\0') {
3332 *(
string.pointer++) =
' ';
3335 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3336 CLEAR(parser, trailing_breaks);
3338 CLEAR(parser, leading_break);
3341 if (!
JOIN(parser,
string, leading_break))
goto error;
3342 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3343 CLEAR(parser, leading_break);
3344 CLEAR(parser, trailing_breaks);
3349 if (!
JOIN(parser,
string, whitespaces))
goto error;
3350 CLEAR(parser, whitespaces);
3358 end_mark = parser->
mark;
3364 start_mark, end_mark);
3394 int leading_blanks = 0;
3395 int indent = parser->
indent+1;
3402 start_mark = end_mark = parser->
mark;
3410 if (!
CACHE(parser, 4))
goto error;
3436 start_mark,
"found unexpected ':'");
3452 if (leading_blanks || whitespaces.
start != whitespaces.
pointer)
3458 if (leading_break.
start[0] ==
'\n') {
3459 if (trailing_breaks.
start[0] ==
'\0') {
3461 *(
string.pointer++) =
' ';
3464 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3465 CLEAR(parser, trailing_breaks);
3467 CLEAR(parser, leading_break);
3470 if (!
JOIN(parser,
string, leading_break))
goto error;
3471 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3472 CLEAR(parser, leading_break);
3473 CLEAR(parser, trailing_breaks);
3480 if (!
JOIN(parser,
string, whitespaces))
goto error;
3481 CLEAR(parser, whitespaces);
3487 if (!
READ(parser,
string))
goto error;
3489 end_mark = parser->
mark;
3491 if (!
CACHE(parser, 2))
goto error;
3501 if (!
CACHE(parser, 1))
goto error;
3509 if (leading_blanks && (
int)parser->
mark.
column < indent
3512 start_mark,
"found a tab character that violate indentation");
3518 if (!leading_blanks) {
3519 if (!
READ(parser, whitespaces))
goto error;
3527 if (!
CACHE(parser, 2))
goto error;
3531 if (!leading_blanks)
3533 CLEAR(parser, whitespaces);
3534 if (!
READ_LINE(parser, leading_break))
goto error;
3539 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3542 if (!
CACHE(parser, 1))
goto error;
3558 if (leading_blanks) {
The double-quoted scalar style.
struct yaml_parser_s::@78 tokens
The tokens queue.
A BLOCK-SEQUENCE-START token.
static int yaml_parser_scan_directive(yaml_parser_t *parser, yaml_token_t *token)
static int yaml_parser_fetch_directive(yaml_parser_t *parser)
size_t strlen(const char *)
yaml_token_t * tail
The tail of the tokens queue.
A FLOW-SEQUENCE-START token.
static int yaml_parser_scan_flow_scalar(yaml_parser_t *parser, yaml_token_t *token, int single)
Cannot allocate or reallocate a block of memory.
static int yaml_parser_scan_tag(yaml_parser_t *parser, yaml_token_t *token)
#define ALIAS_TOKEN_INIT(token, token_value, start_mark, end_mark)
static int yaml_parser_fetch_stream_start(yaml_parser_t *parser)
yaml_string_extend(yaml_char_t **start, yaml_char_t **pointer, yaml_char_t **end)
struct yaml_parser_s::@79 indents
The indentation levels stack.
int stream_start_produced
Have we started to scan the input stream?
static int yaml_parser_fetch_block_scalar(yaml_parser_t *parser, int literal)
static int yaml_parser_fetch_block_entry(yaml_parser_t *parser)
yaml_encoding_t encoding
The input encoding.
A BLOCK-SEQUENCE-END token.
if(len<=MAX_WORD_LENGTH &&len >=MIN_WORD_LENGTH)
#define READ(parser, string)
static int yaml_parser_fetch_flow_collection_end(yaml_parser_t *parser, yaml_token_type_t type)
static int yaml_parser_scan_tag_directive_value(yaml_parser_t *parser, yaml_mark_t mark, yaml_char_t **handle, yaml_char_t **prefix)
static int yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token, int literal)
unsigned char yaml_char_t
The character type (UTF-8 octet).
const unsigned char * start
The string start pointer.
const char * context
The error context.
yaml_mark_t mark
The position mark.
#define IS_BREAK_AT(string, offset)
static int yaml_parser_fetch_flow_scalar(yaml_parser_t *parser, int single)
#define READ_LINE(parser, string)
int indent
The current indentation level.
static int yaml_parser_scan_version_directive_value(yaml_parser_t *parser, yaml_mark_t start_mark, int *major, int *minor)
#define TAG_DIRECTIVE_TOKEN_INIT(token, token_handle, token_prefix, start_mark, end_mark)
static int yaml_parser_fetch_flow_collection_start(yaml_parser_t *parser, yaml_token_type_t type)
yaml_char_t * pointer
The current position of the buffer.
yaml_mark_t mark
The mark of the current position.
#define IS_HEX_AT(string, offset)
static int yaml_parser_remove_simple_key(yaml_parser_t *parser)
#define DEQUEUE(context, queue)
A FLOW-SEQUENCE-END token.
#define INITIAL_STRING_SIZE
#define STRING_DEL(context, string)
#define AS_HEX_AT(string, offset)
int * top
The top of the stack.
#define QUEUE_INSERT(context, queue, index, value)
static int yaml_parser_fetch_next_token(yaml_parser_t *parser)
int required
Is a simple key required?
int simple_key_allowed
May a simple key occur at the current position?
#define CACHE(parser, length)
static int yaml_parser_fetch_document_indicator(yaml_parser_t *parser, yaml_token_type_t type)
static int yaml_parser_scan_uri_escapes(yaml_parser_t *parser, int directive, yaml_mark_t start_mark, yaml_string_t *string)
static int yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column)
static int yaml_parser_fetch_stream_end(yaml_parser_t *parser)
static int yaml_parser_set_scanner_error(yaml_parser_t *parser, const char *context, yaml_mark_t context_mark, const char *problem)
#define IS_BREAKZ(string)
static int yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser, int *indent, yaml_string_t *breaks, yaml_mark_t start_mark, yaml_mark_t *end_mark)
yaml_token_delete(yaml_token_t *token)
Free any memory allocated for a token object.
#define TOKEN_INIT(token, token_type, token_start_mark, token_end_mark)
static int yaml_parser_fetch_tag(yaml_parser_t *parser)
#define YAML_DECLARE(type)
The public API declaration.
A FLOW-MAPPING-START token.
static int yaml_parser_decrease_flow_level(yaml_parser_t *parser)
#define TAG_TOKEN_INIT(token, token_handle, token_suffix, start_mark, end_mark)
#define IS_BLANK_AT(string, offset)
yaml_error_type_t error
Error type.
static int yaml_parser_scan_tag_handle(yaml_parser_t *parser, int directive, yaml_mark_t start_mark, yaml_char_t **handle)
#define STREAM_START_TOKEN_INIT(token, token_encoding, start_mark, end_mark)
static int yaml_parser_fetch_value(yaml_parser_t *parser)
struct yaml_parser_s::@80 simple_keys
The stack of simple keys.
#define CHECK_AT(string, octet, offset)
struct yaml_parser_s::@76 buffer
The working buffer.
size_t token_number
The number of the token.
static int yaml_parser_fetch_flow_entry(yaml_parser_t *parser)
static int yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
static int yaml_parser_increase_flow_level(yaml_parser_t *parser)
enum yaml_token_type_e yaml_token_type_t
Token types.
yaml_token_t * head
The head of the tokens queue.
#define ENQUEUE(context, queue, value)
#define JOIN(context, string_a, string_b)
#define ANCHOR_TOKEN_INIT(token, token_value, start_mark, end_mark)
#define SCALAR_TOKEN_INIT(token, token_value, token_length, token_style, start_mark, end_mark)
yaml_mark_t context_mark
The context position.
static int yaml_parser_fetch_anchor(yaml_parser_t *parser, yaml_token_type_t type)
A FLOW-MAPPING-END token.
yaml_mark_t problem_mark
The problem position.
size_t tokens_parsed
The number of tokens fetched from the queue.
static int yaml_parser_save_simple_key(yaml_parser_t *parser)
#define STRING_EXTEND(context, string)
#define IS_BLANKZ_AT(string, offset)
static int yaml_parser_scan_to_next_token(yaml_parser_t *parser)
#define STRING_INIT(context, string, size)
#define STREAM_END_TOKEN_INIT(token, start_mark, end_mark)
static int yaml_parser_scan_tag_uri(yaml_parser_t *parser, int directive, yaml_char_t *head, yaml_mark_t start_mark, yaml_char_t **uri)
This structure holds information about a potential simple key.
#define MAX_NUMBER_LENGTH
The literal scalar style.
static int yaml_parser_scan_anchor(yaml_parser_t *parser, yaml_token_t *token, yaml_token_type_t type)
size_t line
The position line.
#define POP(context, stack)
static VALUE mark(VALUE self)
static int yaml_parser_stale_simple_keys(yaml_parser_t *parser)
Cannot scan the input stream.
static int yaml_parser_fetch_key(yaml_parser_t *parser)
size_t index
The position index.
static int yaml_parser_scan_version_directive_number(yaml_parser_t *parser, yaml_mark_t start_mark, int *number)
#define IS_BLANKZ(string)
yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token)
Scan the input stream and produce the next token.
const char * problem
Error description.
int possible
Is a simple key possible?
yaml_parser_fetch_more_tokens(yaml_parser_t *parser)
static int yaml_parser_scan_directive_name(yaml_parser_t *parser, yaml_mark_t start_mark, yaml_char_t **name)
#define VERSION_DIRECTIVE_TOKEN_INIT(token, token_major, token_minor, start_mark, end_mark)
size_t column
The position column.
int flow_level
The number of unclosed '[' and '{' indicators.
static int yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column, ptrdiff_t number, yaml_token_type_t type, yaml_mark_t mark)
#define SKIP_LINE(parser)
#define CLEAR(context, string)
static int yaml_parser_fetch_plain_scalar(yaml_parser_t *parser)
The single-quoted scalar style.