Warning
uCalc API Preview Release Notice:The uCalc engine has successfully transitioned to modern cross-platform environments.The next phase envolves some structural changes, performance optimizations, and API refinements.The API is subject to breaking changes prior to the stable release. Please evaluate the preview version thoroughly before production use.
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)" This page last modified on: