Eliminated "handled" field in Parser::Action
This field was used during development to measure the
coverage of the ANSI terminal parser against typical
terminal input sequences.
The "handled" field has not been read by any code since
commit 1ee54cd7 (February 2011). Eliminating the field
by popular request (closes #723).
This commit is contained in:
@@ -110,12 +110,10 @@ void UserByte::act_on_terminal( Terminal::Emulator *emu ) const
|
||||
void Resize::act_on_terminal( Terminal::Emulator *emu ) const
|
||||
{
|
||||
emu->resize( width, height );
|
||||
handled = true;
|
||||
}
|
||||
|
||||
bool Action::operator==( const Action &other ) const
|
||||
{
|
||||
return ( char_present == other.char_present )
|
||||
&& ( ch == other.ch )
|
||||
&& ( handled == other.handled );
|
||||
&& ( ch == other.ch );
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ namespace Parser {
|
||||
public:
|
||||
wchar_t ch;
|
||||
bool char_present;
|
||||
mutable bool handled;
|
||||
|
||||
std::string str( void );
|
||||
|
||||
@@ -56,7 +55,7 @@ namespace Parser {
|
||||
|
||||
virtual bool ignore() const { return false; }
|
||||
|
||||
Action() : ch( -1 ), char_present( false ), handled( false ) {};
|
||||
Action() : ch( -1 ), char_present( false ) {};
|
||||
virtual ~Action() {};
|
||||
|
||||
virtual bool operator==( const Action &other ) const;
|
||||
|
||||
@@ -118,13 +118,11 @@ void Emulator::print( const Parser::Print *act )
|
||||
|
||||
fb.ds.move_col( chwidth, true, true );
|
||||
|
||||
act->handled = true;
|
||||
break;
|
||||
case 0: /* combining character */
|
||||
{
|
||||
Cell *combining_cell = fb.get_combining_cell(); /* can be null if we were resized */
|
||||
if ( combining_cell == NULL ) { /* character is now offscreen */
|
||||
act->handled = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -141,7 +139,6 @@ void Emulator::print( const Parser::Print *act )
|
||||
if ( !combining_cell->full() ) {
|
||||
combining_cell->append( ch );
|
||||
}
|
||||
act->handled = true;
|
||||
}
|
||||
break;
|
||||
case -1: /* unprintable character */
|
||||
|
||||
@@ -54,7 +54,6 @@ void Dispatcher::newparamchar( const Parser::Param *act )
|
||||
if ( params.length() < 100 ) {
|
||||
/* enough for 16 five-char params plus 15 semicolons */
|
||||
params.push_back( act->ch );
|
||||
act->handled = true;
|
||||
}
|
||||
parsed = false;
|
||||
}
|
||||
@@ -65,16 +64,14 @@ void Dispatcher::collect( const Parser::Collect *act )
|
||||
if ( ( dispatch_chars.length() < 8 ) /* never should need more than 2 */
|
||||
&& ( act->ch <= 255 ) ) { /* ignore non-8-bit */
|
||||
dispatch_chars.push_back( act->ch );
|
||||
act->handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Dispatcher::clear( const Parser::Clear *act )
|
||||
void Dispatcher::clear( const Parser::Clear *act __attribute((unused)) )
|
||||
{
|
||||
params.clear();
|
||||
dispatch_chars.clear();
|
||||
parsed = false;
|
||||
act->handled = true;
|
||||
}
|
||||
|
||||
void Dispatcher::parse_params( void )
|
||||
@@ -228,7 +225,6 @@ void Dispatcher::dispatch( Function_Type type, const Parser::Action *act, Frameb
|
||||
fb->ds.next_print_will_wrap = false;
|
||||
return;
|
||||
} else {
|
||||
act->handled = true;
|
||||
if ( i->second.clears_wrap_state ) {
|
||||
fb->ds.next_print_will_wrap = false;
|
||||
}
|
||||
@@ -241,14 +237,12 @@ void Dispatcher::OSC_put( const Parser::OSC_Put *act )
|
||||
assert( act->char_present );
|
||||
if ( OSC_string.size() < 256 ) { /* should be a long enough window title */
|
||||
OSC_string.push_back( act->ch );
|
||||
act->handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
void Dispatcher::OSC_start( const Parser::OSC_Start *act )
|
||||
void Dispatcher::OSC_start( const Parser::OSC_Start *act __attribute((unused)) )
|
||||
{
|
||||
OSC_string.clear();
|
||||
act->handled = true;
|
||||
}
|
||||
|
||||
bool Dispatcher::operator==( const Dispatcher &x ) const
|
||||
|
||||
@@ -557,7 +557,7 @@ static void CSI_DECSTR( Framebuffer *fb, Dispatcher *dispatch __attribute((unuse
|
||||
static Function func_CSI_DECSTR( CSI, "!p", CSI_DECSTR );
|
||||
|
||||
/* xterm uses an Operating System Command to set the window title */
|
||||
void Dispatcher::OSC_dispatch( const Parser::OSC_End *act, Framebuffer *fb )
|
||||
void Dispatcher::OSC_dispatch( const Parser::OSC_End *act __attribute((unused)), Framebuffer *fb )
|
||||
{
|
||||
if ( OSC_string.size() >= 1 ) {
|
||||
long cmd_num = -1;
|
||||
@@ -581,8 +581,6 @@ void Dispatcher::OSC_dispatch( const Parser::OSC_End *act, Framebuffer *fb )
|
||||
Terminal::Framebuffer::title_type newtitle( OSC_string.begin() + offset, OSC_string.end() );
|
||||
if ( set_icon ) { fb->set_icon_name( newtitle ); }
|
||||
if ( set_title ) { fb->set_window_title( newtitle ); }
|
||||
|
||||
act->handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ using namespace std;
|
||||
string UserInput::input( const Parser::UserByte *act,
|
||||
bool application_mode_cursor_keys )
|
||||
{
|
||||
act->handled = true;
|
||||
|
||||
/* The user will always be in application mode. If stm is not in
|
||||
application mode, convert user's cursor control function to an
|
||||
ANSI cursor control sequence */
|
||||
|
||||
Reference in New Issue
Block a user