uCalc API Version: 5.7.0-preview.1 Released: 7/30/2026
Warning
uCalc API Preview Release Notice:This preview documentation describes the intended behavior of the API. It is not fully accurate or complete.The current preview build contains incomplete features, unoptimized performance, and is subject to breaking changes.Use of the preview version in your production code is not recommended.
Description: A collection of shorthand names for common structural directives and category matchers used to improve pattern readability and conciseness.
In the uCalc::Transformer, patterns can often become lengthy when using full descriptive names for every token type. Aliases are functionally identical counterparts to standard directives that allow you to express the same logic with fewer characters.
Directives and their aliases are not case-sensitive. For example, {@Tab}, {@tab}, and {@TAB} are all evaluated identically by the engine.
The following table lists the most frequently used aliases:
| Alias | Full Name | Purpose |
|---|---|---|
{@nl} | {@Newline} | Matches vertical line breaks. |
{@Alpha} | {@Alphanumeric} | Matches alphabetic or alphanumeric identifiers. |
{@ws} | {@Whitespace} | Matches horizontal spaces and tabs. |
{@str} / {@s} | {@String} | Matches any full quoted string (auto-detected). |
{@dqs} | {@StringDQ} | Matches a full string enclosed in ". |
{@sqs} | {@StringSQ} | Matches a full string enclosed in '. |
{@dq} | {@DoubleQuoteChar} | Matches a literal " character. |
{@sq} | {@SingleQuoteChar} | Matches a literal ' character. |
{@Sep} | {@StatementSeparator} | Matches boundaries like ;. |
{@dq} matches only the double-quote character.{@dqs} matches the quote character plus all the text inside until the closing quote.{@Alpha} (and its full name {@Alphanumeric}) follows the standard for programming identifiers, meaning it includes digits and underscores.{@DoubleQuoteChar} to match the existing alias {@dq} ensures that the library feels complete for developers who prefer verbose code.Showing the difference between matching a quote character and a full quoted string.
New(uCalc::Transformer, t)// Pattern: Match 'msg' followed by a literal quotet.FromTo("msg {@dq}", "MSG_START")// Pattern: Match 'msg' followed by a full quoted stringt.FromTo("msg {@dqs:val}", "MESSAGE({val})")wl(t.Transform("msg \"Hello World\""))Using {@ws} and {@nl} to keep a pattern concise while stripping trailing space.
New(uCalc::Transformer, t)// Verbose: {@Alpha:w} {@Whitespace} {@Newline}t.FromTo("{@Alpha:w} {@ws} {@nl}", "{w}{@nl}")wl(t.Transform("Test \n"))[Expected Output]Test\n
{@dq} (char) and {@dqs} (string) is vital. Mapping {@dq} to a full string is a common mistake in early pattern design; these aliases help reinforce the correct logic.{@Sep} and {@nl} across a project ensures that different developers are speaking the same shorthand.{@nl}) and Topic 827 ({@dq}) for detailed behavioral documentation.