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:
@@ -2057,6 +2057,8 @@ ERROR(macro_expansion_expr_expected_macro_identifier,PointsToFirstBadToken,
|
||||
"expected a macro identifier for a pound literal expression", ())
|
||||
ERROR(macro_expansion_decl_expected_macro_identifier,PointsToFirstBadToken,
|
||||
"expected a macro identifier for a pound literal declaration", ())
|
||||
ERROR(extra_whitespace_macro_expansion_identifier,PointsToFirstBadToken,
|
||||
"extraneous whitespace between '#' and macro name is not permitted", ())
|
||||
|
||||
ERROR(macro_role_attr_expected_kind,PointsToFirstBadToken,
|
||||
"expected %select{a freestanding|an attached}0 macro role such as "
|
||||
|
||||
Reference in New Issue
Block a user