#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto t = uc.NewTransformer(); // By default, a comment would cause a syntax error. cout << "Before: "; cout << uc.EvalStr("10 + 5 // Add 5") << endl; // Add a new token definition for C-style comments. // The regex `//.*` matches from '//' to the end of the line. // We classify it as Whitespace so the parser skips it. uc.ExpressionTokens().Add("//.*", TokenType::Whitespace); cout << "After: "; cout << uc.EvalStr("10 + 5 // Add 5") << endl; }