mirror of
https://github.com/ValKmjolnir/Nasal-Interpreter.git
synced 2026-07-23 03:18:43 +08:00
update
This commit is contained in:
@@ -5,15 +5,6 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
nasal::nasal_list m;
|
||||
nasal::nasal_hash n;
|
||||
nasal::var k;
|
||||
k.type=VAR_STRING;
|
||||
k.data=new std::string;
|
||||
*((std::string *)k.data)="hello";
|
||||
m.append(k);
|
||||
m.pop();
|
||||
|
||||
std::string command;
|
||||
std::cout<<">> input \"help\" to find help."<<std::endl;
|
||||
while(1)
|
||||
@@ -22,22 +13,31 @@ int main()
|
||||
std::cin>>command;
|
||||
if(command=="help")
|
||||
{
|
||||
std::cout<<">> 1.input file name to run the nasal script."<<std::endl;
|
||||
std::cout<<">> 2.command cls to clear the screen."<<std::endl;
|
||||
std::cout<<">> 3.command exit to shut down the program."<<std::endl;
|
||||
std::cout<<">> 1. input file name to run the nasal script."<<std::endl;
|
||||
std::cout<<">> 2. command cls to clear the screen."<<std::endl;
|
||||
std::cout<<">> 3. command exit to shut down the program."<<std::endl;
|
||||
std::cout<<">> 4. command lexer to see tokens in stack."<<std::endl;
|
||||
std::cout<<">> 5. command del to delete all elements in stack."<<std::endl;
|
||||
std::cout<<">> 6. command run to run the programme in stack."<<std::endl;
|
||||
}
|
||||
else if(command=="cls")
|
||||
{
|
||||
system("cls");
|
||||
//linux system("clear");
|
||||
//macOS system(clear");
|
||||
//macOS system("clear");
|
||||
}
|
||||
else if(command=="exit")
|
||||
break;
|
||||
else
|
||||
else if(command=="lexer")
|
||||
nasal::nasal_lexer.print();
|
||||
else if(command=="del")
|
||||
nasal::nasal_lexer.delete_all();
|
||||
else if(command=="run")
|
||||
{
|
||||
;
|
||||
}
|
||||
else
|
||||
nasal::RunProcess(command);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user