1616
1717using namespace swift ;
1818
19- BridgedASTContext BridgedLegacyParser::getASTContext () const {
20- return unbridged ().Context ;
21- }
22-
23- BridgedDiagnosticEngine BridgedLegacyParser::getDiagnosticEngine () const {
24- return &unbridged ().Diags ;
25- }
26-
27- BridgedDeclContext BridgedLegacyParser::getCurrDeclContext () const {
28- return unbridged ().CurDeclContext ;
29- }
30-
31- BridgedStringRef BridgedLegacyParser::getSourceBuffer () const {
32- // FIXME: Should we consider partial parsing?
33- StringRef text =
34- handle->SourceMgr .getEntireTextForBuffer (*handle->SF .getBufferID ());
35- return {text.data (), text.size ()};
36- }
37-
3819// MARK: Functions called from SwiftParser.
3920
40- BridgedExpr BridgedLegacyParser::parseExpr (BridgedSourceLoc loc,
41- BridgedDeclContext DC,
42- bool isExprBasic) const {
43- auto &P = unbridged ();
21+ BridgedExpr BridgedLegacyParser_parseExpr (BridgedLegacyParser p,
22+ BridgedSourceLoc loc,
23+ BridgedDeclContext DC,
24+ bool isExprBasic) {
25+ auto &P = p.unbridged ();
4426 auto PP =
4527 P.getParserPosition (loc.unbridged (), /* PreviousLoc=*/ loc.unbridged ());
4628 P.CurDeclContext = DC.unbridged ();
@@ -50,9 +32,10 @@ BridgedExpr BridgedLegacyParser::parseExpr(BridgedSourceLoc loc,
5032 return result.getPtrOrNull ();
5133}
5234
53- BridgedDecl BridgedLegacyParser::parseDecl (BridgedSourceLoc loc,
54- BridgedDeclContext DC) const {
55- auto &P = unbridged ();
35+ BridgedDecl BridgedLegacyParser_parseDecl (BridgedLegacyParser p,
36+ BridgedSourceLoc loc,
37+ BridgedDeclContext DC) {
38+ auto &P = p.unbridged ();
5639 auto PP =
5740 P.getParserPosition (loc.unbridged (), /* PreviousLoc=*/ loc.unbridged ());
5841 P.CurDeclContext = DC.unbridged ();
@@ -68,9 +51,10 @@ BridgedDecl BridgedLegacyParser::parseDecl(BridgedSourceLoc loc,
6851 return result.getPtrOrNull ();
6952}
7053
71- BridgedStmt BridgedLegacyParser::parseStmt (BridgedSourceLoc loc,
72- BridgedDeclContext DC) const {
73- auto &P = unbridged ();
54+ BridgedStmt BridgedLegacyParser_parseStmt (BridgedLegacyParser p,
55+ BridgedSourceLoc loc,
56+ BridgedDeclContext DC) {
57+ auto &P = p.unbridged ();
7458 auto PP =
7559 P.getParserPosition (loc.unbridged (), /* PreviousLoc=*/ loc.unbridged ());
7660 P.CurDeclContext = DC.unbridged ();
@@ -80,9 +64,10 @@ BridgedStmt BridgedLegacyParser::parseStmt(BridgedSourceLoc loc,
8064 return result.getPtrOrNull ();
8165}
8266
83- BridgedTypeRepr BridgedLegacyParser::parseType (BridgedSourceLoc loc,
84- BridgedDeclContext DC) const {
85- auto &P = unbridged ();
67+ BridgedTypeRepr BridgedLegacyParser_parseType (BridgedLegacyParser p,
68+ BridgedSourceLoc loc,
69+ BridgedDeclContext DC) {
70+ auto &P = p.unbridged ();
8671 auto PP =
8772 P.getParserPosition (loc.unbridged (), /* PreviousLoc=*/ loc.unbridged ());
8873 P.CurDeclContext = DC.unbridged ();
0 commit comments