GP-3029 Treat annotations in comments as a single token

This commit is contained in:
caheckman 2023-03-08 12:38:58 -05:00
parent 2a5816cd3b
commit 6e239a393e

View file

@ -612,6 +612,19 @@ void PrintLanguage::emitLineComment(int4 indent,const Comment *comm)
emit->tagLine(); emit->tagLine();
else if (tok=='\r') { else if (tok=='\r') {
} }
else if (tok=='{' && pos < text.size() && text[pos] == '@') {
// Comment annotation
int4 count = 1;
while(pos < text.size()) {
tok = text[pos];
count += 1;
pos += 1;
if (tok == '}') break; // Search for brace ending the annotation
}
// Treat annotation as one token
string annote = text.substr(pos-count,count);
emit->tagComment(annote,EmitMarkup::comment_color,spc,off);
}
else { else {
int4 count = 1; int4 count = 1;
while(pos < text.size()) { while(pos < text.size()) {