Commit 2026-11-10 11:56 b7a8e3a8
View on Github →chore(Algebra/Polynomial): parse R[X] as R + [ + X + ] (#45573)
The current notation has several issues:
- It accepts whitespace, so
R [X]parses asPolynomial Rtoo. - It makes
[X]a token, sosimp [X]parses assimp+[X](a parse error) rather than the expectedsimp+[+X+]because of the longest parse rule. Replacing thenotationcontaining the[X]token by asyntaxcontaining the[,X,]tokens separated bynoWsfixes the second issue. Adding one morenoWsbefore the[token fixes the first issue. The priority of the syntax is decided in comparison to that ofAddMonoidAlgebra(which ishigh) andGetElem. Written by Claude Opus, tweaked by myself. Assisted-by: Claude Opus 5.5