pegkit icon indicating copy to clipboard operation
pegkit copied to clipboard

Should be able to remove delimiters from token stringValue

Open WarTech9 opened this issue 8 years ago • 1 comments

Tokens you get back include the delimiters. Generally, if its a comment, you know its delimited by /* */. Similarly, if its a quoted string, you know its delimited by ' or ". I think in the most common use cases, users will expect the tokens returned to be without the delimiters.

Right now the only way to do that is to do some additional parsing on the returned tokens or using substrings or some similar means. I think the best way to do this will be in the state objects (PKQuoteState, PKCommentState) etc. One way would be to have an includeDelimiter property, that when not set, does not include delimiters in the stringValue.

WarTech9 avatar Oct 30 '16 00:10 WarTech9

I've not tried it but that seems to be what quotedStringValue is for.

Have a look PKToken::quotedStringValue

yepher avatar Nov 19 '16 14:11 yepher