[AST] Merge BridgedDiagnosticEngine + BridgedDiagEngine

Introduce a macro that can stamp out wrapper
classes for underlying C++ pointers, and use
it to define BridgedDiagnosticEngine in
ASTBridging. Then, migrate users of
BridgedDiagEngine onto it.
This commit is contained in:
Hamish Knight
2023-10-30 23:49:55 +00:00
parent fe0ad60fe8
commit fce1cb54d5
18 changed files with 82 additions and 58 deletions

View File

@@ -28,7 +28,7 @@
/// past.
/// - MustBeRegex: whether an error during lexing should be considered a regex
/// literal, or some thing else.
/// - BridgedOptionalDiagnosticEngine: RegexLiteralLexingFn should diagnose the
/// - BridgedNullableDiagnosticEngine: RegexLiteralLexingFn should diagnose the
/// token using this engine.
///
/// Returns: A bool indicating whether lexing was completely erroneous, and
@@ -37,7 +37,7 @@
typedef bool (*RegexLiteralLexingFn)(
/*CurPtrPtr*/ const char *_Nonnull *_Nonnull,
/*BufferEnd*/ const char *_Nonnull,
/*MustBeRegex*/ bool, BridgedOptionalDiagnosticEngine);
/*MustBeRegex*/ bool, BridgedNullableDiagnosticEngine);
void Parser_registerRegexLiteralLexingFn(RegexLiteralLexingFn _Nullable fn);
/// Parse a regex literal string. Takes the following arguments:
@@ -58,7 +58,7 @@ typedef bool (*RegexLiteralParsingFn)(/*InputPtr*/ const char *_Nonnull,
/*CaptureStructureOut*/ void *_Nonnull,
/*CaptureStructureSize*/ unsigned,
/*DiagnosticBaseLoc*/ BridgedSourceLoc,
BridgedDiagEngine);
BridgedDiagnosticEngine);
void Parser_registerRegexLiteralParsingFn(RegexLiteralParsingFn _Nullable fn);
#endif // REGEX_PARSER_BRIDGING