#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

#define tf(IsTrue) ((IsTrue) ? "True" : "False")

int main() {
   uCalc uc;
   auto t = uc.NewTransformer();
   t.Text("x = 1; if (true) func1(3+4); else func2(x*y); y = x + 2");
   auto p = t.Pattern("if {etc}");

   cout << "Input: " << t.Text() << endl;
   cout << "Pattern: " << p.Pattern() << endl;
   cout << "" << endl;

   t.Find();
   cout << "StatementSensitive: " << tf(t.DefaultRuleSet().StatementSensitive()) << endl;
   cout << t.Matches().Text() << endl;
   cout << "" << endl;

   t.DefaultRuleSet().StatementSensitive(false);
   t.Find();
   cout << "StatementSensitive: " << tf(t.DefaultRuleSet().StatementSensitive()) << endl;
   cout << t.Matches().Text() << endl;
}