Partially working with nested conditionals.
Some of the conditional-skip code is a bit wrong...
This commit is contained in:
@ -42,14 +42,20 @@ namespace Dillo::Hydrogen::JavaScriptForge ::detail:: StackMachine_m
|
||||
using Float= long double;
|
||||
|
||||
|
||||
std::map< std::string, std::string > words;
|
||||
std::map< std::string, std::vector< std::string > > words;
|
||||
|
||||
// Which side of the current conditional to take.
|
||||
enum ConditionalState { If, Else };
|
||||
enum ConditionalState { If, Else, Skipped };
|
||||
std::vector< ConditionalState > conditionals;
|
||||
std::vector< ConditionalState > resumeConditionals;
|
||||
|
||||
ConditionalState currentState;
|
||||
|
||||
std::optional< std::string > definition;
|
||||
|
||||
std::ostream &output;
|
||||
|
||||
|
||||
void runWord( std::string_view word );
|
||||
|
||||
std::string pop();
|
||||
@ -63,7 +69,7 @@ namespace Dillo::Hydrogen::JavaScriptForge ::detail:: StackMachine_m
|
||||
template< typename T >
|
||||
void push( const T &t );
|
||||
|
||||
std::ostream &output;
|
||||
std::string next();
|
||||
|
||||
public:
|
||||
StackMachine( std::ostream &output= std::cout );
|
||||
|
||||
Reference in New Issue
Block a user