Remove source lines from parser error messages.

This was a gimmick in the first place. It doesn't work well with IO instances
(= requires re-reading of the input), the code was too complex and it wasn't
that useful in the end. Lets just get rid of it.

This fixes #53.
This commit is contained in:
Yorick Peterse committed 2014-09-25 22:58:06 +02:00
1 parent 8db77c0a09
commit 3307e2f4d2
2 files changed
+7 -60

No files matched your search

+4 -24
View File
@@ -16,32 +16,12 @@ describe Oga::XML::Parser do
expect { parse(@invalid_xml) }.to raise_error(Racc::ParseError)
end
example 'include the offending input when using String as input' do
# Racc basically reports errors at the last moment instead of where they
# *actually* occur.
partial = <<-EOF.strip
1. <person>
2. <name>Alice</name>
3. <age>25
4. <nationality>Dutch</nationality>
=> 5. </person>
EOF
parse_error(@invalid_xml).should =~ /#{partial}/
example 'include the line number when using a String as input' do
parse_error(@invalid_xml).should =~ /on line 5/
end
example 'include the offending input when using IO as input' do
# Racc basically reports errors at the last moment instead of where they
# *actually* occur.
partial = <<-EOF.strip
1. <person>
2. <name>Alice</name>
3. <age>25
4. <nationality>Dutch</nationality>
=> 5. </person>
EOF
parse_error(StringIO.new(@invalid_xml)).should =~ /#{partial}/
example 'include the line number when using an IO as input' do
parse_error(StringIO.new(@invalid_xml)).should =~ /on line 5/
end
example 'use more friendly error messages when available' do