thrift-parser icon indicating copy to clipboard operation
thrift-parser copied to clipboard

[discussion] keep block comments' original content?

Open pd4d10 opened this issue 7 years ago • 1 comments

Take part of this file as example:

/*
 * with the License. You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 */
 
namespace c_glib TTest

The comment block is parsed to:

        {
          "type": "CommentBlock",
          "value": [
            "with the License. You may obtain a copy of the License at",
            "*",
            " http://www.apache.org/licenses/LICENSE-2.0",
            "*",
            " Unless required by applicable law or agreed to in writing,"
          ]
        }

The indent of http://www.apache.org/licenses/LICENSE-2.0 is intended, which is lost. Maybe it is better to keep block comments' original content?

pd4d10 avatar Sep 25 '18 03:09 pd4d10

Trying to parse the comment body was probably a mistake. Something I can look to add quickly is a new property rawValue that would have the unparsed comment.

kevin-greene-ck avatar Sep 25 '18 16:09 kevin-greene-ck