=============== Error Reporting =============== .. contents:: :local: :depth: 2 Parse error data is stored in property **UniversalExpressionParser.IParseErrorData ParseErrorData { get; }**. The class **UniversalExpressionParser.IParseErrorData** has a property **IReadOnlyList AllParseErrorItems { get; }** that stores data on all parse errors. .. raw:: html

Click here to see the definition of UniversalExpressionParser.IParseErrorItem

The extensions class **UniversalExpressionParser.ParseExpressionResultExtensionMethods** has number of helper methods, among which is **string GetErrorTextWithContextualInformation(this IParsedExpressionResult parsedExpressionResult, int parsedTextStartPosition, int parsedTextEnd, int maxNumberOfCharactersToShowBeforeOrAfterErrorPosition = 50)** for returning a string with error details and contextual data (i.e., text before and after the position where error happened, along with arrow pointing to the error). .. raw:: html

Click here to see the definition of UniversalExpressionParser.ParseExpressionResultExtensionMethods

- Below is an expression which has several errors: .. sourcecode:: :linenos: var x = y /*operator is missing here*/x; { // This code block is not closed f1(x, y, /*function parameter is missing here*/) { var z = ++x + y + /*' +' is not a postfix and operand is missing */; return + /*' +' is not a postfix and operand is missing */ z + y; } // Closing curly brace is missing here .. raw:: html

Click here to see the visualized instance of UniversalExpressionParser.IParseExpressionResult

.. raw:: html

Click to see the the error text generated by using the helper extension method UniversalExpressionParser.ParseExpressionResultExtensionMethods.GetErrorTextWithContextualInformation(...) for the errors reported by the parser for the expression above