summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-09 00:27:04 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-09 00:27:04 +0000
commitd5e6c167625625ef9ccdb096c511475385b7f86b (patch)
tree90d4dd6c3892ade4b6fb1e84056020b82ca0bded
parent39051ba1b94c61e92f333e514982c8f1333c7223 (diff)
* parse.y: Improve duplicate key warning with patch by @andremedeiros
[Fix GH-938] https://github.com/ruby/ruby/pull/938 [Bug #11327] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cec84e4..ed524c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Jul 9 09:25:50 2015 Zachary Scott <e@zzak.io>
+
+ * parse.y: Improve duplicate key warning with patch by @andremedeiros
+ [Fix GH-938] https://github.com/ruby/ruby/pull/938 [Bug #11327]
+
Wed Jul 8 07:43:01 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* lib/csv.rb: typo fix [ci skip][fix GH-958] Patch by @henrik
diff --git a/parse.y b/parse.y
index a53a041..6751404 100644
--- a/parse.y
+++ b/parse.y
@@ -9934,8 +9934,8 @@ remove_duplicate_keys(struct parser_params *parser, NODE *hash)
if (nd_type(head) == NODE_LIT &&
st_lookup(literal_keys, (key = head->nd_lit), &data)) {
rb_compile_warn(ruby_sourcefile, nd_line((NODE *)data),
- "duplicated key at line %d ignored: %+"PRIsVALUE,
- nd_line(head), head->nd_lit);
+ "key %+"PRIsVALUE" is duplicated and overwritten on line %d",
+ head->nd_lit, nd_line(head));
head = ((NODE *)data)->nd_next;
head->nd_head = block_append(head->nd_head, value->nd_head);
}