[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

@@ -80,6 +80,15 @@ public:
return getRaw()->getTokenText();
}
StringRef getIdentifierText() const {
StringRef text = getText();
if (text.front() == '`') {
assert(text.back() == '`');
return text.slice(1, text.size() - 1);
}
return text;
}
static bool kindof(SyntaxKind Kind) {
return isTokenKind(Kind);
}