Closed ericprud closed 6 years ago
support for multiline comments by @labra, @emulatingkat, @andrawaag, @ericprud, @hsolbrig, @tombaker, and @jimkont
before acceptance needs confirmation by @hsolbrig for the grammar parser
Looks good. ShExDoc.g4 has been updated to support this. Will update the ShExC parser accordingly
It's frequently useful to comment a multi-line block of ShEx. I find c-style comments / archaic, tedious, a throw-back to old computing practices, */ quite handy when commenting or debugging large schemas. In this [expressivity example](http://rawgit.com/shexSpec/shex.js/master/doc/shex-simple.html?schema=%3CS%3E%20%7B%0A%20%20%3Cp1%3E%20%20%20%20%5B1%5D%20%3B%0A%20%20%3Cp2%3E%20%2F%20%5B2%5D%20%3B%0A%20%20%3Cp3%3E%20%20%20%20%5B3%5D%20%3B%20%2F%20escaped%20embedded%20comment%20%5C%2F%0A%20%20%3Cp4%3E%20%2F%20%5B4%5D%20%3B%0A%7D&data=%3Cs%3E%0A%20%20%3Cp1%3E%201%3B%0A%20%20%3Cp2%3E%204.&manifestURL=..%2Fexamples%2Fmanifest.json&shape-map=%3Cs%3E%40%3CS%3E&interface=human®expEngine=threaded-val-nerr), everything between the / */s is ignored, including the nested comment whose closing delimiter is escaped with a
\/
:The resulting shape is:
The implementor impact is minimal, just the addition of a comment rule:
a "/" followed by n (non-'*' or '*' followed by a "\/" or a non-'/')s terminated with a "\/".