Skip to content

fastobo-validator fails when lines start with ! #156

@allenbaron

Description

@allenbaron

The OBO 1.4 spec (https://owlcollab.github.io/oboformat/doc/GO.format.obo-1_4.html#S.1.2) says:

Comments

An OBO file may contain any number of lines beginning with !, at any point in the file. These lines are ignored by parsers.

Further, any line may end with a ! comment. Parsers that encounter an unescaped ! will ignore the ! and all data until the end of the line. <newline> sequences are not allowed in ! comments (see escape characters).

However, fastobo-validator errors when any lines starting with ! are in the file.

Running fastobo-validator on this small test file:

format-version: 1.4

[Term]
id: BLAH:0001
name: Example Term
namespace: example_namespace
!comment: This is an example line that causes errors.

Gives the following error:

thread '<unnamed>' panicked at /Users/.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/fastobo-0.15.4/src/ast/term/clause.rs:175:18:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'main' panicked at /Users/.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/fastobo-0.15.4/src/parser/threaded/mod.rs:187:41:
called `Result::unwrap()` on an `Err` value: Any { .. }

With version: fastobo-validator 0.4.6 on MacOS 15.5 (Apple M3 Max chip).

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