diff options
author | Adrian Thurston <thurston@colm.net> | 2019-12-30 09:55:55 +0200 |
---|---|---|
committer | Adrian Thurston <thurston@colm.net> | 2019-12-30 09:55:55 +0200 |
commit | d01f82860b3d7d4234726cd3e7d8c379e7a5633c (patch) | |
tree | 0003a31fdca2665646a126d592505ba9a918ae74 | |
parent | 87d85653af481491fb553158403871ca2c11c7e2 (diff) | |
download | colm-d01f82860b3d7d4234726cd3e7d8c379e7a5633c.tar.gz |
ragel: unified Variable and GotoLabel reference functions
-rw-r--r-- | ragel/actloop.cc | 20 | ||||
-rw-r--r-- | ragel/binbreak.cc | 4 | ||||
-rw-r--r-- | ragel/bingoto.cc | 4 | ||||
-rw-r--r-- | ragel/binvar.cc | 4 | ||||
-rw-r--r-- | ragel/codegen.h | 6 | ||||
-rw-r--r-- | ragel/flatbreak.cc | 8 | ||||
-rw-r--r-- | ragel/flatgoto.cc | 8 | ||||
-rw-r--r-- | ragel/flatvar.cc | 8 | ||||
-rw-r--r-- | ragel/gotoloop.cc | 16 | ||||
-rw-r--r-- | ragel/switchbreak.cc | 4 | ||||
-rw-r--r-- | ragel/switchgoto.cc | 4 | ||||
-rw-r--r-- | ragel/switchvar.cc | 4 | ||||
-rw-r--r-- | ragel/tabbreak.cc | 6 | ||||
-rw-r--r-- | ragel/tabgoto.cc | 2 | ||||
-rw-r--r-- | ragel/tabvar.cc | 2 |
15 files changed, 49 insertions, 51 deletions
diff --git a/ragel/actloop.cc b/ragel/actloop.cc index 05ed4e9d..675e78fa 100644 --- a/ragel/actloop.cc +++ b/ragel/actloop.cc @@ -144,10 +144,10 @@ void ActLoop::FROM_STATE_ACTIONS() if ( redFsm->anyFromStateActions() ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[" + vCS() + "]" ) << ";\n" - " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << ";\n" + " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " ) {\n"; FROM_STATE_ACTION_SWITCH() << " }\n" " " << nacts << " -= 1;\n" @@ -161,10 +161,10 @@ void ActLoop::REG_ACTIONS( std::string cond ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( condActions ) + "[" + cond + "]" ) << ";\n" - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << ";\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " )\n" + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " )\n" " {\n"; ACTION_SWITCH() << " }\n" @@ -179,10 +179,10 @@ void ActLoop::TO_STATE_ACTIONS() if ( redFsm->anyToStateActions() ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( toStateActions ) + "[" + vCS() + "]" ) << ";\n" - " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << ";\n" + " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), acts.ref() ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), acts.ref() ) << " ) {\n"; TO_STATE_ACTION_SWITCH() << " }\n" " " << nacts << " -= 1;\n" @@ -197,10 +197,10 @@ void ActLoop::EOF_ACTIONS() if ( redFsm->anyEofActions() ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( eofActions ) + "[" + vCS() + "]" ) << ";\n" - " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << ";\n" + " " << nacts << " = " << CAST(UINT()) << DEREF( ARR_REF( actions ), acts.ref() ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), acts.ref() ) << " ) {\n"; EOF_ACTION_SWITCH() << " }\n" " " << nacts << " -= 1;\n" @@ -214,10 +214,10 @@ void ActLoop::NFA_FROM_STATE_ACTION_EXEC() if ( redFsm->anyFromStateActions() ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[nfa_bp[nfa_len].state]" ) << ";\n" - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << ";\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), acts.ref() ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), acts.to_str_and_reference() ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), acts.ref() ) << " ) {\n"; FROM_STATE_ACTION_SWITCH() << " }\n" " " << nacts << " -= 1;\n" diff --git a/ragel/binbreak.cc b/ragel/binbreak.cc index 88671a54..18b71542 100644 --- a/ragel/binbreak.cc +++ b/ragel/binbreak.cc @@ -85,7 +85,7 @@ void BinBreak::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -94,7 +94,7 @@ void BinBreak::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/bingoto.cc b/ragel/bingoto.cc index 91ccbee2..1f4a818d 100644 --- a/ragel/bingoto.cc +++ b/ragel/bingoto.cc @@ -86,7 +86,7 @@ void BinGoto::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -95,7 +95,7 @@ void BinGoto::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/binvar.cc b/ragel/binvar.cc index d0f79cf3..addec681 100644 --- a/ragel/binvar.cc +++ b/ragel/binvar.cc @@ -92,7 +92,7 @@ void BinVar::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -101,7 +101,7 @@ void BinVar::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/codegen.h b/ragel/codegen.h index 4861b36a..904c839f 100644 --- a/ragel/codegen.h +++ b/ragel/codegen.h @@ -58,8 +58,7 @@ struct Variable { Variable( const char *name ) : name(name), isReferenced(false) {} - const std::string to_str_and_reference() { isReferenced = true; return name; } - void reference() { isReferenced = true; } + const std::string ref() { isReferenced = true; return name; } const char *name; bool isReferenced; @@ -69,8 +68,7 @@ struct GotoLabel { GotoLabel( const char *name ) : name(name), isReferenced(false) {} - operator std::string() { isReferenced = true; return name; } - void reference() { isReferenced = true; } + const std::string ref() { isReferenced = true; return name; } const char *name; bool isReferenced; diff --git a/ragel/flatbreak.cc b/ragel/flatbreak.cc index bb26c39d..08342625 100644 --- a/ragel/flatbreak.cc +++ b/ragel/flatbreak.cc @@ -59,11 +59,11 @@ void FlatBreak::LOCATE_TRANS() out << " " << ic << " = " << CAST("int") << ARR_REF( charClass ) << "[" << CAST("int") << GET_KEY() << " - " << lowKey << "];\n" - " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "+1" ) << " && " << - "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) << " )\n" + " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "+1" ) << " && " << + "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "" ) << " )\n" " " << trans << " = " << CAST(UINT()) << DEREF( ARR_REF( indices ), - inds.to_str_and_reference() + " + " + CAST("int") + "( " + ic.to_str_and_reference() + " - " + CAST("int") + - DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) + " ) " ) << "; \n" + inds.ref() + " + " + CAST("int") + "( " + ic.ref() + " - " + CAST("int") + + DEREF( ARR_REF( transKeys ), keys.ref() + "" ) + " ) " ) << "; \n" " else\n" " " << trans << " = " << CAST(UINT()) << ARR_REF( indexDefaults ) << "[" << vCS() << "]" << ";\n"; diff --git a/ragel/flatgoto.cc b/ragel/flatgoto.cc index 4b6939a1..c3206191 100644 --- a/ragel/flatgoto.cc +++ b/ragel/flatgoto.cc @@ -59,11 +59,11 @@ void FlatGoto::LOCATE_TRANS() out << " " << ic << " = " << CAST("int") << ARR_REF( charClass ) << "[" << CAST("int") << GET_KEY() << " - " << lowKey << "];\n" - " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "+1" ) << " && " << - "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) << " )\n" + " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "+1" ) << " && " << + "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "" ) << " )\n" " " << trans << " = " << CAST(UINT()) << DEREF( ARR_REF( indices ), - inds.to_str_and_reference() + " + " + CAST("int") + "( " + ic.to_str_and_reference() + " - " + CAST("int") + - DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) + " ) " ) << "; \n" + inds.ref() + " + " + CAST("int") + "( " + ic.ref() + " - " + CAST("int") + + DEREF( ARR_REF( transKeys ), keys.ref() + "" ) + " ) " ) << "; \n" " else\n" " " << trans << " = " << CAST(UINT()) << ARR_REF( indexDefaults ) << "[" << vCS() << "]" << ";\n"; diff --git a/ragel/flatvar.cc b/ragel/flatvar.cc index f78300cc..b747afcd 100644 --- a/ragel/flatvar.cc +++ b/ragel/flatvar.cc @@ -62,11 +62,11 @@ void FlatVar::LOCATE_TRANS() out << " " << ic << " = " << CAST("int") << ARR_REF( charClass ) << "[" << CAST("int") << GET_KEY() << " - " << lowKey << "];\n" - " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "+1" ) << " && " << - "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) << " )\n" + " if ( " << ic << " <= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "+1" ) << " && " << + "" << ic << " >= " << CAST("int") << DEREF( ARR_REF( transKeys ), keys.ref() + "" ) << " )\n" " " << trans << " = " << CAST(UINT()) << DEREF( ARR_REF( indices ), - inds.to_str_and_reference() + " + " + CAST("int") + "( " + ic.to_str_and_reference() + " - " + CAST("int") + - DEREF( ARR_REF( transKeys ), keys.to_str_and_reference() + "" ) + " ) " ) << "; \n" + inds.ref() + " + " + CAST("int") + "( " + ic.ref() + " - " + CAST("int") + + DEREF( ARR_REF( transKeys ), keys.ref() + "" ) + " ) " ) << "; \n" " else\n" " " << trans << " = " << CAST(UINT()) << ARR_REF( indexDefaults ) << "[" << vCS() << "]" << ";\n"; diff --git a/ragel/gotoloop.cc b/ragel/gotoloop.cc index e977720b..41a8cd8a 100644 --- a/ragel/gotoloop.cc +++ b/ragel/gotoloop.cc @@ -127,10 +127,10 @@ std::ostream &GotoLoop::EXEC_FUNCS() out << nbreak << " = 0;\n"; out << - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << ";\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " ) {\n"; ACTION_SWITCH() << " }\n" " " << acts << " += 1;\n" @@ -154,10 +154,10 @@ void GotoLoop::NFA_FROM_STATE_ACTION_EXEC() if ( redFsm->anyFromStateActions() ) { out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[nfa_bp[nfa_len].state]" ) << ";\n" - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << ";\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << ";\n" " " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " ) {\n"; FROM_STATE_ACTION_SWITCH() << " }\n" " " << nacts << " -= 1;\n" @@ -173,9 +173,9 @@ void GotoLoop::FROM_STATE_ACTIONS() out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( fromStateActions ) + "[" + vCS() + "]" ) << ";\n" - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << "; " << acts << " += 1;\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << "; " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " ) {\n"; FROM_STATE_ACTION_SWITCH() << " }\n" " " << acts << " += 1;\n" @@ -191,9 +191,9 @@ void GotoLoop::TO_STATE_ACTIONS() out << " " << acts << " = " << OFFSET( ARR_REF( actions ), ARR_REF( toStateActions ) + "[" + vCS() + "]" ) << ";\n" - " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << "; " << acts << " += 1;\n" + " " << nacts << " = " << CAST( UINT() ) << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << "; " << acts << " += 1;\n" " while ( " << nacts << " > 0 ) {\n" - " switch ( " << DEREF( ARR_REF( actions ), "" + acts.to_str_and_reference() + "" ) << " ) {\n"; + " switch ( " << DEREF( ARR_REF( actions ), "" + acts.ref() + "" ) << " ) {\n"; TO_STATE_ACTION_SWITCH() << " }\n" " " << acts << " += 1;\n" diff --git a/ragel/switchbreak.cc b/ragel/switchbreak.cc index d6797b57..567dfbc4 100644 --- a/ragel/switchbreak.cc +++ b/ragel/switchbreak.cc @@ -28,7 +28,7 @@ void SwitchBreak::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -37,7 +37,7 @@ void SwitchBreak::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/switchgoto.cc b/ragel/switchgoto.cc index 072fbb45..3b293c70 100644 --- a/ragel/switchgoto.cc +++ b/ragel/switchgoto.cc @@ -28,7 +28,7 @@ void SwitchGoto::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -37,7 +37,7 @@ void SwitchGoto::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/switchvar.cc b/ragel/switchvar.cc index 74f9ce34..b19f28db 100644 --- a/ragel/switchvar.cc +++ b/ragel/switchvar.cc @@ -30,7 +30,7 @@ void SwitchVar::LOCATE_COND() std::stringstream success, error; out << - " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.to_str_and_reference() + "]" ) << ";\n" + " " << ckeys << " = " << OFFSET( ARR_REF( condKeys ), ARR_REF( transOffsets ) + "[" + trans.ref() + "]" ) << ";\n" " " << klen << " = " << CAST( "int" ) << ARR_REF( transLengths ) << "[" << trans << "];\n" " " << cond << " = " << CAST( UINT() ) << ARR_REF( transOffsets ) << "[" << trans << "];\n" "\n"; @@ -39,7 +39,7 @@ void SwitchVar::LOCATE_COND() " " << cpc << " = 0;\n"; if ( red->condSpaceList.length() > 0 ) - COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.to_str_and_reference() + "]" ); + COND_EXEC( ARR_REF( transCondSpaces ) + "[" + trans.ref() + "]" ); success << cond << " += " << CAST( UINT() ) << "(_mid - " << ckeys << ");\n"; diff --git a/ragel/tabbreak.cc b/ragel/tabbreak.cc index 5e46635c..5ded768a 100644 --- a/ragel/tabbreak.cc +++ b/ragel/tabbreak.cc @@ -29,7 +29,7 @@ std::string TabBreak::BREAK( GotoLabel &label ) string ret = "break"; if ( loopLabels ) { ret += " "; - ret += label; + ret += label.ref(); } return ret; } @@ -39,7 +39,7 @@ std::string TabBreak::CONTINUE( GotoLabel &label ) string ret = "continue"; if ( loopLabels ) { ret += " "; - ret += label; + ret += label.ref(); } return ret; } @@ -273,7 +273,7 @@ void TabBreak::writeExec() out << " " << ps << " = " << vCS() << ";\n"; string condVar = - red->condSpaceList.length() != 0 ? cond.to_str_and_reference() : trans.to_str_and_reference(); + red->condSpaceList.length() != 0 ? cond.ref() : trans.ref(); out << " " << vCS() << " = " << CAST(INT()) << ARR_REF( condTargs ) << "[" << condVar << "];\n\n"; diff --git a/ragel/tabgoto.cc b/ragel/tabgoto.cc index f3664c7c..ca90cb9d 100644 --- a/ragel/tabgoto.cc +++ b/ragel/tabgoto.cc @@ -235,7 +235,7 @@ void TabGoto::writeExec() out << " " << ps << " = " << vCS() << ";\n"; string condVar = - red->condSpaceList.length() != 0 ? cond.to_str_and_reference() : trans.to_str_and_reference(); + red->condSpaceList.length() != 0 ? cond.ref() : trans.ref(); out << " " << vCS() << " = " << CAST(INT()) << ARR_REF( condTargs ) << "[" << condVar << "];\n\n"; diff --git a/ragel/tabvar.cc b/ragel/tabvar.cc index 290185e0..02bd7b55 100644 --- a/ragel/tabvar.cc +++ b/ragel/tabvar.cc @@ -217,7 +217,7 @@ void TabVar::writeExec() out << " " << ps << " = " << vCS() << ";\n"; string condVar = - red->condSpaceList.length() != 0 ? cond.to_str_and_reference() : trans.to_str_and_reference(); + red->condSpaceList.length() != 0 ? cond.ref() : trans.ref(); out << " " << vCS() << " = " << CAST(INT()) << ARR_REF( condTargs ) << "[" << condVar << "];\n\n"; |