mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "Merge pull request #27230 from rintaro/syntaxparsse-rdar55421369"
This reverts commitb09f87594a, reversing changes made tod0b7ecab00.
This commit is contained in:
@@ -26,7 +26,6 @@ public:
|
||||
: RawNode(std::move(rawNode)) {}
|
||||
|
||||
const ParsedRawSyntaxNode &getRaw() const { return RawNode; }
|
||||
ParsedRawSyntaxNode takeRaw() { return std::move(RawNode); }
|
||||
syntax::SyntaxKind getKind() const { return RawNode.getKind(); }
|
||||
|
||||
/// Returns true if the syntax node is of the given type.
|
||||
@@ -40,7 +39,7 @@ public:
|
||||
template <typename T>
|
||||
T castTo() const {
|
||||
assert(is<T>() && "castTo<T>() node of incompatible type!");
|
||||
return T { RawNode.copyDeferred() };
|
||||
return T { RawNode };
|
||||
}
|
||||
|
||||
/// If this Syntax node is of the right kind, cast and return it,
|
||||
@@ -53,10 +52,6 @@ public:
|
||||
return llvm::None;
|
||||
}
|
||||
|
||||
ParsedSyntax copyDeferred() const {
|
||||
return ParsedSyntax { RawNode.copyDeferred() };
|
||||
}
|
||||
|
||||
static bool kindof(syntax::SyntaxKind Kind) {
|
||||
return true;
|
||||
}
|
||||
@@ -70,7 +65,7 @@ public:
|
||||
class ParsedTokenSyntax final : public ParsedSyntax {
|
||||
public:
|
||||
explicit ParsedTokenSyntax(ParsedRawSyntaxNode rawNode)
|
||||
: ParsedSyntax(std::move(rawNode)) {}
|
||||
: ParsedSyntax(rawNode) {}
|
||||
|
||||
tok getTokenKind() const {
|
||||
return getRaw().getTokenKind();
|
||||
|
||||
Reference in New Issue
Block a user