Skip to content

Commit

Permalink
Fix lexer for ONTOLOGY parsing (#3091)
Browse files Browse the repository at this point in the history
-  nocmodl was not raising a syntax error for the unclosed safe CURIE
    USEION na READ ena WRITE ina REPRESENTS [CHEBI:29101
- Fix lexer rule to correctly handle this

Co-authored-by: Pramod S Kumbhar <[email protected]>
  • Loading branch information
alkino and pramodk authored Sep 25, 2024
1 parent dc9d4c9 commit 2bfcab3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nmodl/lex.lpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,12 @@ REPRESENTS {
return s->type;
}

<ontology>[ \t] {/*ignore spacing characters*/;}

<ontology>. {
diag("Invalid ONTOLOGY syntax: expected 'name' or '[name]'", nullptr);
}

{D}+ { /*INTEGER*/
yylval.qp = putintoken(yytext, INTEGER); /* Numbers are not looked for */
return INTEGER;
Expand Down

0 comments on commit 2bfcab3

Please sign in to comment.