Implement #warning and #error (#14048)

* Implement #warning and #error

* Fix #warning/#error in switch statements

* Fix AST printing for #warning/#error

* Add to test case

* Add extra handling to ParseDeclPoundDiagnostic

* fix dumping

* Consume the right paren even in the failure case

* Diagnose extra tokens on the same line after a diagnostic directive
This commit is contained in:
Harlan
2018-02-03 18:07:05 -05:00
committed by GitHub
parent ca7d18699a
commit 5e02d2a877
34 changed files with 368 additions and 15 deletions

View File

@@ -69,6 +69,7 @@ static bool declIsPrivate(const Decl *member) {
case DeclKind::EnumCase:
case DeclKind::TopLevelCode:
case DeclKind::IfConfig:
case DeclKind::PoundDiagnostic:
return true;
case DeclKind::Extension:
@@ -240,6 +241,7 @@ bool swift::emitReferenceDependencies(DiagnosticEngine &diags,
case DeclKind::PatternBinding:
case DeclKind::TopLevelCode:
case DeclKind::IfConfig:
case DeclKind::PoundDiagnostic:
// No action necessary.
break;