mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user