[YANGTOOLS-377] Yang parser fails when extension is used between two revision statements Created: 19/Nov/14  Updated: 10/Apr/22  Resolved: 09/Feb/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Peter Kajsa Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 2406

 Description   

RFC6020 ABNF grammar says:

revision-stmts = *(revision-stmt stmtsep)

stmtsep = *(WSP / line-break / unknown-statement)

Our YANG.g4 grammar says:

revision_stmts : (revision_stmt )* (stmtsep)*;

stmtsep : IDENTIFIER string? (stmtend | (LEFT_BRACE unknown_statement* RIGHT_BRACE));

So, in our grammar unknown-statement can occur only after all revision statements, but in RFC grammar unknown-statement can occur also before or between two revision statements etc.

For an example, parsing of following model fails:
module my-module {
namespace "my";
prefix my;

...

revision "2007-06-09"

{ description "Initial revision."; }

my-prefix:my-extension 1;

revision "2008-06-09"

{ description "Revision 2."; }

}



 Comments   
Comment by Peter Kajsa [ 01/Dec/14 ]

Patch set https://git.opendaylight.org/gerrit/#/c/13249/1

Generated at Wed Feb 07 20:53:04 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.