davidbien / lexang

Lexical Analyzer Generator Template Library
Boost Software License 1.0
0 stars 0 forks source link

DFA Optimization doesn't work for this example... #1

Closed davidbien closed 3 years ago

davidbien commented 3 years ago

Repro steps: 1) Set REGEXP_NO_TRIGGERS to hide all triggers from regular expressions. 2) The following construction.

define lr(x,y) litrange< _TyCharTokens >(x,y)

_TyFinal _NotAmperLessSingle = lr(1,L'%') | lr(L'(',L';') | lr(L'=',0xD7FF) | lr(0xE000,0x10ffff); _TyFinal _AVCharRangeNoAmperLessSingle = t(_TyTriggerCharDataSingleQuoteBegin()) ++_NotAmperLessSingle t(_TyTriggerCharDataSingleQuoteEnd()); Attr.SetAction( _l_action_token< _TyCharTokens, 1 >() ); _TyFinal All( Attr ); _TyDfa dfaAll; _TyDfaCtxt dctxtAll(dfaAll); gen_dfa(All, dfaAll, dctxtAll);

Result: An assertion in optimization fails:

void _CheckMoveHead( _TyGraphLink * _pgl ) { // See if we are entering a representative - if not move to the representative: _TyState iTransState; if ( !m_rgLookupRep[ (size_type)( iTransState = _pgl->PGNChild()->RElConst() ) ] ) { Assert( !!m_rgsmeMap[ iTransState ] );

davidbien commented 3 years ago

This was definitely fixed with the KMSBitSet() fix.