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) {
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;
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;
2636 directive, start_mark, &
string))
goto error;
2639 if (!
READ(parser,
string))
goto error;
2643 if (!
CACHE(parser, 1))
goto error;
2653 "while parsing a %TAG directive" :
"while parsing a tag",
2654 start_mark,
"did not find expected tag URI");
2658 *uri =
string.start;
2681 unsigned char octet = 0;
2685 if (!
CACHE(parser, 3))
return 0;
2691 "while parsing a %TAG directive" :
"while parsing a tag",
2692 start_mark,
"did not find URI escaped octet");
2703 width = (octet & 0x80) == 0x00 ? 1 :
2704 (octet & 0xE0) == 0xC0 ? 2 :
2705 (octet & 0xF0) == 0xE0 ? 3 :
2706 (octet & 0xF8) == 0xF0 ? 4 : 0;
2709 "while parsing a %TAG directive" :
"while parsing a tag",
2710 start_mark,
"found an incorrect leading UTF-8 octet");
2717 if ((octet & 0xC0) != 0x80) {
2719 "while parsing a %TAG directive" :
"while parsing a tag",
2720 start_mark,
"found an incorrect trailing UTF-8 octet");
2726 *(
string->pointer++) = octet;
2752 int leading_blank = 0;
2753 int trailing_blank = 0;
2761 start_mark = parser->
mark;
2767 if (!
CACHE(parser, 1))
goto error;
2781 if (!
CACHE(parser, 1))
goto error;
2789 start_mark,
"found an intendation indicator equal to 0");
2807 start_mark,
"found an intendation indicator equal to 0");
2815 if (!
CACHE(parser, 1))
goto error;
2826 if (!
CACHE(parser, 1))
goto error;
2830 if (!
CACHE(parser, 1))
goto error;
2836 if (!
CACHE(parser, 1))
goto error;
2844 start_mark,
"did not find expected comment or line break");
2851 if (!
CACHE(parser, 2))
goto error;
2855 end_mark = parser->
mark;
2860 indent = parser->
indent >= 0 ? parser->
indent+increment : increment;
2866 start_mark, &end_mark))
goto error;
2870 if (!
CACHE(parser, 1))
goto error;
2884 if (!literal && (*leading_break.
start ==
'\n')
2885 && !leading_blank && !trailing_blank)
2889 if (*trailing_breaks.
start ==
'\0') {
2891 *(
string.pointer ++) =
' ';
2894 CLEAR(parser, leading_break);
2897 if (!
JOIN(parser,
string, leading_break))
goto error;
2898 CLEAR(parser, leading_break);
2903 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2904 CLEAR(parser, trailing_breaks);
2913 if (!
READ(parser,
string))
goto error;
2914 if (!
CACHE(parser, 1))
goto error;
2919 if (!
CACHE(parser, 2))
goto error;
2921 if (!
READ_LINE(parser, leading_break))
goto error;
2926 &indent, &trailing_breaks, start_mark, &end_mark))
goto error;
2931 if (chomping != -1) {
2932 if (!
JOIN(parser,
string, leading_break))
goto error;
2934 if (chomping == 1) {
2935 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
2942 start_mark, end_mark);
2969 *end_mark = parser->
mark;
2977 if (!
CACHE(parser, 1))
return 0;
2979 while ((!*indent || (
int)parser->
mark.
column < *indent)
2982 if (!
CACHE(parser, 1))
return 0;
2993 start_mark,
"found a tab character where an intendation space is expected");
3002 if (!
CACHE(parser, 2))
return 0;
3003 if (!
READ_LINE(parser, *breaks))
return 0;
3004 *end_mark = parser->
mark;
3010 *indent = max_indent;
3011 if (*indent < parser->indent + 1)
3012 *indent = parser->
indent + 1;
3043 start_mark = parser->
mark;
3053 if (!
CACHE(parser, 4))
goto error;
3065 start_mark,
"found unexpected document indicator");
3073 start_mark,
"found unexpected end of stream");
3079 if (!
CACHE(parser, 2))
goto error;
3091 *(
string.pointer++) =
'\'';
3098 else if (
CHECK(parser->
buffer, single ?
'\'' :
'"'))
3108 if (!
CACHE(parser, 3))
goto error;
3119 size_t code_length = 0;
3128 *(
string.pointer++) =
'\0';
3132 *(
string.pointer++) =
'\x07';
3136 *(
string.pointer++) =
'\x08';
3141 *(
string.pointer++) =
'\x09';
3145 *(
string.pointer++) =
'\x0A';
3149 *(
string.pointer++) =
'\x0B';
3153 *(
string.pointer++) =
'\x0C';
3157 *(
string.pointer++) =
'\x0D';
3161 *(
string.pointer++) =
'\x1B';
3165 *(
string.pointer++) =
'\x20';
3169 *(
string.pointer++) =
'"';
3173 *(
string.pointer++) =
'\'';
3177 *(
string.pointer++) =
'\\';
3181 *(
string.pointer++) =
'\xC2';
3182 *(
string.pointer++) =
'\x85';
3186 *(
string.pointer++) =
'\xC2';
3187 *(
string.pointer++) =
'\xA0';
3191 *(
string.pointer++) =
'\xE2';
3192 *(
string.pointer++) =
'\x80';
3193 *(
string.pointer++) =
'\xA8';
3197 *(
string.pointer++) =
'\xE2';
3198 *(
string.pointer++) =
'\x80';
3199 *(
string.pointer++) =
'\xA9';
3216 start_mark,
"found unknown escape character");
3227 unsigned int value = 0;
3232 if (!
CACHE(parser, code_length))
goto error;
3234 for (k = 0; k < code_length; k ++) {
3237 start_mark,
"did not find expected hexdecimal number");
3245 if ((value >= 0xD800 && value <= 0xDFFF) || value > 0x10FFFF) {
3247 start_mark,
"found invalid Unicode character escape code");
3251 if (value <= 0x7F) {
3252 *(
string.pointer++) = value;
3254 else if (value <= 0x7FF) {
3255 *(
string.pointer++) = 0xC0 + (value >> 6);
3256 *(
string.pointer++) = 0x80 + (value & 0x3F);
3258 else if (value <= 0xFFFF) {
3259 *(
string.pointer++) = 0xE0 + (value >> 12);
3260 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3261 *(
string.pointer++) = 0x80 + (value & 0x3F);
3264 *(
string.pointer++) = 0xF0 + (value >> 18);
3265 *(
string.pointer++) = 0x80 + ((value >> 12) & 0x3F);
3266 *(
string.pointer++) = 0x80 + ((value >> 6) & 0x3F);
3267 *(
string.pointer++) = 0x80 + (value & 0x3F);
3272 for (k = 0; k < code_length; k ++) {
3282 if (!
READ(parser,
string))
goto error;
3285 if (!
CACHE(parser, 2))
goto error;
3295 if (!
CACHE(parser, 1))
goto error;
3303 if (!leading_blanks) {
3304 if (!
READ(parser, whitespaces))
goto error;
3312 if (!
CACHE(parser, 2))
goto error;
3316 if (!leading_blanks)
3318 CLEAR(parser, whitespaces);
3319 if (!
READ_LINE(parser, leading_break))
goto error;
3324 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3327 if (!
CACHE(parser, 1))
goto error;
3336 if (leading_break.
start[0] ==
'\n') {
3337 if (trailing_breaks.
start[0] ==
'\0') {
3339 *(
string.pointer++) =
' ';
3342 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3343 CLEAR(parser, trailing_breaks);
3345 CLEAR(parser, leading_break);
3348 if (!
JOIN(parser,
string, leading_break))
goto error;
3349 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3350 CLEAR(parser, leading_break);
3351 CLEAR(parser, trailing_breaks);
3356 if (!
JOIN(parser,
string, whitespaces))
goto error;
3357 CLEAR(parser, whitespaces);
3365 end_mark = parser->
mark;
3371 start_mark, end_mark);
3401 int leading_blanks = 0;
3402 int indent = parser->
indent+1;
3409 start_mark = end_mark = parser->
mark;
3417 if (!
CACHE(parser, 4))
goto error;
3443 start_mark,
"found unexpected ':'");
3459 if (leading_blanks || whitespaces.
start != whitespaces.
pointer)
3465 if (leading_break.
start[0] ==
'\n') {
3466 if (trailing_breaks.
start[0] ==
'\0') {
3468 *(
string.pointer++) =
' ';
3471 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3472 CLEAR(parser, trailing_breaks);
3474 CLEAR(parser, leading_break);
3477 if (!
JOIN(parser,
string, leading_break))
goto error;
3478 if (!
JOIN(parser,
string, trailing_breaks))
goto error;
3479 CLEAR(parser, leading_break);
3480 CLEAR(parser, trailing_breaks);
3487 if (!
JOIN(parser,
string, whitespaces))
goto error;
3488 CLEAR(parser, whitespaces);
3494 if (!
READ(parser,
string))
goto error;
3496 end_mark = parser->
mark;
3498 if (!
CACHE(parser, 2))
goto error;
3508 if (!
CACHE(parser, 1))
goto error;
3516 if (leading_blanks && (
int)parser->
mark.
column < indent
3519 start_mark,
"found a tab character that violate intendation");
3525 if (!leading_blanks) {
3526 if (!
READ(parser, whitespaces))
goto error;
3534 if (!
CACHE(parser, 2))
goto error;
3538 if (!leading_blanks)
3540 CLEAR(parser, whitespaces);
3541 if (!
READ_LINE(parser, leading_break))
goto error;
3546 if (!
READ_LINE(parser, trailing_breaks))
goto error;
3549 if (!
CACHE(parser, 1))
goto error;
3565 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)
memset(y->frac+ix+1, 0,(y->Prec-(ix+1))*sizeof(BDIGIT))
#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)
if(RB_TYPE_P(r, T_FLOAT))
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)
struct parser_params * parser
#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.