FACT++  1.0
bool Readline::PreProcess ( const std::string &  str)
virtual

Definition at line 1049 of file Readline.cc.

References fCommandLog, fLabel, fScriptDepth, fSection, Process(), and SetSection().

Referenced by ProcessLine(), and UpdatePrompt().

1050 {
1051  // ----------- Labels -------------
1052 
1053  if (str[0]==':')
1054  {
1055  try
1056  {
1057  fSection = stoi(str.substr(1));
1059 
1060  if (fLabel!=fSection)
1061  return true;
1062  }
1063  catch (const logic_error &e)
1064  {
1065  fCommandLog << "# ERROR[" << fScriptDepth << "] - Inavlid label '" << str.substr(1) << "'" << endl;
1066  fLabel = -2;
1067  return true;
1068  }
1069 
1070  fLabel=-1;
1071  return false;
1072  }
1073 
1074  if (fLabel>=0)
1075  {
1076  fCommandLog << "# SKIP[" << fScriptDepth << "]: " << fLabel << " - " << str << endl;
1077  return true;
1078  }
1079 
1080  if (str.substr(0, 3)==".j ")
1081  {
1082  fLabel = atoi(str.substr(3).c_str());
1083  return false;
1084  }
1085 
1086  return Process(str);
1087 
1088 }
static int fScriptDepth
Definition: Readline.h:32
char str[80]
Definition: test_client.c:7
virtual bool Process(const std::string &str)
Definition: Readline.cc:1094
std::ofstream fCommandLog
Maximum number of lines in the history file.
Definition: Readline.h:25
virtual void SetSection(int)
Definition: Readline.h:68
int fSection
Definition: Readline.h:30
int fLabel
Definition: Readline.h:31

+ Here is the call graph for this function:

+ Here is the caller graph for this function: