Skip to content

Inconsistencies between ABNF spec and test JSON #1

Description

@dmolesUC

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions