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.
Product:
Class:
Returns the precedence level for a rule
Returns the precedence level for a rule.
setter[Revisit]Patterns that start (and/or end) with a pattern variable instead of a token or identifier can (and probably should) be assigned a precedence level. You can choose any arbitrary numerical value. The meaning of the precedence level depends on whether the value is greater, equal, or less than adjacent patterns with a precedence level. It works similarly to precedence levels for operators. For instance, if you define:
FromTo("{a} + {b}", "({a} + {b})").Precedence(10); FromTo("{a} * {b}", "({a} * {b})").Precedence(20); Then "1 + 2 * 3 + 4" transforms into "(1 + (2 * 3) + 4)" "1 * 2 + 3 * 4" transforms into "(1 * 2) + (3 * 4)"