Permalink
Browse files

Fix doof bug

  • Loading branch information...
nickg committed Jun 18, 2008
1 parent ffc6b6f commit 18d0c3108b5be474f9c5da8ce2f5b2ba09ccd7b7
Showing with 11 additions and 1 deletion.
  1. +2 −0 bibtex/parser.rb
  2. +8 −0 bibtex/test_parser.rb
  3. +1 −1 tara_no_url.rb
View
@@ -65,6 +65,8 @@ def self.parse_value
if brace_count == 0 then
@lexer.ignore_whitespace = true
return str
+ else
+ str += '}'
end
when :lbrace
str += '{'
View
@@ -12,4 +12,12 @@ def test_basic
assert_equal EntryType::Article, ryan98.type
assert_equal 1998, ryan98[:year].to_i
end
+
+ def test_parse_reparse
+ fname = '/tmp/example.bib.stripped'
+ b = Parser.parse 'example.bib'
+ b.save fname
+ Parser.parse fname
+ File.delete fname
+ end
end
View
@@ -10,5 +10,5 @@
ARGV.each do |file|
BibTeX::Parser.parse(file).map do |entry|
entry.reject_fields [:url]
- end.save(file.sub(/\.bib$/, 'stripped.bib'))
+ end.save(file.sub(/\.bib$/, '.stripped.bib'))
end

0 comments on commit 18d0c31

Please sign in to comment.