[Syntax] Abolish 'backtick' trivia

- Stop producing 'backtick' trivia for escaping identifier token. '`'s
  are now parts of the token text
- Adjust and simplify C++ libSyntax APIs
- Add 'is_deprecated' property to Trivia.py to attribute SwiftSyntax
  APIs

rdar://problem/54810608
This commit is contained in:
Rintaro Ishizaki
2019-09-09 10:21:06 -07:00
parent 19f5ac15c9
commit 8edea315cd
12 changed files with 42 additions and 63 deletions

View File

@@ -30,7 +30,7 @@ ParsedRawSyntaxNode
ParsedRawSyntaxRecorder::recordToken(const Token &tok,
const ParsedTrivia &leadingTrivia,
const ParsedTrivia &trailingTrivia) {
return recordToken(tok.getKind(), tok.getRangeWithoutBackticks(),
return recordToken(tok.getKind(), tok.getRange(),
leadingTrivia.Pieces, trailingTrivia.Pieces);
}
@@ -63,7 +63,7 @@ getRecordedNode(const ParsedRawSyntaxNode &node, ParsedRawSyntaxRecorder &rec) {
if (node.isDeferredLayout())
return rec.recordRawSyntax(node.getKind(), node.getDeferredChildren());
assert(node.isDeferredToken());
CharSourceRange tokRange = node.getDeferredTokenRangeWithoutBackticks();
CharSourceRange tokRange = node.getDeferredTokenRange();
tok tokKind = node.getTokenKind();
if (node.isMissing())
return rec.recordMissingToken(tokKind, tokRange.getStart());