TypeFox / yang-lsp

A Language Server for YANG
http://www.yang-central.org
Apache License 2.0
51 stars 13 forks source link

Serialization of concatenated must expression removes trailing space #166

Closed andreasjakobik closed 4 years ago

andreasjakobik commented 4 years ago

Hello,

Here is another example of serialization problem, now with dire consequences.

The following yang is parsed in:

        container second-tag {
          must
            '../outer-tag/tag-type = "dot1q-types:s-vlan" and ' +
            'tag-type = "dot1q-types:c-vlan"' {

And here is what comes out when serializing the same model:

          container second-tag {
                    must '../outer-tag/tag-type = "dot1q-types:s-vlan" and' +
            'tag-type = "dot1q-types:c-vlan"' {

Notice the space has been removed after "and " causing the expression to be invalid.

Thanks, Andreas

spoenemann commented 4 years ago

The issue is still present when formatting is enabled in the serializer's SaveOptions.