Sync with latest HTML5lib

This commit is contained in:
Jacques Distler 2007-10-06 11:55:58 -05:00
parent 3a3cfeaa9b
commit 55fdc9fff4
18 changed files with 266 additions and 124 deletions

View file

@ -1,5 +1,6 @@
#!/usr/bin/env ruby
require 'core_ext/string'
$:.unshift File.dirname(__FILE__), 'lib'
def parse(opts, args)
@ -82,7 +83,7 @@ def print_output(parser, document, opts)
if opts.error
errList=[]
for pos, errorcode, datavars in parser.errors
errList << "Line %i Col %i"%pos + " " + constants.E.get(errorcode, 'Unknown error "%s"' % errorcode) % datavars
errList << "Line #{pos[0]} Col #{pos[1]} " + (HTML5::E[errorcode] || "Unknown error \"#{errorcode}\"") % datavars
end
$stdout.write("\nParse errors:\n" + errList.join("\n")+"\n")
end