end curses on exit, s:-
This commit is contained in:
+13
-5
@@ -46,14 +46,15 @@ namespace /* internal */
|
||||
|
||||
void unexpected_char(char c)
|
||||
{
|
||||
cerr << "Line " << line << ": Unexpected '" << c << "'\n";
|
||||
endwin();
|
||||
cerr << "Line " << line << ": Unexpected '" << c << std::endl;
|
||||
exit(1);
|
||||
/* throw 0; */
|
||||
}
|
||||
|
||||
void unexpected_end()
|
||||
{
|
||||
cerr << "Unexpected end of file";
|
||||
endwin();
|
||||
cerr << "Unexpected end of file" << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ namespace /* internal */
|
||||
else if(res.second == Nobody)
|
||||
res.second = cur_tree->findId(name.data())[same_name_index];
|
||||
else
|
||||
/* todo */exit(1);
|
||||
/* todo */TFT_EXIT(1);
|
||||
same_name_index = 0;
|
||||
name.clear();
|
||||
break;
|
||||
@@ -204,6 +205,12 @@ namespace /* internal */
|
||||
{
|
||||
switch(*it_data)
|
||||
{
|
||||
case '-':
|
||||
if(name.empty())
|
||||
res.push_back( cur_tree->last() );
|
||||
else
|
||||
unexpected_char('-');
|
||||
break;
|
||||
case ',':
|
||||
if(!name.empty())
|
||||
{
|
||||
@@ -216,7 +223,8 @@ namespace /* internal */
|
||||
break;
|
||||
case '\n':
|
||||
++line;
|
||||
res.push_back( cur_tree->findId(name.data())[same_name_index] );
|
||||
if(!name.empty())
|
||||
res.push_back( cur_tree->findId(name.data())[same_name_index] );
|
||||
return res;
|
||||
case '_':
|
||||
name.push_back(' ');
|
||||
|
||||
Reference in New Issue
Block a user