@@ -322,7 +322,7 @@ inline Token LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::recogniz
322
322
stack.push_back (BadState);
323
323
324
324
if constexpr (Trace)
325
- tracef (" recognize : startState {}, offset {} {}" ,
325
+ tracef (" recognizeOne : startState {}, offset {} {}" ,
326
326
stateName (state),
327
327
offset_,
328
328
isBeginOfLine_ ? " BOL" : " no-BOL" );
@@ -331,6 +331,7 @@ inline Token LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::recogniz
331
331
while (state != ErrorState)
332
332
{
333
333
Symbol ch = nextChar (); // one of: input character, ERROR or EOF
334
+ fmt::print (" recognizeOne: ch: {}\n " , ch);
334
335
currentToken_.literal .push_back (ch);
335
336
336
337
// we do not stack.clear() stack if isAcceptState(state) as we need this information iff
@@ -344,7 +345,7 @@ inline Token LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::recogniz
344
345
while (state != BadState && !isAcceptState (state))
345
346
{
346
347
if constexpr (Trace)
347
- tracef (" recognize : backtrack: current state {} {}; stack: {}" ,
348
+ tracef (" recognizeOne : backtrack: current state {} {}; stack: {}" ,
348
349
stateName (state),
349
350
isAcceptState (state) ? " accepting" : " non-accepting" ,
350
351
toString (stack));
@@ -391,7 +392,7 @@ inline Token LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::recogniz
391
392
currentToken_.offset ,
392
393
offset_,
393
394
quotedString (currentToken_.literal ),
394
- quoted (currentChar_));
395
+ prettySymbol (currentChar_));
395
396
396
397
if (!isAcceptState (state))
397
398
throw LexerError { offset_ };
@@ -464,7 +465,7 @@ inline Symbol LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::nextCha
464
465
}
465
466
466
467
int ch = source_->get ();
467
- fmt::print (" source.get: => {} (0x{:02X}, {})\n " , ch, (uint8_t )ch, prettySymbol (ch));
468
+ fmt::print (" source.get: => {} (0x{:02X}, {})\n " , ch, (uint16_t )ch, prettySymbol (ch));
468
469
if (ch < 0 )
469
470
{
470
471
currentChar_ = Symbols::EndOfFile;
@@ -490,6 +491,7 @@ inline void LexerIterator<Token, Machine, RequiresBeginOfLine, Trace>::rollback(
490
491
{
491
492
offset_--;
492
493
buffered_.push_back (currentToken_.literal .back ());
494
+ tracef (" Lexer:{}: rollback '{}'" , offset_, prettySymbol (buffered_.back ()));
493
495
}
494
496
}
495
497
0 commit comments