aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 00:40:04 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-14 00:40:04 +0000
commit687f39628e816d3fa9250cb708d7c45b53cf2b72 (patch)
tree32521aaaee1076df07ad8e92327fd6902d0c1cbc
parent7a4b1ad9754d40d81c9228a56415b6b9021d8eb8 (diff)
downloadruby-687f39628e816d3fa9250cb708d7c45b53cf2b72.tar.gz
Update bundled psych to 2.2.0.
* Merge libyaml-0.1.7 for bundled-libyaml option. * Update canonical url to https://github.com/ruby/psych. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ext/psych/psych.gemspec16
-rw-r--r--ext/psych/yaml/api.c57
-rw-r--r--ext/psych/yaml/config.h12
-rw-r--r--ext/psych/yaml/emitter.c16
-rw-r--r--ext/psych/yaml/loader.c25
-rw-r--r--ext/psych/yaml/parser.c14
-rw-r--r--ext/psych/yaml/reader.c6
-rw-r--r--ext/psych/yaml/scanner.c56
-rw-r--r--ext/psych/yaml/writer.c2
-rw-r--r--ext/psych/yaml/yaml_private.h4
10 files changed, 86 insertions, 122 deletions
diff --git a/ext/psych/psych.gemspec b/ext/psych/psych.gemspec
index 4c0cb65214..d7766abb51 100644
--- a/ext/psych/psych.gemspec
+++ b/ext/psych/psych.gemspec
@@ -2,32 +2,32 @@
Gem::Specification.new do |s|
s.name = "psych"
- s.version = "2.1.1"
+ s.version = "2.2.0"
s.authors = ["Aaron Patterson", "SHIBATA Hiroshi"]
s.email = ["aaron@tenderlovemaking.com", "hsbt@ruby-lang.org"]
- s.date = "2016-09-07"
+ s.date = "2016-11-14"
s.summary = "Psych is a YAML parser and emitter"
s.description = <<-DESCRIPTION
Psych is a YAML parser and emitter. Psych leverages libyaml[http://pyyaml.org/wiki/LibYAML]
for its YAML parsing and emitting capabilities. In addition to wrapping libyaml,
Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.
DESCRIPTION
- s.homepage = "http://github.com/tenderlove/psych"
+ s.homepage = "https://github.com/ruby/psych"
s.licenses = ["MIT"]
s.require_paths = ["lib"]
# for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
- s.files = [".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.rdoc", "Rakefile", "bin/console", "bin/setup", "ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java", "ext/java/PsychYamlTree.java", "ext/psych/.gitignore", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "lib/psych_jars.rb", "psych.gemspec"]
+ s.files = [".gitignore", ".travis.yml", "CHANGELOG.rdoc", "Gemfile", "Mavenfile", "README.md", "Rakefile", "bin/console", "bin/setup", "ext/java/PsychEmitter.java", "ext/java/PsychLibrary.java", "ext/java/PsychParser.java", "ext/java/PsychToRuby.java", "ext/java/PsychYamlTree.java", "ext/psych/.gitignore", "ext/psych/depend", "ext/psych/extconf.rb", "ext/psych/psych.c", "ext/psych/psych.h", "ext/psych/psych_emitter.c", "ext/psych/psych_emitter.h", "ext/psych/psych_parser.c", "ext/psych/psych_parser.h", "ext/psych/psych_to_ruby.c", "ext/psych/psych_to_ruby.h", "ext/psych/psych_yaml_tree.c", "ext/psych/psych_yaml_tree.h", "ext/psych/yaml/LICENSE", "ext/psych/yaml/api.c", "ext/psych/yaml/config.h", "ext/psych/yaml/dumper.c", "ext/psych/yaml/emitter.c", "ext/psych/yaml/loader.c", "ext/psych/yaml/parser.c", "ext/psych/yaml/reader.c", "ext/psych/yaml/scanner.c", "ext/psych/yaml/writer.c", "ext/psych/yaml/yaml.h", "ext/psych/yaml/yaml_private.h", "lib/psych.rb", "lib/psych/class_loader.rb", "lib/psych/coder.rb", "lib/psych/core_ext.rb", "lib/psych/deprecated.rb", "lib/psych/exception.rb", "lib/psych/handler.rb", "lib/psych/handlers/document_stream.rb", "lib/psych/handlers/recorder.rb", "lib/psych/json/ruby_events.rb", "lib/psych/json/stream.rb", "lib/psych/json/tree_builder.rb", "lib/psych/json/yaml_events.rb", "lib/psych/nodes.rb", "lib/psych/nodes/alias.rb", "lib/psych/nodes/document.rb", "lib/psych/nodes/mapping.rb", "lib/psych/nodes/node.rb", "lib/psych/nodes/scalar.rb", "lib/psych/nodes/sequence.rb", "lib/psych/nodes/stream.rb", "lib/psych/omap.rb", "lib/psych/parser.rb", "lib/psych/scalar_scanner.rb", "lib/psych/set.rb", "lib/psych/stream.rb", "lib/psych/streaming.rb", "lib/psych/syntax_error.rb", "lib/psych/tree_builder.rb", "lib/psych/versions.rb", "lib/psych/visitors.rb","lib/psych/visitors/depth_first.rb", "lib/psych/visitors/emitter.rb", "lib/psych/visitors/json_tree.rb", "lib/psych/visitors/to_ruby.rb", "lib/psych/visitors/visitor.rb", "lib/psych/visitors/yaml_tree.rb", "lib/psych/y.rb", "lib/psych_jars.rb", "psych.gemspec"]
- s.rdoc_options = ["--main", "README.rdoc"]
- s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.rdoc", "CHANGELOG.rdoc", "README.rdoc"]
+ s.rdoc_options = ["--main", "README.md"]
+ s.extra_rdoc_files = ["CHANGELOG.rdoc", "README.md"]
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
s.rubygems_version = "2.5.1"
s.required_rubygems_version = Gem::Requirement.new(">= 0")
- s.add_development_dependency(%q<rake-compiler>, [">= 0.4.1"])
- s.add_development_dependency(%q<minitest>, ["~> 5.0"])
+ s.add_development_dependency 'rake-compiler', ">= 0.4.1"
+ s.add_development_dependency 'minitest', "~> 5.0"
if RUBY_PLATFORM =~ /java/
require 'psych/versions'
diff --git a/ext/psych/yaml/api.c b/ext/psych/yaml/api.c
index e0b9d979cc..b1a8da0bda 100644
--- a/ext/psych/yaml/api.c
+++ b/ext/psych/yaml/api.c
@@ -395,7 +395,7 @@ yaml_emitter_delete(yaml_emitter_t *emitter)
}
QUEUE_DEL(emitter, emitter->events);
STACK_DEL(emitter, emitter->indents);
- while (!STACK_EMPTY(emitter, emitter->tag_directives)) {
+ while (!STACK_EMPTY(empty, emitter->tag_directives)) {
yaml_tag_directive_t tag_directive = POP(emitter, emitter->tag_directives);
yaml_free(tag_directive.handle);
yaml_free(tag_directive.prefix);
@@ -415,7 +415,7 @@ yaml_string_write_handler(void *data, unsigned char *buffer, size_t size)
{
yaml_emitter_t *emitter = data;
- if (emitter->output.string.size + *emitter->output.string.size_written
+ if (emitter->output.string.size - *emitter->output.string.size_written
< size) {
memcpy(emitter->output.string.buffer
+ *emitter->output.string.size_written,
@@ -822,7 +822,6 @@ yaml_scalar_event_initialize(yaml_event_t *event,
yaml_char_t *anchor_copy = NULL;
yaml_char_t *tag_copy = NULL;
yaml_char_t *value_copy = NULL;
- size_t value_length;
assert(event); /* Non-NULL event object is expected. */
assert(value); /* Non-NULL anchor is expected. */
@@ -840,19 +839,16 @@ yaml_scalar_event_initialize(yaml_event_t *event,
}
if (length < 0) {
- value_length = strlen((char *)value);
- }
- else {
- value_length = (size_t)length;
+ length = strlen((char *)value);
}
- if (!yaml_check_utf8(value, value_length)) goto error;
- value_copy = yaml_malloc(value_length+1);
+ if (!yaml_check_utf8(value, length)) goto error;
+ value_copy = yaml_malloc(length+1);
if (!value_copy) goto error;
- memcpy(value_copy, value, value_length);
- value_copy[value_length] = '\0';
+ memcpy(value_copy, value, length);
+ value_copy[length] = '\0';
- SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, value_length,
+ SCALAR_EVENT_INIT(*event, anchor_copy, tag_copy, value_copy, length,
plain_implicit, quoted_implicit, style, mark, mark);
return 1;
@@ -1206,8 +1202,6 @@ yaml_document_add_scalar(yaml_document_t *document,
yaml_char_t *tag_copy = NULL;
yaml_char_t *value_copy = NULL;
yaml_node_t node;
- size_t value_length;
- ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
assert(value); /* Non-NULL value is expected. */
@@ -1221,26 +1215,19 @@ yaml_document_add_scalar(yaml_document_t *document,
if (!tag_copy) goto error;
if (length < 0) {
- value_length = strlen((char *)value);
- }
- else {
- value_length = (size_t)length;
+ length = strlen((char *)value);
}
- if (!yaml_check_utf8(value, value_length)) goto error;
- value_copy = yaml_malloc(value_length+1);
+ if (!yaml_check_utf8(value, length)) goto error;
+ value_copy = yaml_malloc(length+1);
if (!value_copy) goto error;
- memcpy(value_copy, value, value_length);
- value_copy[value_length] = '\0';
+ memcpy(value_copy, value, length);
+ value_copy[length] = '\0';
- SCALAR_NODE_INIT(node, tag_copy, value_copy, value_length, style, mark, mark);
+ SCALAR_NODE_INIT(node, tag_copy, value_copy, length, style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- ret = document->nodes.top - document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (ret > INT_MAX) goto error;
-#endif
- return (int)ret;
+ return document->nodes.top - document->nodes.start;
error:
yaml_free(tag_copy);
@@ -1268,7 +1255,6 @@ yaml_document_add_sequence(yaml_document_t *document,
yaml_node_item_t *top;
} items = { NULL, NULL, NULL };
yaml_node_t node;
- ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
@@ -1286,11 +1272,7 @@ yaml_document_add_sequence(yaml_document_t *document,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- ret = document->nodes.top - document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (ret > INT_MAX) goto error;
-#endif
- return (int)ret;
+ return document->nodes.top - document->nodes.start;
error:
STACK_DEL(&context, items);
@@ -1318,7 +1300,6 @@ yaml_document_add_mapping(yaml_document_t *document,
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
yaml_node_t node;
- ptrdiff_t ret;
assert(document); /* Non-NULL document object is expected. */
@@ -1336,11 +1317,7 @@ yaml_document_add_mapping(yaml_document_t *document,
style, mark, mark);
if (!PUSH(&context, document->nodes, node)) goto error;
- ret = document->nodes.top - document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (ret > INT_MAX) goto error;
-#endif
- return (int)ret;
+ return document->nodes.top - document->nodes.start;
error:
STACK_DEL(&context, pairs);
diff --git a/ext/psych/yaml/config.h b/ext/psych/yaml/config.h
index f54c27d339..79e8501f4f 100644
--- a/ext/psych/yaml/config.h
+++ b/ext/psych/yaml/config.h
@@ -1,10 +1,10 @@
#define PACKAGE_NAME "yaml"
#define PACKAGE_TARNAME "yaml"
-#define PACKAGE_VERSION "0.1.6"
-#define PACKAGE_STRING "yaml 0.1.6"
-#define PACKAGE_BUGREPORT "http://pyyaml.org/newticket?component libyaml"
-#define PACKAGE_URL ""
+#define PACKAGE_VERSION "0.1.7"
+#define PACKAGE_STRING "yaml 0.1.7"
+#define PACKAGE_BUGREPORT "https://github.com/yaml/libyaml/issues"
+#define PACKAGE_URL "https://github.com/yaml/libyaml"
#define YAML_VERSION_MAJOR 0
#define YAML_VERSION_MINOR 1
-#define YAML_VERSION_PATCH 6
-#define YAML_VERSION_STRING "0.1.6"
+#define YAML_VERSION_PATCH 7
+#define YAML_VERSION_STRING "0.1.7"
diff --git a/ext/psych/yaml/emitter.c b/ext/psych/yaml/emitter.c
index bf84fafc51..c4b56a26bb 100644
--- a/ext/psych/yaml/emitter.c
+++ b/ext/psych/yaml/emitter.c
@@ -53,7 +53,7 @@
#define WRITE_BREAK(emitter,string) \
(FLUSH(emitter) \
&& (CHECK(string,'\n') ? \
- ((void)PUT_BREAK(emitter), \
+ (PUT_BREAK(emitter), \
string.pointer ++, \
1) : \
(COPY(emitter->buffer,string), \
@@ -221,7 +221,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter);
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- const char *indicator, int need_whitespace,
+ char *indicator, int need_whitespace,
int is_whitespace, int is_indention);
static int
@@ -517,7 +517,7 @@ yaml_emitter_emit_stream_start(yaml_emitter_t *emitter,
if (emitter->best_width < 0) {
emitter->best_width = INT_MAX;
}
-
+
if (!emitter->line_break) {
emitter->line_break = YAML_LN_BREAK;
}
@@ -607,7 +607,7 @@ yaml_emitter_emit_document_start(yaml_emitter_t *emitter,
if (!yaml_emitter_write_indent(emitter))
return 0;
}
-
+
if (event->data.document_start.tag_directives.start
!= event->data.document_start.tag_directives.end) {
implicit = 0;
@@ -721,7 +721,7 @@ yaml_emitter_emit_document_end(yaml_emitter_t *emitter,
}
/*
- *
+ *
* Expect a flow item node.
*/
@@ -1402,7 +1402,7 @@ yaml_emitter_analyze_anchor(yaml_emitter_t *emitter,
{
size_t anchor_length;
yaml_string_t string;
-
+
anchor_length = strlen((char *)anchor);
STRING_ASSIGN(string, anchor, anchor_length);
@@ -1784,7 +1784,7 @@ yaml_emitter_write_indent(yaml_emitter_t *emitter)
static int
yaml_emitter_write_indicator(yaml_emitter_t *emitter,
- const char *indicator, int need_whitespace,
+ char *indicator, int need_whitespace,
int is_whitespace, int is_indention)
{
size_t indicator_length;
@@ -2178,7 +2178,7 @@ yaml_emitter_write_block_scalar_hints(yaml_emitter_t *emitter,
yaml_string_t string)
{
char indent_hint[2];
- const char *chomp_hint = NULL;
+ char *chomp_hint = NULL;
if (IS_SPACE(string) || IS_BREAK(string))
{
diff --git a/ext/psych/yaml/loader.c b/ext/psych/yaml/loader.c
index def67933e7..871149ab91 100644
--- a/ext/psych/yaml/loader.c
+++ b/ext/psych/yaml/loader.c
@@ -239,8 +239,8 @@ yaml_parser_register_anchor(yaml_parser_t *parser,
if (strcmp((char *)alias_data->anchor, (char *)anchor) == 0) {
yaml_free(anchor);
return yaml_parser_set_composer_error_context(parser,
- "found duplicate anchor; first occurrence",
- alias_data->mark, "second occurrence", data.mark);
+ "found duplicate anchor; first occurence",
+ alias_data->mark, "second occurence", data.mark);
}
}
@@ -283,7 +283,6 @@ static int
yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
{
yaml_node_t node;
- ptrdiff_t node_index;
int index;
yaml_char_t *tag = first_event->data.scalar.tag;
@@ -301,11 +300,7 @@ yaml_parser_load_scalar(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- node_index = parser->document->nodes.top - parser->document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (node_index > INT_MAX) goto error;
-#endif
- index = (int)node_index;
+ index = parser->document->nodes.top - parser->document->nodes.start;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.scalar.anchor)) return 0;
@@ -334,7 +329,6 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_node_item_t *top;
} items = { NULL, NULL, NULL };
int index, item_index;
- ptrdiff_t node_index;
yaml_char_t *tag = first_event->data.sequence_start.tag;
if (!STACK_LIMIT(parser, parser->document->nodes, INT_MAX-1)) goto error;
@@ -353,11 +347,7 @@ yaml_parser_load_sequence(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- node_index = parser->document->nodes.top - parser->document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (node_index > INT_MAX) goto error;
-#endif
- index = (int)node_index;
+ index = parser->document->nodes.top - parser->document->nodes.start;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.sequence_start.anchor)) return 0;
@@ -401,7 +391,6 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
yaml_node_pair_t *top;
} pairs = { NULL, NULL, NULL };
int index;
- ptrdiff_t node_index;
yaml_node_pair_t pair;
yaml_char_t *tag = first_event->data.mapping_start.tag;
@@ -421,11 +410,7 @@ yaml_parser_load_mapping(yaml_parser_t *parser, yaml_event_t *first_event)
if (!PUSH(parser, parser->document->nodes, node)) goto error;
- node_index = parser->document->nodes.top - parser->document->nodes.start;
-#if PTRDIFF_MAX > INT_MAX
- if (node_index > INT_MAX) goto error;
-#endif
- index = (int)node_index;
+ index = parser->document->nodes.top - parser->document->nodes.start;
if (!yaml_parser_register_anchor(parser, index,
first_event->data.mapping_start.anchor)) return 0;
diff --git a/ext/psych/yaml/parser.c b/ext/psych/yaml/parser.c
index 32671b252c..eb2a2c792b 100644
--- a/ext/psych/yaml/parser.c
+++ b/ext/psych/yaml/parser.c
@@ -759,8 +759,9 @@ yaml_parser_parse_block_sequence_entry(yaml_parser_t *parser,
else if (token->type == YAML_BLOCK_END_TOKEN)
{
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
parser->state = POP(parser, parser->states);
- (void)POP(parser, parser->marks);
+ dummy_mark = POP(parser, parser->marks);
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
SKIP_TOKEN(parser);
return 1;
@@ -868,8 +869,9 @@ yaml_parser_parse_block_mapping_key(yaml_parser_t *parser,
else if (token->type == YAML_BLOCK_END_TOKEN)
{
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
parser->state = POP(parser, parser->states);
- (void)POP(parser, parser->marks);
+ dummy_mark = POP(parser, parser->marks);
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
SKIP_TOKEN(parser);
return 1;
@@ -950,6 +952,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
yaml_event_t *event, int first)
{
yaml_token_t *token;
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
if (first) {
token = PEEK_TOKEN(parser);
@@ -994,7 +997,7 @@ yaml_parser_parse_flow_sequence_entry(yaml_parser_t *parser,
}
parser->state = POP(parser, parser->states);
- (void)POP(parser, parser->marks);
+ dummy_mark = POP(parser, parser->marks);
SEQUENCE_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
SKIP_TOKEN(parser);
return 1;
@@ -1101,6 +1104,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
yaml_event_t *event, int first)
{
yaml_token_t *token;
+ yaml_mark_t dummy_mark; /* Used to eliminate a compiler warning. */
if (first) {
token = PEEK_TOKEN(parser);
@@ -1154,7 +1158,7 @@ yaml_parser_parse_flow_mapping_key(yaml_parser_t *parser,
}
parser->state = POP(parser, parser->states);
- (void)POP(parser, parser->marks);
+ dummy_mark = POP(parser, parser->marks);
MAPPING_END_EVENT_INIT(*event, token->start_mark, token->end_mark);
SKIP_TOKEN(parser);
return 1;
@@ -1291,7 +1295,7 @@ yaml_parser_process_directives(yaml_parser_t *parser,
token = PEEK_TOKEN(parser);
if (!token) goto error;
}
-
+
for (default_tag_directive = default_tag_directives;
default_tag_directive->handle; default_tag_directive++) {
if (!yaml_parser_append_tag_directive(parser, *default_tag_directive, 1,
diff --git a/ext/psych/yaml/reader.c b/ext/psych/yaml/reader.c
index f1a06deb9d..d47921ce2b 100644
--- a/ext/psych/yaml/reader.c
+++ b/ext/psych/yaml/reader.c
@@ -52,7 +52,7 @@ yaml_parser_determine_encoding(yaml_parser_t *parser)
{
/* Ensure that we had enough bytes in the raw buffer. */
- while (!parser->eof
+ while (!parser->eof
&& parser->raw_buffer.last - parser->raw_buffer.pointer < 3) {
if (!yaml_parser_update_raw_buffer(parser)) {
return 0;
@@ -295,7 +295,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
parser->offset, value);
break;
-
+
case YAML_UTF16LE_ENCODING:
case YAML_UTF16BE_ENCODING:
@@ -318,7 +318,7 @@ yaml_parser_update_buffer(yaml_parser_t *parser, size_t length)
*
* The following formulas are used for decoding
* and encoding characters using surrogate pairs:
- *
+ *
* U = U' + 0x10000 (0x01 00 00 <= U <= 0x10 FF FF)
* U' = yyyyyyyyyyxxxxxxxxxx (0 <= U' <= 0x0F FF FF)
* W1 = 110110yyyyyyyyyy
diff --git a/ext/psych/yaml/scanner.c b/ext/psych/yaml/scanner.c
index 5e4875d7f9..5ec0be086d 100644
--- a/ext/psych/yaml/scanner.c
+++ b/ext/psych/yaml/scanner.c
@@ -70,7 +70,7 @@
* %TAG !yaml! tag:yaml.org,2002:
* ---
*
- * The corresponding sequence of tokens:
+ * The correspoding sequence of tokens:
*
* STREAM-START(utf-8)
* VERSION-DIRECTIVE(1,1)
@@ -762,7 +762,7 @@ yaml_parser_scan(yaml_parser_t *parser, yaml_token_t *token)
}
/* Fetch the next token from the queue. */
-
+
*token = DEQUEUE(parser, parser->tokens);
parser->token_available = 0;
parser->tokens_parsed ++;
@@ -1114,7 +1114,7 @@ yaml_parser_save_simple_key(yaml_parser_t *parser)
yaml_simple_key_t simple_key;
simple_key.possible = 1;
simple_key.required = required;
- simple_key.token_number =
+ simple_key.token_number =
parser->tokens_parsed + (parser->tokens.tail - parser->tokens.head);
simple_key.mark = parser->mark;
@@ -1186,9 +1186,11 @@ yaml_parser_increase_flow_level(yaml_parser_t *parser)
static int
yaml_parser_decrease_flow_level(yaml_parser_t *parser)
{
+ yaml_simple_key_t dummy_key; /* Used to eliminate a compiler warning. */
+
if (parser->flow_level) {
parser->flow_level --;
- (void)POP(parser, parser->simple_keys);
+ dummy_key = POP(parser, parser->simple_keys);
}
return 1;
@@ -1198,7 +1200,7 @@ yaml_parser_decrease_flow_level(yaml_parser_t *parser)
* 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.
- *
+ *
*/
static int
@@ -1222,14 +1224,12 @@ yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
if (!PUSH(parser, parser->indents, parser->indent))
return 0;
-#if PTRDIFF_MAX > INT_MAX
if (column > INT_MAX) {
parser->error = YAML_MEMORY_ERROR;
return 0;
}
-#endif
- parser->indent = (int)column;
+ parser->indent = column;
/* Create a token and insert it into the queue. */
@@ -1251,7 +1251,7 @@ yaml_parser_roll_indent(yaml_parser_t *parser, ptrdiff_t column,
/*
* Pop indentation levels from the indents stack until the current level
- * becomes less or equal to the column. For each indentation level, append
+ * becomes less or equal to the column. For each intendation level, append
* the BLOCK-END token.
*/
@@ -1266,7 +1266,7 @@ yaml_parser_unroll_indent(yaml_parser_t *parser, ptrdiff_t column)
if (parser->flow_level)
return 1;
- /* Loop through the indentation levels in the stack. */
+ /* Loop through the intendation levels in the stack. */
while (parser->indent > column)
{
@@ -1938,7 +1938,7 @@ yaml_parser_scan_to_next_token(yaml_parser_t *parser)
*
* - in the flow context;
* - in the block context, but not at the beginning of the line or
- * after '-', '?', or ':' (complex value).
+ * after '-', '?', or ':' (complex value).
*/
if (!CACHE(parser, 1)) return 0;
@@ -2053,7 +2053,7 @@ yaml_parser_scan_directive(yaml_parser_t *parser, yaml_token_t *token)
else
{
yaml_parser_set_scanner_error(parser, "while scanning a directive",
- start_mark, "found unknown directive name");
+ start_mark, "found uknown directive name");
goto error;
}
@@ -2775,15 +2775,15 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
if (IS_DIGIT(parser->buffer))
{
- /* Check that the indentation is greater than 0. */
+ /* Check that the intendation is greater than 0. */
if (CHECK(parser->buffer, '0')) {
yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found an indentation indicator equal to 0");
+ start_mark, "found an intendation indicator equal to 0");
goto error;
}
- /* Get the indentation level and eat the indicator. */
+ /* Get the intendation level and eat the indicator. */
increment = AS_DIGIT(parser->buffer);
@@ -2797,7 +2797,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
{
if (CHECK(parser->buffer, '0')) {
yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found an indentation indicator equal to 0");
+ start_mark, "found an intendation indicator equal to 0");
goto error;
}
@@ -2847,7 +2847,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
end_mark = parser->mark;
- /* Set the indentation level if it was specified. */
+ /* Set the intendation level if it was specified. */
if (increment) {
indent = parser->indent >= 0 ? parser->indent+increment : increment;
@@ -2913,7 +2913,7 @@ yaml_parser_scan_block_scalar(yaml_parser_t *parser, yaml_token_t *token,
if (!READ_LINE(parser, leading_break)) goto error;
- /* Eat the following indentation spaces and line breaks. */
+ /* Eat the following intendation spaces and line breaks. */
if (!yaml_parser_scan_block_scalar_breaks(parser,
&indent, &trailing_breaks, start_mark, &end_mark)) goto error;
@@ -2948,8 +2948,8 @@ error:
}
/*
- * Scan indentation spaces and line breaks for a block scalar. Determine the
- * indentation level if needed.
+ * Scan intendation spaces and line breaks for a block scalar. Determine the
+ * intendation level if needed.
*/
static int
@@ -2961,11 +2961,11 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
*end_mark = parser->mark;
- /* Eat the indentation spaces and line breaks. */
+ /* Eat the intendation spaces and line breaks. */
while (1)
{
- /* Eat the indentation spaces. */
+ /* Eat the intendation spaces. */
if (!CACHE(parser, 1)) return 0;
@@ -2978,12 +2978,12 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
if ((int)parser->mark.column > max_indent)
max_indent = (int)parser->mark.column;
- /* Check for a tab character messing the indentation. */
+ /* Check for a tab character messing the intendation. */
if ((!*indent || (int)parser->mark.column < *indent)
&& IS_TAB(parser->buffer)) {
return yaml_parser_set_scanner_error(parser, "while scanning a block scalar",
- start_mark, "found a tab character where an indentation space is expected");
+ start_mark, "found a tab character where an intendation space is expected");
}
/* Have we found a non-empty line? */
@@ -3007,7 +3007,7 @@ yaml_parser_scan_block_scalar_breaks(yaml_parser_t *parser,
*indent = 1;
}
- return 1;
+ return 1;
}
/*
@@ -3504,12 +3504,12 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
{
if (IS_BLANK(parser->buffer))
{
- /* Check for tab character that abuse indentation. */
+ /* Check for tab character that abuse intendation. */
if (leading_blanks && (int)parser->mark.column < indent
&& IS_TAB(parser->buffer)) {
yaml_parser_set_scanner_error(parser, "while scanning a plain scalar",
- start_mark, "found a tab character that violate indentation");
+ start_mark, "found a tab character that violate intendation");
goto error;
}
@@ -3542,7 +3542,7 @@ yaml_parser_scan_plain_scalar(yaml_parser_t *parser, yaml_token_t *token)
if (!CACHE(parser, 1)) goto error;
}
- /* Check indentation level. */
+ /* Check intendation level. */
if (!parser->flow_level && (int)parser->mark.column < indent)
break;
diff --git a/ext/psych/yaml/writer.c b/ext/psych/yaml/writer.c
index 5d57f392f1..b90019f5cb 100644
--- a/ext/psych/yaml/writer.c
+++ b/ext/psych/yaml/writer.c
@@ -74,7 +74,7 @@ yaml_emitter_flush(yaml_emitter_t *emitter)
unsigned int value;
size_t k;
- /*
+ /*
* See the "reader.c" code for more details on UTF-8 encoding. Note
* that we assume that the buffer contains a valid UTF-8 sequence.
*/
diff --git a/ext/psych/yaml/yaml_private.h b/ext/psych/yaml/yaml_private.h
index 944499c94e..ce262d3086 100644
--- a/ext/psych/yaml/yaml_private.h
+++ b/ext/psych/yaml/yaml_private.h
@@ -436,8 +436,7 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(stack).start = (stack).top = (stack).end = 0)
#define STACK_EMPTY(context,stack) \
- ((void)(context), \
- ((stack).start == (stack).top))
+ ((stack).start == (stack).top)
#define STACK_LIMIT(context,stack,size) \
((stack).top - (stack).start < (size) ? \
@@ -661,4 +660,3 @@ yaml_queue_extend(void **start, void **head, void **tail, void **end);
(node).data.mapping.pairs.end = (node_pairs_end), \
(node).data.mapping.pairs.top = (node_pairs_start), \
(node).data.mapping.style = (node_style))
-