Skip to content

ccc, cccx: the power operator ^, as in SSAS - #56

Merged
stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main091126
Nov 9, 2026
Merged

stbischof merged 1 commit into
eclipse-daanse:mainfrom
dbulahov:main091126

Conversation

@dbulahov

@dbulahov dbulahov commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

#55
ccc, cccx: the power operator ^, as in SSAS

Analysis Services reads ^ as the power operator; both grammars read it as
an INVALID token. Both now have the token CARET and a power level between
the sign and the operand: ^ binds more tightly than * / and a leading sign,
groups from right to left, and its exponent may carry a sign
(2 ^ 3 ^ 2 is 2 ^ (3 ^ 2), -2 ^ 2 is -(2 ^ 2), 2 ^ -1 is read). The parsed
form is an infix call of ^, as * is; the unparser already wrote ^ back.

Tests: parser.tck PowerOperatorTest (a power in a calculated member and in
the slicer, grouping, precedence over * and /, the leading sign, a signed
and a fractional exponent, NULL ^ 2); unparser.simple SimpleUnparserPowerTest
writes the same models back. TCK green on ccc and cccx (218 tests), rolap
green against this build.

Analysis Services reads ^ as the power operator; both grammars read it as
an INVALID token. Both now have the token CARET and a power level between
the sign and the operand: ^ binds more tightly than * / and a leading sign,
groups from right to left, and its exponent may carry a sign
(2 ^ 3 ^ 2 is 2 ^ (3 ^ 2), -2 ^ 2 is -(2 ^ 2), 2 ^ -1 is read). The parsed
form is an infix call of ^, as * is; the unparser already wrote ^ back.

Tests: parser.tck PowerOperatorTest (a power in a calculated member and in
the slicer, grouping, precedence over * and /, the leading sign, a signed
and a fractional exponent, NULL ^ 2); unparser.simple SimpleUnparserPowerTest
writes the same models back. TCK green on ccc and cccx (218 tests), rolap
green against this build.

Signed-off-by: dbulahov <bulahovdenis@gmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 9, 2026

Copy link
Copy Markdown

@dbulahov dbulahov changed the title Main091126 ccc, cccx: the power operator ^, as in SSAS Nov 9, 2026
@stbischof
stbischof merged commit b0d0c7c into eclipse-daanse:main Nov 9, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants