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

using namespace std;
using namespace uCalcSoftware;

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

int main() {
   uCalc uc;
   {
      uCalc::Transformer t;
      t.Owned(); // Causes t to be released when it goes out of scope
      auto alphaToken = t.Tokens()["_token_alphanumeric"];

      cout << "1. Initial Type is Alphanumeric: " << tf(alphaToken.TypeOfToken() == TokenType::AlphaNumeric) << endl;

      // Change it to a literal
      alphaToken.TypeOfToken(TokenType::Literal);
      cout << "2. Type is now Literal: " << tf(alphaToken.TypeOfToken() == TokenType::Literal) << endl;
      cout << "3. Type is no longer Alphanumeric: " << tf(alphaToken.TypeOfToken() != TokenType::AlphaNumeric) << endl;

      // Change it back
      alphaToken.TypeOfToken(TokenType::AlphaNumeric);
      cout << "4. Reverted Type is Alphanumeric: " << tf(alphaToken.TypeOfToken() == TokenType::AlphaNumeric) << endl;
   }
}