Permalink
Browse files

Fixes numeric keys issue.

  • Loading branch information...
1 parent 7edd99e commit e8c0d7ae4affcdba0602108ba9942ef25479e7a4 @inukshuk committed May 21, 2011
Showing with 10 additions and 4 deletions.
  1. +1 −0 History.txt
  2. +8 −4 features/issues/number_keys.feature
  3. +1 −0 lib/bibtex/bibtex.y
View
@@ -1,5 +1,6 @@
=== 1.3.2
+* Fixed numeric keys issue
* Fixed CiteProc/CSL date export
* Implemented BibTeX month value conversion
@@ -3,7 +3,7 @@ Feature: Keys containing '/' symbols
I want to parse BibTeX entries with keys starting with numbers
Because they frequently occur in key naming schemes
- Scenario: An entry taken from the DBLP
+ Scenario: Two entries with keys starting with a number
When I parse the following file:
"""
@misc{2008knowledge,
@@ -31,11 +31,15 @@ Feature: Keys containing '/' symbols
Url = {http://oro.open.ac.uk/9275/},
Year = {2007},
Bdsk-File-1 = {YnBsaXN0MDDUAQIDBAUIJidUJHRvcFgkb2JqZWN0c1gkdmVyc2lvblkkYXJjaGl2ZXLRBgdUcm9vdIABqAkKFRYXGyIjVSRudWxs0wsMDQ4RFFpOUy5vYmplY3RzV05TLmtleXNWJGNsYXNzog8QgASABqISE4ACgAOAB1lhbGlhc0RhdGFccmVsYXRpdmVQYXRo0hgNGRpXTlMuZGF0YU8RAYQAAAAAAYQAAgAABEhvbWUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMmm5vlIKwAAABLivBMyMDA3cHJvY2VlZGluZ3MucGRmAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEuYBydoPoVBERiAAAAAAAAIAAwAACQAAAAAAAAAAAAAAAAAAAAAHQmliZGVzawAAEAAIAADJpx85AAAAEQAIAADJ2kfhAAAAAQAMABLivAAAAF8AAABXAAIAMEhvbWU6c3RpYW46RG9jdW1lbnRzOkJpYmRlc2s6MjAwN3Byb2NlZWRpbmdzLnBkZgAOACgAEwAyADAAMAA3AHAAcgBvAGMAZQBlAGQAaQBuAGcAcwAuAHAAZABmAA8ACgAEAEgAbwBtAGUAEgAsL3N0aWFuL0RvY3VtZW50cy9CaWJkZXNrLzIwMDdwcm9jZWVkaW5ncy5wZGYAEwANL1ZvbHVtZXMvSG9tZQAAFQACABP//wAAgAXSHB0eH1gkY2xhc3Nlc1okY2xhc3NuYW1lox8gIV1OU011dGFibGVEYXRhVk5TRGF0YVhOU09iamVjdF8QKy4uLy4uL0RvY3VtZW50cy9CaWJkZXNrLzIwMDdwcm9jZWVkaW5ncy5wZGbSHB0kJaIlIVxOU0RpY3Rpb25hcnkSAAGGoF8QD05TS2V5ZWRBcmNoaXZlcgAIABEAFgAfACgAMgA1ADoAPABFAEsAUgBdAGUAbABvAHEAcwB2AHgAegB8AIYAkwCYAKACKAIqAi8COAJDAkcCVQJcAmUCkwKYApsCqAKtAAAAAAAAAgEAAAAAAAAAKAAAAAAAAAAAAAAAAAAAAr8=}}
+ """
+ Then my bibliography should contain a misc with id "2008knowledge"
+ And my bibliography should contain a misc with id "2007proceedings"
+ Scenario: An entry with a number-only key
+ When I parse the following file:
+ """
@book{2011,
- Title: {Test}
+ Title = {Test}
}
"""
Then my bibliography should contain a book with id "2011"
- And my bibliography should contain a misc with id "2008knowledge"
- And my bibliography should contain a misc with id "2007proceedings"
View
@@ -70,6 +70,7 @@ rule
key : NAME { result = val[0] }
| NUMBER { result = val[0] }
+ | NUMBER NAME { result = val[0,2].join }
assignments : assignment { result = val[0] }
| assignments COMMA assignment { result.merge!(val[2]) }

0 comments on commit e8c0d7a

Please sign in to comment.