aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/pire
diff options
context:
space:
mode:
authoryazevnul <yazevnul@yandex-team.ru>2022-02-10 16:46:48 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:48 +0300
commit9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /contrib/libs/pire
parent8cbc307de0221f84c80c42dcbe07d40727537e2c (diff)
downloadydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/pire')
-rw-r--r--contrib/libs/pire/pire/encoding.cpp2
-rw-r--r--contrib/libs/pire/pire/extra/count.cpp4
-rw-r--r--contrib/libs/pire/pire/fsm.cpp4
-rw-r--r--contrib/libs/pire/pire/partition.h4
-rw-r--r--contrib/libs/pire/pire/run.h14
-rw-r--r--contrib/libs/pire/pire/scanner_io.cpp4
-rw-r--r--contrib/libs/pire/pire/scanners/loaded.h10
-rw-r--r--contrib/libs/pire/pire/scanners/multi.h50
-rw-r--r--contrib/libs/pire/pire/scanners/simple.h10
-rw-r--r--contrib/libs/pire/pire/scanners/slow.h6
-rw-r--r--contrib/libs/pire/pire/stub/stl.h4
11 files changed, 56 insertions, 56 deletions
diff --git a/contrib/libs/pire/pire/encoding.cpp b/contrib/libs/pire/pire/encoding.cpp
index 9707c10d54..842e2b534d 100644
--- a/contrib/libs/pire/pire/encoding.cpp
+++ b/contrib/libs/pire/pire/encoding.cpp
@@ -95,7 +95,7 @@ namespace {
size_t len;
unsigned char* p = (unsigned char*) &*ret.begin();
if (SafeWriteUTF8Char(c, len, p, p + ret.size()) != RECODE_OK)
- Y_ASSERT(!"Pire::UTF8::toLocal(): Internal error");
+ Y_ASSERT(!"Pire::UTF8::toLocal(): Internal error");
return ret;
}
diff --git a/contrib/libs/pire/pire/extra/count.cpp b/contrib/libs/pire/pire/extra/count.cpp
index 5285aed998..468ff61d92 100644
--- a/contrib/libs/pire/pire/extra/count.cpp
+++ b/contrib/libs/pire/pire/extra/count.cpp
@@ -796,9 +796,9 @@ CountingScanner::CountingScanner(const Fsm& re, const Fsm& sep)
const Fsm::StatesSet& br = sep_re.Destinations(states[curstate].second, letter);
if (mr.size() != 1)
- Y_ASSERT(!"Wrong transition size for main");
+ Y_ASSERT(!"Wrong transition size for main");
if (br.size() != 1)
- Y_ASSERT(!"Wrong transition size for backup");
+ Y_ASSERT(!"Wrong transition size for backup");
NewState ns(*mr.begin(), *br.begin());
PIRE_IFDEBUG(NewState savedNs = ns);
diff --git a/contrib/libs/pire/pire/fsm.cpp b/contrib/libs/pire/pire/fsm.cpp
index 5df0c7ec4b..984d708dfa 100644
--- a/contrib/libs/pire/pire/fsm.cpp
+++ b/contrib/libs/pire/pire/fsm.cpp
@@ -80,7 +80,7 @@ void Fsm::DumpState(yostream& s, size_t state) const
for (auto&& transitionState : transition.second) {
if (transitionState >= Size()) {
std::cerr << "WTF?! Transition from " << state << " on letter " << transition.first << " leads to non-existing state " << transitionState << "\n";
- Y_ASSERT(false);
+ Y_ASSERT(false);
}
if (Letters().Contains(transition.first)) {
const TVector<Char>& letters = Letters().Klass(Letters().Representative(transition.first));
@@ -977,7 +977,7 @@ public:
void Connect(size_t from, size_t to, Char letter)
{
PIRE_IFDEBUG(Cdbg << "Connecting " << from << " --" << letter << "--> " << to << Endl);
- Y_ASSERT(mNewTerminals.find(from) == mNewTerminals.end());
+ Y_ASSERT(mNewTerminals.find(from) == mNewTerminals.end());
mNewFsm.Connect(from, to, letter);
}
typedef bool Result;
diff --git a/contrib/libs/pire/pire/partition.h b/contrib/libs/pire/pire/partition.h
index 39a26b53e4..85a9af8863 100644
--- a/contrib/libs/pire/pire/partition.h
+++ b/contrib/libs/pire/pire/partition.h
@@ -98,7 +98,7 @@ public:
if (it == m_inv.end())
throw Error("Partition::index(): attempted to obtain an index of nonexistent item");
auto it2 = m_set.find(it->second);
- Y_ASSERT(it2 != m_set.end());
+ Y_ASSERT(it2 != m_set.end());
return it2->second.first;
}
/// Returns the whole equivalence class of @p t (i.e. item @p i
@@ -109,7 +109,7 @@ public:
if (it == m_inv.end())
throw Error("Partition::index(): attempted to obtain an index of nonexistent item");
auto it2 = m_set.find(it->second);
- Y_ASSERT(it2 != m_set.end());
+ Y_ASSERT(it2 != m_set.end());
return it2->second.second;
}
diff --git a/contrib/libs/pire/pire/run.h b/contrib/libs/pire/pire/run.h
index 75959379ed..f6e1ff734d 100644
--- a/contrib/libs/pire/pire/run.h
+++ b/contrib/libs/pire/pire/run.h
@@ -54,7 +54,7 @@ template<class Scanner>
PIRE_FORCED_INLINE PIRE_HOT_FUNCTION
void Step(const Scanner& scanner, typename Scanner::State& state, Char ch)
{
- Y_ASSERT(ch < MaxCharUnaligned);
+ Y_ASSERT(ch < MaxCharUnaligned);
typename Scanner::Action a = scanner.Next(state, ch);
scanner.TakeAction(state, a);
}
@@ -112,9 +112,9 @@ namespace Impl {
PIRE_FORCED_INLINE PIRE_HOT_FUNCTION
Action SafeRunChunk(const Scanner& scanner, typename Scanner::State& state, const size_t* p, size_t pos, size_t size, Pred pred)
{
- Y_ASSERT(pos <= sizeof(size_t));
- Y_ASSERT(size <= sizeof(size_t));
- Y_ASSERT(pos + size <= sizeof(size_t));
+ Y_ASSERT(pos <= sizeof(size_t));
+ Y_ASSERT(size <= sizeof(size_t));
+ Y_ASSERT(pos + size <= sizeof(size_t));
if (PIRE_UNLIKELY(size == 0))
return Continue;
@@ -133,9 +133,9 @@ namespace Impl {
PIRE_FORCED_INLINE PIRE_HOT_FUNCTION
Action RunChunk(const Scanner& scanner, typename Scanner::State& state, const size_t* p, size_t pos, size_t size, Pred pred)
{
- Y_ASSERT(pos <= sizeof(size_t));
- Y_ASSERT(size <= sizeof(size_t));
- Y_ASSERT(pos + size <= sizeof(size_t));
+ Y_ASSERT(pos <= sizeof(size_t));
+ Y_ASSERT(size <= sizeof(size_t));
+ Y_ASSERT(pos + size <= sizeof(size_t));
if (PIRE_UNLIKELY(size == 0))
return Continue;
diff --git a/contrib/libs/pire/pire/scanner_io.cpp b/contrib/libs/pire/pire/scanner_io.cpp
index 4fd5e9792c..3956e3c6ed 100644
--- a/contrib/libs/pire/pire/scanner_io.cpp
+++ b/contrib/libs/pire/pire/scanner_io.cpp
@@ -43,7 +43,7 @@ void SimpleScanner::Save(yostream* s) const
SavePodType(s, Empty());
Impl::AlignSave(s, sizeof(Empty()));
if (!Empty()) {
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
Impl::AlignedSaveArray(s, m_buffer.Get(), BufSize());
}
}
@@ -77,7 +77,7 @@ void SlowScanner::Save(yostream* s) const
SavePodType(s, Empty());
Impl::AlignSave(s, sizeof(Empty()));
if (!Empty()) {
- Y_ASSERT(!m_vec.empty());
+ Y_ASSERT(!m_vec.empty());
Impl::AlignedSaveArray(s, m_letters, MaxChar);
Impl::AlignedSaveArray(s, m_finals, m.statesCount);
diff --git a/contrib/libs/pire/pire/scanners/loaded.h b/contrib/libs/pire/pire/scanners/loaded.h
index 4d72d783a9..120dc403b7 100644
--- a/contrib/libs/pire/pire/scanners/loaded.h
+++ b/contrib/libs/pire/pire/scanners/loaded.h
@@ -188,9 +188,9 @@ public:
void SetJump(size_t oldState, Char c, size_t newState, Action action)
{
- Y_ASSERT(m_buffer);
- Y_ASSERT(oldState < m.statesCount);
- Y_ASSERT(newState < m.statesCount);
+ Y_ASSERT(m_buffer);
+ Y_ASSERT(oldState < m.statesCount);
+ Y_ASSERT(newState < m.statesCount);
size_t shift = (newState - oldState) * StateSize();
Transition tr;
@@ -201,8 +201,8 @@ public:
Action RemapAction(Action action) { return action; }
- void SetInitial(size_t state) { Y_ASSERT(m_buffer); m.initial = reinterpret_cast<size_t>(m_jumps + state * m.lettersCount); }
- void SetTag(size_t state, Tag tag) { Y_ASSERT(m_buffer); m_tags[state] = tag; }
+ void SetInitial(size_t state) { Y_ASSERT(m_buffer); m.initial = reinterpret_cast<size_t>(m_jumps + state * m.lettersCount); }
+ void SetTag(size_t state, Tag tag) { Y_ASSERT(m_buffer); m_tags[state] = tag; }
void FinishBuild() {}
size_t StateIdx(InternalState s) const
diff --git a/contrib/libs/pire/pire/scanners/multi.h b/contrib/libs/pire/pire/scanners/multi.h
index 52b97aadc1..29679e416e 100644
--- a/contrib/libs/pire/pire/scanners/multi.h
+++ b/contrib/libs/pire/pire/scanners/multi.h
@@ -170,17 +170,17 @@ public:
Action NextTranslated(State& state, Char letter) const
{
PIRE_IFDEBUG(
- Y_ASSERT(state >= (size_t)m_transitions);
- Y_ASSERT(state < (size_t)(m_transitions + RowSize()*Size()));
- Y_ASSERT((state - (size_t)m_transitions) % (RowSize()*sizeof(Transition)) == 0);
+ Y_ASSERT(state >= (size_t)m_transitions);
+ Y_ASSERT(state < (size_t)(m_transitions + RowSize()*Size()));
+ Y_ASSERT((state - (size_t)m_transitions) % (RowSize()*sizeof(Transition)) == 0);
);
state = Relocation::Go(state, reinterpret_cast<const Transition*>(state)[letter]);
PIRE_IFDEBUG(
- Y_ASSERT(state >= (size_t)m_transitions);
- Y_ASSERT(state < (size_t)(m_transitions + RowSize()*Size()));
- Y_ASSERT((state - (size_t)m_transitions) % (RowSize()*sizeof(Transition)) == 0);
+ Y_ASSERT(state >= (size_t)m_transitions);
+ Y_ASSERT(state < (size_t)(m_transitions + RowSize()*Size()));
+ Y_ASSERT((state - (size_t)m_transitions) % (RowSize()*sizeof(Transition)) == 0);
);
return 0;
@@ -222,8 +222,8 @@ public:
void Swap(Scanner& s)
{
- Y_ASSERT(m.relocationSignature == s.m.relocationSignature);
- Y_ASSERT(m.shortcuttingSignature == s.m.shortcuttingSignature);
+ Y_ASSERT(m.relocationSignature == s.m.relocationSignature);
+ Y_ASSERT(m.shortcuttingSignature == s.m.shortcuttingSignature);
DoSwap(m_buffer, s.m_buffer);
DoSwap(m.statesCount, s.m.statesCount);
DoSwap(m.lettersCount, s.m.lettersCount);
@@ -413,8 +413,8 @@ protected:
// Values in letter-to-leterclass table take into account row header size
for (size_t c = 0; c < MaxChar; ++c) {
m_letters[c] = s.m_letters[c] - s.HEADER_SIZE + HEADER_SIZE;
- Y_ASSERT(c == Epsilon || m_letters[c] >= HEADER_SIZE);
- Y_ASSERT(c == Epsilon || m_letters[c] < RowSize());
+ Y_ASSERT(c == Epsilon || m_letters[c] >= HEADER_SIZE);
+ Y_ASSERT(c == Epsilon || m_letters[c] < RowSize());
}
memcpy(m_final, s.m_final, m.finalTableSize * sizeof(*m_final));
memcpy(m_finalIndex, s.m_finalIndex, m.statesCount * sizeof(*m_finalIndex));
@@ -433,8 +433,8 @@ protected:
size_t destIndex = s.StateIndex(AnotherRelocation::Go(oldstate, os[let + s.HEADER_SIZE]));
Transition tr = Relocation::Diff(newstate, IndexToState(destIndex));
ns[let + HEADER_SIZE] = tr;
- Y_ASSERT(Relocation::Go(newstate, tr) >= (size_t)m_transitions);
- Y_ASSERT(Relocation::Go(newstate, tr) < (size_t)(m_transitions + RowSize()*Size()));
+ Y_ASSERT(Relocation::Go(newstate, tr) >= (size_t)m_transitions);
+ Y_ASSERT(Relocation::Go(newstate, tr) < (size_t)(m_transitions + RowSize()*Size()));
}
}
}
@@ -447,9 +447,9 @@ protected:
void SetJump(size_t oldState, Char c, size_t newState, unsigned long /*payload*/ = 0)
{
- Y_ASSERT(m_buffer);
- Y_ASSERT(oldState < m.statesCount);
- Y_ASSERT(newState < m.statesCount);
+ Y_ASSERT(m_buffer);
+ Y_ASSERT(oldState < m.statesCount);
+ Y_ASSERT(newState < m.statesCount);
m_transitions[oldState * RowSize() + m_letters[c]]
= Relocation::Diff(IndexToState(oldState), IndexToState(newState));
@@ -459,20 +459,20 @@ protected:
void SetInitial(size_t state)
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
m.initial = IndexToState(state);
}
void SetTag(size_t state, size_t value)
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
Header(IndexToState(state)).Common.Flags = value;
}
// Fill shortcut masks for all the states
void BuildShortcuts()
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
// Build the mapping from letter classes to characters
TVector< TVector<char> > letters(RowSize());
@@ -512,7 +512,7 @@ protected:
// Fills final states table and builds shortcuts if possible
void FinishBuild()
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
auto finalWriter = m_final;
for (size_t state = 0; state != Size(); ++state) {
m_finalIndex[state] = finalWriter - m_final;
@@ -710,17 +710,17 @@ public:
inline
const Word& Mask(size_t i, size_t alignOffset) const
{
- Y_ASSERT(i < ExitMaskCount);
- Y_ASSERT(alignOffset < SizeTInMaxSizeWord);
+ Y_ASSERT(i < ExitMaskCount);
+ Y_ASSERT(alignOffset < SizeTInMaxSizeWord);
const Word* p = (const Word*)(ExitMasksArray + alignOffset + MaskSizeInSizeT * i);
- Y_ASSERT(IsAligned(p, sizeof(Word)));
+ Y_ASSERT(IsAligned(p, sizeof(Word)));
return *p;
}
PIRE_FORCED_INLINE PIRE_HOT_FUNCTION
size_t Mask(size_t i) const
{
- Y_ASSERT(i < ExitMaskCount);
+ Y_ASSERT(i < ExitMaskCount);
return ExitMasksArray[MaskSizeInSizeT*i];
}
@@ -922,7 +922,7 @@ private:
typename ScannerType::State stateBefore = st;
for (const char* pos = begin; pos != end; ++pos) {
Step(scanner, st, (unsigned char)*pos);
- Y_ASSERT(st == stateBefore);
+ Y_ASSERT(st == stateBefore);
}
}
@@ -951,7 +951,7 @@ public:
}
// Row size should be a multiple of MaxSizeWord size. Then alignOffset is the same for any state
- Y_ASSERT((scanner.RowSize()*sizeof(typename ScannerType::Transition)) % sizeof(MaxSizeWord) == 0);
+ Y_ASSERT((scanner.RowSize()*sizeof(typename ScannerType::Transition)) % sizeof(MaxSizeWord) == 0);
size_t alignOffset = (AlignUp((size_t)scanner.m_transitions, sizeof(Word)) - (size_t)scanner.m_transitions) / sizeof(size_t);
bool noShortcut = Shortcutting::NoShortcut(scanner, state);
diff --git a/contrib/libs/pire/pire/scanners/simple.h b/contrib/libs/pire/pire/scanners/simple.h
index d70e699f15..ef959aeed1 100644
--- a/contrib/libs/pire/pire/scanners/simple.h
+++ b/contrib/libs/pire/pire/scanners/simple.h
@@ -207,9 +207,9 @@ protected:
void SetJump(size_t oldState, Char c, size_t newState)
{
- Y_ASSERT(m_buffer);
- Y_ASSERT(oldState < m.statesCount);
- Y_ASSERT(newState < m.statesCount);
+ Y_ASSERT(m_buffer);
+ Y_ASSERT(oldState < m.statesCount);
+ Y_ASSERT(newState < m.statesCount);
m_transitions[oldState * STATE_ROW_SIZE + 1 + c]
= (((newState - oldState) * STATE_ROW_SIZE) * sizeof(Transition));
}
@@ -218,13 +218,13 @@ protected:
void SetInitial(size_t state)
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
m.initial = reinterpret_cast<size_t>(m_transitions + state * STATE_ROW_SIZE + 1);
}
void SetTag(size_t state, size_t tag)
{
- Y_ASSERT(m_buffer);
+ Y_ASSERT(m_buffer);
m_transitions[state * STATE_ROW_SIZE] = tag;
}
diff --git a/contrib/libs/pire/pire/scanners/slow.h b/contrib/libs/pire/pire/scanners/slow.h
index dceb1ac65b..6adfcb8c1d 100644
--- a/contrib/libs/pire/pire/scanners/slow.h
+++ b/contrib/libs/pire/pire/scanners/slow.h
@@ -383,9 +383,9 @@ private:
void SetJump(size_t oldState, Char c, size_t newState, unsigned long action)
{
- Y_ASSERT(!m_vec.empty());
- Y_ASSERT(oldState < m.statesCount);
- Y_ASSERT(newState < m.statesCount);
+ Y_ASSERT(!m_vec.empty());
+ Y_ASSERT(oldState < m.statesCount);
+ Y_ASSERT(newState < m.statesCount);
size_t idx = oldState * m.lettersCount + m_letters[c];
m_vec[idx].push_back(newState);
diff --git a/contrib/libs/pire/pire/stub/stl.h b/contrib/libs/pire/pire/stub/stl.h
index 0211c06277..98ebd9f7c6 100644
--- a/contrib/libs/pire/pire/stub/stl.h
+++ b/contrib/libs/pire/pire/stub/stl.h
@@ -56,8 +56,8 @@ namespace Pire {
Error(const ystring& msg) { *this << msg; }
};
- typedef IOutputStream yostream;
- typedef IInputStream yistream;
+ typedef IOutputStream yostream;
+ typedef IInputStream yistream;
template<class Iter>
ystring Join(Iter begin, Iter end, const ystring& separator) { return JoinStrings(begin, end, separator); }