using uCalcSoftware; var uc = new uCalc(); var t = uc.NewTransformer(); // By default, a comment would cause a syntax error. Console.Write("Before: "); Console.WriteLine(uc.EvalStr("10 + 5 // Add 5")); // 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); Console.Write("After: "); Console.WriteLine(uc.EvalStr("10 + 5 // Add 5"));