[YANGTOOLS-544] YangSyntaxErrorException depending of the restictions/extensions order for the String type Created: 11/Nov/15 Updated: 10/Apr/22 Resolved: 08/Dec/15 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Ícaro Franco Damiani | Assignee: | Ícaro Franco Damiani |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| External issue ID: | 4623 |
| Description |
|
module extension-def { extension unknown { argument "ext-arg"; description "Extension with single argument definition."; }} module types { import extension-def { prefix "ext"; } leaf leaf-length-unknown-pattern { } The given example results in "YangSyntaxErrorException: mismatched input 'pattern' expecting {'}'" because of the type string restriction order. type string { According to the YangParser.g4 type body for string type: Recomended solution: string_restrictions : (length_stmt | identifier_stmt | pattern_stmt)*; It will allow any order of restrictions and extensions. |
| Comments |
| Comment by Ícaro Franco Damiani [ 19/Nov/15 ] |
| Comment by Martin Ciglan [ 20/Nov/15 ] |
|
just to add, this needs to be cherry-picked to stable/lithium branch in order to apply it in old parser. Beryllium master uses new statement parser with different grammar. |
| Comment by Ícaro Franco Damiani [ 20/Nov/15 ] |
|
Done. https://git.opendaylight.org/gerrit/#/c/29984/ Should I abandon the old one? |
| Comment by Martin Ciglan [ 23/Nov/15 ] |
|
Old YANG parser code is present in Beryllium master code base, so you can keep it. Thank you. |
| Comment by Tony Tkacik [ 01/Dec/15 ] |
|
Merged into master, still waiting for unfreezing stable/lithium branch |