MCPcopy Create free account
hub / github.com/YosysHQ/nextpnr / parseEvent

Method parseEvent

3rdparty/python-console/Console.cpp:89–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89void Console::parseEvent( const ParseMessage& message )
90{
91 // handle invalid user input
92 if ( message.errorCode )
93 {
94 setTextColor( ERROR_COLOR );
95 append(message.message.c_str());
96
97 setTextColor( NORMAL_COLOR );
98 append("");
99 displayPrompt( );
100 return;
101 }
102
103 // interpret valid user input
104 int errorCode;
105 std::string res;
106 if ( message.message.size() )
107 res = m_interpreter->interpret( message.message, &errorCode );
108 if ( errorCode )
109 {
110 setTextColor( ERROR_COLOR );
111 }
112 else
113 {
114 setTextColor( OUTPUT_COLOR );
115 }
116
117 if ( res.size( ) )
118 {
119 append(res.c_str());
120 }
121
122 setTextColor( NORMAL_COLOR );
123
124 // set up the next line on the console
125 append("");
126 displayPrompt( );
127}
128
129QString Console::getLine( )
130{

Callers 1

broadcastMethod · 0.45

Calls 3

interpretMethod · 0.80
c_strMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected