Creating an error handler that automatically defines variables on the fly by checking for an 'Undefined Identifier' error.
Defines a C-style line comment token (`//...`) and categorizes it as whitespace so it is ignored by the parser.
Defines a custom `sum_to` operator to calculate the sum of a numeric range, demonstrating a single-word operator.
Demonstrates `ByExpr` to create a custom `Assert` function where the error message is only evaluated if the assertion fails, improving performance.
Demonstrates a practical callback that retrieves a 'host application setting', simulating I/O or access to native configuration.
Demonstrates context isolation by retrieving the parent uCalc instance from a Matches object and evaluating an expression that only exists in that parent's context.
Demonstrates how uCalc's token-aware Transformer safely renames a variable without corrupting a string literal, a common failure point for Regex.
Demonstrates interoperability between `Transformer` and `String` objects, and chaining methods to create nested views.
Demonstrates introspection within a callback, retrieving the parameter count of the calling function.
Demonstrates the basic difference between getting all matches and filtering for only 'focusable' ones.
Demonstrates the core C# idioms: `using` for lifetime management, property syntax for setters/getters, and implicit string conversions.
Demonstrates the default `QuoteSensitive(true)` behavior, where a pattern match is ignored inside a string literal.
Demonstrates the difference in variable capture behavior when StatementSensitive is enabled versus disabled.
Demonstrates the pass/fail behavior of GlobalMinimum. If the rule doesn't find at least 3 'a's, the entire transform fails.
Demonstrates the power of token-awareness by safely renaming a variable while ignoring its name inside a string literal—a common failure point for character-based Regex.
Demonstrates the recommended practice of using a scoped block for automatic resource management, preventing memory leaks.
Demonstrates the Transformer's token-aware safety by correctly renaming a variable without corrupting a string literal or comment.
Demonstrates type punning by interpreting an unsigned byte (`Int8u`) result as a signed byte (`Int8`) to observe how values wrap around.
Demonstrates using `RewindOnChange` to create a recursive `AddUp` function within the expression transformer.
Demonstrates using `RewindOnChange(true)` to perform recursive-style transformations, such as creating a variadic `AddUp` function.
Demonstrates using the Text property with implicit conversions (shortcuts) to parse a simple config string.