mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Parse] Improve macro expansion parsing
* Unify macro expansion parsing logic between MacroExpansionExpr and MacroExpansionDecl * Diagnose whitespace between '#' and the macro name * Diagnose keyword as a macro name
This commit is contained in:
@@ -1751,6 +1751,16 @@ public:
|
||||
DeclNameRef parseDeclNameRef(DeclNameLoc &loc, const Diagnostic &diag,
|
||||
DeclNameOptions flags);
|
||||
|
||||
/// Parse macro expansion.
|
||||
///
|
||||
/// macro-expansion:
|
||||
/// '#' identifier generic-arguments? expr-paren? trailing-closure?
|
||||
ParserStatus parseFreestandingMacroExpansion(
|
||||
SourceLoc £Loc, DeclNameLoc ¯oNameLoc, DeclNameRef ¯oNameRef,
|
||||
SourceLoc &leftAngleLoc, SmallVectorImpl<TypeRepr *> &genericArgs,
|
||||
SourceLoc &rightAngleLoc, ArgumentList *&argList, bool isExprBasic,
|
||||
const Diagnostic &diag);
|
||||
|
||||
ParserResult<Expr> parseExprIdentifier();
|
||||
Expr *parseExprEditorPlaceholder(Token PlaceholderTok,
|
||||
Identifier PlaceholderId);
|
||||
|
||||
Reference in New Issue
Block a user