ruby-changes:18665
From: yugui <ko1@a...>
Date: Fri, 28 Jan 2011 11:26:00 +0900 (JST)
Subject: [ruby-changes:18665] Ruby:r30691 (ruby_1_9_2): merges r30628 from trunk into ruby_1_9_2.
yugui 2011-01-28 11:25:31 +0900 (Fri, 28 Jan 2011) New Revision: 30691 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30691 Log: merges r30628 from trunk into ruby_1_9_2. -- * ext/psych/parser.c (parse): fixing off-by-one error on line numbers in parse exceptions. [ruby-core:34690] * test/psych/test_parser.rb: test for error Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/ext/psych/parser.c branches/ruby_1_9_2/test/psych/test_parser.rb branches/ruby_1_9_2/version.h Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 30690) +++ ruby_1_9_2/ChangeLog (revision 30691) @@ -1,3 +1,10 @@ +Sat Jan 22 11:21:40 2011 Aaron Patterson <aaron@t...> + + * ext/psych/parser.c (parse): fixing off-by-one error on line numbers + in parse exceptions. [ruby-core:34690] + + * test/psych/test_parser.rb: test for error + Wed Jan 19 13:04:16 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * proc.c (proc_call): Add gc guard to avoid segfault. The fix Index: ruby_1_9_2/ext/psych/parser.c =================================================================== --- ruby_1_9_2/ext/psych/parser.c (revision 30690) +++ ruby_1_9_2/ext/psych/parser.c (revision 30691) @@ -75,7 +75,7 @@ while(!done) { if(!yaml_parser_parse(&parser, &event)) { - size_t line = parser.mark.line; + size_t line = parser.mark.line + 1; size_t column = parser.mark.column; yaml_parser_delete(&parser); Index: ruby_1_9_2/version.h =================================================================== --- ruby_1_9_2/version.h (revision 30690) +++ ruby_1_9_2/version.h (revision 30691) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_PATCHLEVEL 168 +#define RUBY_PATCHLEVEL 169 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 Index: ruby_1_9_2/test/psych/test_parser.rb =================================================================== --- ruby_1_9_2/test/psych/test_parser.rb (revision 30690) +++ ruby_1_9_2/test/psych/test_parser.rb (revision 30691) @@ -46,6 +46,21 @@ end end + # ruby-core:34690 + def test_exception_line + e = assert_raises(Psych::SyntaxError) do + @parser.parse(<<-eoyaml) +# based on "SGML/XML character entity reference" at http://www.bitjungle.com/isoent/ +# +--- +#DOUBLE LOW-9 QUOTATION MARK +#requires fontenc:T1 +ldquor: ,, + eoyaml + end + assert_match 'line 6', e.message + end + def test_mapping_end @parser.parse("---\n!!map { key: value }") assert_called :end_mapping -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/