@@ -218,9 +218,9 @@ const atn::ATN& Parser::getATNWithBypassAlts() {
218
218
if (serializedAtn.empty ()) {
219
219
throw UnsupportedOperationException (" The current parser does not support an ATN with bypass alternatives." );
220
220
}
221
-
221
+ # if !defined(__wasi__)
222
222
std::lock_guard<std::mutex> lck (_mutex);
223
-
223
+ # endif
224
224
// XXX: using the entire serialized ATN as key into the map is a big resource waste.
225
225
// How large can that thing become?
226
226
if (bypassAltsAtnCache.find (serializedAtn) == bypassAltsAtnCache.end ())
@@ -553,8 +553,9 @@ std::vector<std::string> Parser::getRuleInvocationStack(RuleContext *p) {
553
553
std::vector<std::string> Parser::getDFAStrings () {
554
554
atn::ParserATNSimulator *simulator = getInterpreter<atn::ParserATNSimulator>();
555
555
if (!simulator->decisionToDFA .empty ()) {
556
+ #if !defined(__wasi__)
556
557
std::lock_guard<std::mutex> lck (_mutex);
557
-
558
+ # endif
558
559
std::vector<std::string> s;
559
560
for (size_t d = 0 ; d < simulator->decisionToDFA .size (); d++) {
560
561
dfa::DFA &dfa = simulator->decisionToDFA [d];
@@ -568,7 +569,9 @@ std::vector<std::string> Parser::getDFAStrings() {
568
569
void Parser::dumpDFA () {
569
570
atn::ParserATNSimulator *simulator = getInterpreter<atn::ParserATNSimulator>();
570
571
if (!simulator->decisionToDFA .empty ()) {
572
+ #if !defined(__wasi__)
571
573
std::lock_guard<std::mutex> lck (_mutex);
574
+ #endif
572
575
bool seenOne = false ;
573
576
for (size_t d = 0 ; d < simulator->decisionToDFA .size (); d++) {
574
577
dfa::DFA &dfa = simulator->decisionToDFA [d];
@@ -645,4 +648,3 @@ void Parser::InitializeInstanceFields() {
645
648
_tracer = nullptr ;
646
649
_ctx = nullptr ;
647
650
}
648
-
0 commit comments