mirror of
https://github.com/louisrubet/rpn
synced 2025-02-06 08:46:31 +01:00
Rationalize syntax strings
This commit is contained in:
parent
1722636222
commit
8695f8214e
2 changed files with 21 additions and 4 deletions
|
@ -24,14 +24,19 @@ void help()
|
||||||
rpn_uname();
|
rpn_uname();
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
|
|
||||||
cout<<"HP28S Reverse Polish Notation language simulator"<<endl;
|
// syntax
|
||||||
cout<<"syntax: rpn [command]"<<endl;
|
for (int i = 0; syntax[i] != NULL; i++)
|
||||||
cout<<"with optional command = list of commands"<<endl;
|
cout<<syntax[i]<<endl;
|
||||||
|
|
||||||
|
// keywords
|
||||||
for(unsigned int i=0; i<sizeof(_keywords)/sizeof(_keywords[0]); i++)
|
for(unsigned int i=0; i<sizeof(_keywords)/sizeof(_keywords[0]); i++)
|
||||||
if (_keywords[i].comment.size() != 0)
|
if (_keywords[i].comment.size() != 0)
|
||||||
cout<<_keywords[i].name<<"\t"<<_keywords[i].comment<<endl;
|
cout<<_keywords[i].name<<"\t"<<_keywords[i].comment<<endl;
|
||||||
cout<<endl;
|
cout<<endl;
|
||||||
|
|
||||||
|
// different modes
|
||||||
cout<<"Current verbosity is "<<g_verbose<<endl;
|
cout<<"Current verbosity is "<<g_verbose<<endl;
|
||||||
|
|
||||||
cout<<"Current float mode is ";
|
cout<<"Current float mode is ";
|
||||||
switch(number::s_mode)
|
switch(number::s_mode)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +45,9 @@ void help()
|
||||||
case number::sci: cout << "'sci'"; break;
|
case number::sci: cout << "'sci'"; break;
|
||||||
default: cout << "unknown"; break;
|
default: cout << "unknown"; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
cout<<endl<<"Current float precision is "<<number::s_current_precision<<endl;
|
cout<<endl<<"Current float precision is "<<number::s_current_precision<<endl;
|
||||||
|
|
||||||
cout<<"Current binary mode is ";
|
cout<<"Current binary mode is ";
|
||||||
switch(binary::s_mode)
|
switch(binary::s_mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
// version and soft name
|
||||||
static const char version[] = "1.3-beta";
|
static const char version[] = "1.3-beta";
|
||||||
static const char uname[] = "rpn v1.3-beta, (c) 2015 <louis@rubet.fr>";
|
static const char uname[] = "rpn v1.3-beta, (c) 2015 <louis@rubet.fr>";
|
||||||
|
|
||||||
|
// syntax
|
||||||
|
static const char* syntax[] = {
|
||||||
|
"Reverse Polish Notation language, based on hewlett-Packard RPL",
|
||||||
|
"Syntax: rpn [command]",
|
||||||
|
"with optional command = list of commands",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
static const char prompt[] = ATTR_BOLD "rpn" ATTR_OFF "> ";
|
static const char prompt[] = ATTR_BOLD "rpn" ATTR_OFF "> ";
|
||||||
|
|
Loading…
Add table
Reference in a new issue