8000 ABNF: silently chokes on dhall.abnf · Issue #51 · katef/kgt · GitHub
[go: up one dir, main page]

Skip to content

ABNF: silently chokes on dhall.abnf #51

Open

Description

@Profpatsch

https://github.com/dhall-lang/dhall-lang/blob/60629b9d198af49984e9f9da337036942147af8b/standard/dhall.abnf

This is the ABNF file for the dhall language, it might not be a fully spec-compliant abnf but when I feed it into kgt:

$ > kgt -l abnf -e svg <./dhall-lang/standard/dhall.abnf
[1]$

it silently exits with a status 1 without producing an error message or any output.

Activity

  1. Profpatsch commented on Apr 26, 2021

    @Profpatsch
    Author

    Same for e.g. -e html5, so it’s probably a parsing issue.

    The svg example from the readme works just fine, so I’m reasonably certain I built the executable correctly:

    $ result-bin/bin/kgt -l bnf -e svg < result-doc/share/doc/kgt/examples/expr.bnf > expr.svg
    [0]$
    
  2. katef commented on May 9, 2021

    @katef
    Owner

    You're right that this is a parsing issue; it happens before we get to output. I think this may be the same bug as #11.

    
    ; ./build/bin/kgt -l abnf -e svg < examples/dhall.abnf 
    112:17: Syntax error: expected production rule separator
    

    line 112 is the valid-non-ascii = line:

    
    ; This rule matches all characters that are not:
    ; 
    ; * not ASCII
    ; * not part of a surrogate pair
    ; * not a "non-character"
    valid-non-ascii =
          %x80-D7FF
        ; %xD800-DFFF = surrogate pairs
        / %xE000-FFFD
        ; %xFFFE-FFFF = non-characters
        / %x10000-1FFFD
        ; %x1FFFE-1FFFF = non-characters
        / %x20000-2FFFD
    
  3. katef commented on May 9, 2021

    @katef
    Owner

    the unicode character ranges in dhall.abnf are not implemented yet, either:

    ; echo 'x = %xF0000-FFFFD' | ./build/bin/kgt -l abnf                       
    1:5: hex sequence %xF0000-FFFFD out of range: expected %x0..%xff inclusive
    1:5: Syntax error
    
  4. katef commented on May 9, 2021

    @katef
    Owner

    the lack of error message is a bug. unfortunately I can't reproduce that! could you try to cut that down to a minimal test case please?

    pragmatically, if you just want to render this file, I suggest:

    • removing the trailing comments (per ABNF: comments #11)
    • removing the productions with unicode escapes (sorry)
    • dos2unix (dhall.abnf has dos newlines)
    • add a newline after every production (this is required by the abnf spec, annoyingly). e.g. these ones are missing that:
    simple-label-first-char = ALPHA / "_"
    simple-label-next-char = ALPHANUM / "-" / "/" / "_"
    si
    5559
    mple-label = simple-label-first-char *simple-label-next-char
    
  5. Profpatsch commented on May 14, 2021

    @Profpatsch
    Author

    Cool! Thanks for the help. I can’t promise when I’ll come back to this, but maybe I find some time to try out your suggestions this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0