[YANGTOOLS-603] Yang parser overwrites all multiple substatements with equal argument by the last one Created: 13/Apr/16 Updated: 10/Apr/22 Resolved: 18/Nov/16 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Peter Kajsa | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||||||
| External issue ID: | 5717 | ||||||||||||
| Description |
|
StatementContextBase.substatementBuilder(line 324) overwrites all multiple substatements with equal argument by the last one. |
| Comments |
| Comment by Suvitha Balu [ 19/May/16 ] |
|
(In reply to Peter Kajsa from comment #0) Hi, |
| Comment by Peter Kajsa [ 20/May/16 ] |
|
Hi, if a statement contains multiple substatements which have equal arguments, the previous are overwritten by the last one. For an example, see bug https://bugs.opendaylight.org/show_bug.cgi?id=5396 type string { pattern "dp[0-9]+s[0-9]+(f[0-9]+)?(d[0-9]+)?"; } type string { (f[0-9])?(d[0-9])?"; } } the previous "type string" statements are overwritten by the last one: type string { pattern "dp[0-9]+p[0-9]+p[0-9]+"; } The same issue occurs also by multiple augment, refine, deviation,..?? statements. These issues have been fixed by some hotfixes recently, but the root cause of the issue still persists. It is necessary to fix StatementContextBase.substatementBuilder in order to handle potential substatements in another way (for an example: track also the order of substatements and then check substatetement name, argument and also the substatement order). |
| Comment by Robert Varga [ 19/Oct/16 ] |
|
This boils down to statements being in two classes:
The first type does not need an identifier, the second one does. |
| Comment by Robert Varga [ 11/Nov/16 ] |
|
First step: eliminate substatement(), as it does not need to be visible: https://git.opendaylight.org/gerrit/48205 |
| Comment by Robert Varga [ 11/Nov/16 ] |
|
second step: use an integer to identify statements: https://git.opendaylight.org/gerrit/48241 |