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 ':'");
1151 "while scanning a simple key", simple_key->
mark,
1152 "could not find expected ':'");
1222 if (parser->
indent < column)
1232 #if PTRDIFF_MAX > INT_MAX
1233 if (column > INT_MAX) {
1239 parser->
indent = (int)column;
1278 while (parser->
indent > column)
1432 start_mark = parser->
mark;
1438 end_mark = parser->
mark;
1442 TOKEN_INIT(token, type, start_mark, end_mark);
1479 start_mark = parser->
mark;
1481 end_mark = parser->
mark;
1485 TOKEN_INIT(token, type, start_mark, end_mark);
1522 start_mark = parser->
mark;
1524 end_mark = parser->
mark;
1528 TOKEN_INIT(token, type, start_mark, end_mark);
1559 start_mark = parser->
mark;
1561 end_mark = parser->
mark;
1591 "block sequence entries are not allowed in this context");
1620 start_mark = parser->
mark;
1622 end_mark = parser->
mark;
1652 "mapping keys are not allowed in this context");
1673 start_mark = parser->
mark;
1675 end_mark = parser->
mark;
1738 "mapping values are not allowed in this context");
1755 start_mark = parser->
mark;
1757 end_mark = parser->
mark;
1936 if (!
CACHE(parser, 1))
return 0;
1951 if (!
CACHE(parser, 1))
return 0;
1957 if (!
CACHE(parser, 1))
return 0;
1965 if (!
CACHE(parser, 1))
return 0;
1973 if (!
CACHE(parser, 2))
return 0;
2013 start_mark = parser->
mark;
2024 if (strcmp((
char *)name,
"YAML") == 0)
2032 end_mark = parser->
mark;
2037 start_mark, end_mark);
2042 else if (strcmp((
char *)name,
"TAG") == 0)
2050 end_mark = parser->
mark;
2055 start_mark, end_mark);
2063 start_mark,
"found uknown directive name");
2069 if (!
CACHE(parser, 1))
goto error;
2073 if (!
CACHE(parser, 1))
goto error;
2079 if (!
CACHE(parser, 1))
goto error;
2087 start_mark,
"did not find expected comment or line break");
2094 if (!
CACHE(parser, 2))
goto error;
2129 if (!
CACHE(parser, 1))
goto error;
2133 if (!
READ(parser,
string))
goto error;
2134 if (!
CACHE(parser, 1))
goto error;
2139 if (
string.start ==
string.pointer) {
2141 start_mark,
"could not find expected directive name");
2149 start_mark,
"found unexpected non-alphabetical character");
2153 *name =
string.start;
2176 if (!
CACHE(parser, 1))
return 0;
2180 if (!
CACHE(parser, 1))
return 0;
2192 start_mark,
"did not find expected digit or '.' character");
2205 #define MAX_NUMBER_LENGTH 9
2226 if (!
CACHE(parser, 1))
return 0;
2234 start_mark,
"found extremely long version number");
2241 if (!
CACHE(parser, 1))
return 0;
2248 start_mark,
"did not find expected version number");
2273 if (!
CACHE(parser, 1))
goto error;
2277 if (!
CACHE(parser, 1))
goto error;
2287 if (!
CACHE(parser, 1))
goto error;
2291 start_mark,
"did not find expected whitespace");
2299 if (!
CACHE(parser, 1))
goto error;
2309 if (!
CACHE(parser, 1))
goto error;
2313 start_mark,
"did not find expected whitespace or line break");
2317 *handle = handle_value;
2318 *prefix = prefix_value;
2340 start_mark = parser->
mark;
2346 if (!
CACHE(parser, 1))
goto error;
2349 if (!
READ(parser,
string))
goto error;
2350 if (!
CACHE(parser, 1))
goto error;
2354 end_mark = parser->
mark;
2369 "while scanning an anchor" :
"while scanning an alias", start_mark,
2370 "did not find expected alphabetic or numeric character");
2401 start_mark = parser->
mark;
2405 if (!
CACHE(parser, 2))
goto error;
2412 if (!handle)
goto error;
2429 start_mark,
"did not find the expected '>'");
2446 if (handle[0] ==
'!' && handle[1] !=
'\0' && handle[
strlen((
char *)handle)-1] ==
'!')
2464 if (!handle)
goto error;
2473 if (suffix[0] ==
'\0') {
2483 if (!
CACHE(parser, 1))
goto error;
2487 start_mark,
"did not find expected whitespace or line break");
2491 end_mark = parser->
mark;
2519 if (!
CACHE(parser, 1))
goto error;
2523 "while scanning a tag directive" :
"while scanning a tag",
2524 start_mark,
"did not find expected '!'");
2530 if (!
READ(parser,
string))
goto error;
2534 if (!
CACHE(parser, 1))
goto error;
2538 if (!
READ(parser,
string))
goto error;
2539 if (!
CACHE(parser, 1))
goto error;
2546 if (!
READ(parser,
string))
goto error;
2556 if (directive && !(
string.start[0] ==
'!' &&
string.start[1] ==
'\0')) {
2558 start_mark,
"did not find expected '!'");
2563 *handle =
string.start;
2580 size_t length = head ?
strlen((
char *)head) : 0;
2587 while ((
size_t)(
string.end -
string.start) <= length) {
2601 memcpy(
string.start, head+1, length-1);
2602 string.pointer += length-1;
2607 if (!
CACHE(parser, 1))
goto error;
2633 directive, start_mark, &
string))
goto error;
2636 if (!
READ(parser,
string))
goto error;
2640 if (!
CACHE(parser, 1))
goto error;
2650 "while parsing a %TAG directive" :
"while parsing a tag",
2651 start_mark,
"did not find expected tag URI");
2655 *uri =
string.start;
2678 unsigned char octet = 0;
2682 if (!
CACHE(parser, 3))
return 0;
2688 "while parsing a %TAG directive" :
"while parsing a tag",
2689 start_mark,
"did not find URI escaped octet");
2700 width = (octet & 0x80) == 0x00 ? 1 :
2701 (octet & 0xE0) == 0xC0 ? 2 :
2702 (octet & 0xF0) == 0xE0 ? 3 :
2703 (octet & 0xF8) == 0xF0 ? 4 : 0;
2706 "while parsing a %TAG directive" :
"while parsing a tag",
2707 start_mark,
"found an incorrect leading UTF-8 octet");
2714 if ((octet & 0xC0) != 0x80) {
2716 "while parsing a %TAG directive" :
"while parsing a tag",
2717 start_mark,
"found an incorrect trailing UTF-8 octet");
2723 *(
string->pointer++) = octet;
2749 int leading_blank = 0;
2750 int trailing_blank = 0;
2758 start_mark = parser->
mark;
2764 if (!
CACHE(parser, 1))
goto error;
2778 if (!
CACHE(parser, 1))
goto error;
2786 start_mark,
"found an intendation indicator equal to 0");
2804 start_mark,
"found an intendation indicator equal to 0");
2812 if (!
CACHE(parser, 1))
goto error;
2823 if (!
CACHE(parser, 1))
goto error;
2827 if (!
CACHE(parser, 1))
goto error;
2833 if (!
CACHE(parser, 1))
goto error;
2841 start_mark,
"did not find expected comment or line break");
2848 if (!
CACHE(parser, 2))
goto error;
2852 end_mark = parser->
mark;
2857 indent = parser->
indent >= 0 ? parser->
indent+increment : increment;
2863 start_mark, &end_mark))
goto error;
2867 if (!
CACHE(parser, 1))
goto error;
2881 if (!literal && (*leading_break.
start ==
'\n')
2882 && !leading_blank && !trailing_blank)
2886 if (*trailing_breaks.
start ==
'\0') {
2888 *(
string.pointer ++) =
' ';
2891 CLEAR(parser, leading_break);
2894 if (!
JOIN(parser,
string, leading_break))
goto error;
2895 CLEAR(parser, leading_break);
2900 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2901 CLEAR(parser, trailing_breaks);
2910 if (!
READ(parser,
string))
goto error;
2911 if (!
CACHE(parser, 1))
goto error;
2916 if (!
CACHE(parser, 2))
goto error;
2918 if (!
READ_LINE(parser, leading_break))
goto error;
2923 &indent, &trailing_breaks, start_mark, &end_mark))
goto error;
2928 if (chomping != -1) {
2929 if (!
JOIN(parser,
string, leading_break))
goto error;
2931 if (chomping == 1) {
2932 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2939 start_mark, end_mark);
2966 *end_mark = parser->
mark;
2974 if (!
CACHE(parser, 1))
return 0;
2976 while ((!*indent || (
int)parser->
mark.
column < *indent)
2979 if (!
CACHE(parser, 1))
return 0;
2990 start_mark,
"found a tab character where an intendation space is expected");
2999 if (!
CACHE(parser, 2))
return 0;
3000 if (!
READ_LINE(parser, *breaks))
return 0;
3001 *end_mark = parser->
mark;
3007 *indent = max_indent;
3008 if (*indent < parser->indent + 1)
3009 *indent = parser->
indent + 1;
3040 start_mark = parser->
mark;
3050 if (!
CACHE(parser, 4))
goto error;
3062 start_mark,
"found unexpected document indicator");
3070 start_mark,
"found unexpected end of stream");
3076 if (!
CACHE(parser, 2))
goto error;
3088 *(
string.pointer++) =
'\'';
3095 else if (
CHECK(parser->
buffer, single ?
'\'' :
'"'))
3105 if (!
CACHE(parser, 3))
goto error;
3116 size_t code_length = 0;
3125 *(
string.pointer++) =
'\0';
3129 *(
string.pointer++) =
'\x07';
3133 *(
string.pointer++) =
'\x08';
3138 *(
string.pointer++) =
'\x09';
3142 *(
string.pointer++) =
'\x0A';
3146 *(
string.pointer++) =
'\x0B';
3150 *(
string.pointer++) =
'\x0C';
3154 *(
string.pointer++) =
'\x0D';
3158 *(
string.pointer++) =
'\x1B';
3162 *(
string.pointer++) =
'\x20';
3166 *(
string.pointer++) =
'"';
3170 *(
string.pointer++) =
'\'';
3174 *(
string.pointer++) =
'\\';
3178 *(
string.pointer++) =
'\xC2';
3179 *(
string.pointer++) =
'\x85';
3183 *(
string.pointer++) =
'\xC2';
3184 *(
string.pointer++) =
'\xA0';
3188 *(
string.pointer++) =
'\xE2';
3189 *(
string.pointer++) =
'\x80';
3190 *(
string.pointer++) =
'\xA8';
3194 *(
string.pointer++) =
'\xE2';
3195 *(
string.pointer++) =
'\x80';
3196 *(
string.pointer++) =
'\xA9';
3213 start_mark,
"found unknown escape character");
3224 unsigned int value = 0;
3229 if (!
CACHE(parser, code_length))
goto error;
3231 for (k = 0; k < code_length; k ++) {
3234 start_mark,
"did not find expected hexdecimal number");
3242 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
3244 start_mark,
"found invalid Unicode character escape code");
3248 if (value <= 0x7F) {
3249 *(
string.pointer++) = value;
3251 else if (value <= 0x7FF) {
3252 *(
string.pointer++) = 0xC0 + (value >> 6);
3253 *(
string.pointer++) = 0x80 + (value & 0x3F);
3255 else if (value <= 0xFFFF) {
3256 *(
string.pointer++) = 0xE0 + (value >> 12);
3257 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3258 *(
string.pointer++) = 0x80 + (value & 0x3F);
3261 *(
string.pointer++) = 0xF0 + (value >> 18);
3262 *(
string.pointer++) = 0x80 + ((value >> 12) & 0x3F);
3263 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3264 *(
string.pointer++) = 0x80 + (value & 0x3F);
3269 for (k = 0; k < code_length; k ++) {
3279 if (!
READ(parser,
string))
goto error;
3282 if (!
CACHE(parser, 2))
goto error;
3292 if (!
CACHE(parser, 1))
goto error;
3300 if (!leading_blanks) {
3301 if (!
READ(parser, whitespaces))
goto error;
3309 if (!
CACHE(parser, 2))
goto error;
3313 if (!leading_blanks)
3315 CLEAR(parser, whitespaces);
3316 if (!
READ_LINE(parser, leading_break))
goto error;
3321 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3324 if (!
CACHE(parser, 1))
goto error;
3333 if (leading_break.
start[0] ==
'\n') {
3334 if (trailing_breaks.
start[0] ==
'\0') {
3336 *(
string.pointer++) =
' ';
3339 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3340 CLEAR(parser, trailing_breaks);
3342 CLEAR(parser, leading_break);
3345 if (!
JOIN(parser,
string, leading_break))
goto error;
3346 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3347 CLEAR(parser, leading_break);
3348 CLEAR(parser, trailing_breaks);
3353 if (!
JOIN(parser,
string, whitespaces))
goto error;
3354 CLEAR(parser, whitespaces);
3362 end_mark = parser->
mark;
3368 start_mark, end_mark);
3398 int leading_blanks = 0;
3399 int indent = parser->
indent+1;
3406 start_mark = end_mark = parser->
mark;
3414 if (!
CACHE(parser, 4))
goto error;
3440 start_mark,
"found unexpected ':'");
3456 if (leading_blanks || whitespaces.
start != whitespaces.
pointer)
3462 if (leading_break.
start[0] ==
'\n') {
3463 if (trailing_breaks.
start[0] ==
'\0') {
3465 *(
string.pointer++) =
' ';
3468 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3469 CLEAR(parser, trailing_breaks);
3471 CLEAR(parser, leading_break);
3474 if (!
JOIN(parser,
string, leading_break))
goto error;
3475 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3476 CLEAR(parser, leading_break);
3477 CLEAR(parser, trailing_breaks);
3484 if (!
JOIN(parser,
string, whitespaces))
goto error;
3485 CLEAR(parser, whitespaces);
3491 if (!
READ(parser,
string))
goto error;
3493 end_mark = parser->
mark;
3495 if (!
CACHE(parser, 2))
goto error;
3505 if (!
CACHE(parser, 1))
goto error;
3513 if (leading_blanks && (
int)parser->
mark.
column < indent
3516 start_mark,
"found a tab character that violate intendation");
3522 if (!leading_blanks) {
3523 if (!
READ(parser, whitespaces))
goto error;
3531 if (!
CACHE(parser, 2))
goto error;
3535 if (!leading_blanks)
3537 CLEAR(parser, whitespaces);
3538 if (!
READ_LINE(parser, leading_break))
goto error;
3543 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3546 if (!
CACHE(parser, 1))
goto error;
3562 if (leading_blanks) {
The double-quoted scalar style.
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.
struct yaml_parser_s::@38 buffer
The working buffer.
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::@40 tokens
The tokens queue.
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.
#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)
#define CHECK(string, octet)
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)
struct yaml_parser_s::@41 indents
The indentation levels stack.
#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)
#define CHECK_AT(string, octet, offset)
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)
struct yaml_parser_s::@42 simple_keys
The stack of simple keys.
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.
#define assert(condition)
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.