I'm working on a Ruby MARCspec parser using Parslet where the parse rules are 1:1 with the ABNF rules, and using the MARCspec-Test-Suite JSON to generate test cases.
In doing so, I've run across a few inconsistencies in trying to guess the parse rule name from the suite file name:
-
indicators — ((^[12]$)) — the ABNF has:
abrIndicatorSpec = [index] "^" ("1" / "2")
but doesn't call out ("1" / "2") as a separate indicators rule.
-
subfield ranges (^((?:(?:[a-z]\-[a-z])|(?:[0-9]\-[0-9])))$) — the ABNF has
subfieldCodeRange = "$" ( (alphalower "-" alphalower) / (DIGIT "-" DIGIT) )
but doesn't call out ( (alphalower "-" alphalower) / (DIGIT "-" DIGIT) ) as a separate subfieldRange rule.
-
subfield tags (^([\!-\?\[-\{\}-~])$) — in the ABNF this is subfieldChar, not subfieldTag.
None of these is that hard to work around (for the first two I extracted additional parse rules, and for the third I just put a special case in my test case generation code) but I wanted to bring them to your attention.
I'm working on a Ruby MARCspec parser using Parslet where the parse rules are 1:1 with the ABNF rules, and using the MARCspec-Test-Suite JSON to generate test cases.
In doing so, I've run across a few inconsistencies in trying to guess the parse rule name from the suite file name:
indicators — (
(^[12]$)) — the ABNF has:but doesn't call out
("1" / "2")as a separateindicatorsrule.subfield ranges (
^((?:(?:[a-z]\-[a-z])|(?:[0-9]\-[0-9])))$) — the ABNF hasbut doesn't call out
( (alphalower "-" alphalower) / (DIGIT "-" DIGIT) )as a separatesubfieldRangerule.subfield tags (
^([\!-\?\[-\{\}-~])$) — in the ABNF this issubfieldChar, notsubfieldTag.None of these is that hard to work around (for the first two I extracted additional parse rules, and for the third I just put a special case in my test case generation code) but I wanted to bring them to your attention.