Style changes as requested
This commit is contained in:
parent
7d36c5f6b8
commit
e70e41282c
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <assert.h>
|
||||
#include <atomic>
|
||||
#include <codecvt>
|
||||
#include <chrono>
|
||||
#include <fstream>
|
||||
|
|
|
@ -88,14 +88,14 @@ misc::IntervalSet ATN::nextTokens(ATNState *s, RuleContext *ctx) const {
|
|||
}
|
||||
|
||||
misc::IntervalSet const& ATN::nextTokens(ATNState *s) const {
|
||||
if (!s->nextTokenUpdated) {
|
||||
if (!s->_nextTokenUpdated) {
|
||||
std::unique_lock<std::mutex> lock { _mutex };
|
||||
if (!s->nextTokenUpdated) {
|
||||
s->nextTokenWithinRule = nextTokens(s, nullptr);
|
||||
s->nextTokenUpdated = true;
|
||||
if (!s->_nextTokenUpdated) {
|
||||
s->_nextTokenWithinRule = nextTokens(s, nullptr);
|
||||
s->_nextTokenUpdated = true;
|
||||
}
|
||||
}
|
||||
return s->nextTokenWithinRule;
|
||||
return s->_nextTokenWithinRule;
|
||||
}
|
||||
|
||||
void ATN::addState(ATNState *state) {
|
||||
|
|
|
@ -6,7 +6,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "misc/IntervalSet.h"
|
||||
#include <atomic>
|
||||
|
||||
namespace antlr4 {
|
||||
namespace atn {
|
||||
|
@ -124,8 +123,8 @@ namespace atn {
|
|||
private:
|
||||
/// Used to cache lookahead during parsing, not used during construction.
|
||||
|
||||
misc::IntervalSet nextTokenWithinRule;
|
||||
std::atomic<bool> nextTokenUpdated { false };
|
||||
misc::IntervalSet _nextTokenWithinRule;
|
||||
std::atomic<bool> _nextTokenUpdated { false };
|
||||
|
||||
friend class ATN;
|
||||
};
|
||||
|
|
|
@ -24,7 +24,7 @@ IntervalSet::IntervalSet() : _intervals() {
|
|||
IntervalSet::IntervalSet(const IntervalSet &set) : _intervals(set._intervals) {
|
||||
}
|
||||
|
||||
IntervalSet::IntervalSet(IntervalSet&& set) : _intervals(std::move(set._intervals)) {
|
||||
IntervalSet::IntervalSet(IntervalSet&& set) : IntervalSet(std::move(set._intervals)) {
|
||||
}
|
||||
|
||||
IntervalSet::IntervalSet(std::vector<Interval>&& intervals) : _intervals(std::move(intervals)) {
|
||||
|
|
Loading…
Reference in New Issue