Ambiguous associativity of noise operators

braxbro
Inserter
Inserter
Posts: 49
Joined: Sun Jan 01, 2023 2:54 am
Contact:

Ambiguous associativity of noise operators

Post by braxbro »

Hello. I'm currently working on the ClaustOrephobic rewrite, and for this I'm writing a noise parser to put noise functions in a different, but still equivalent, format.

However, I've been struggling with some ambiguities in operator associativity, and would greatly appreciate it if the associativity of operators was included in the precedence list on the noise expression API documentation - as is, I have to either guess, or painstakingly devise ways to check each non-commutative operator beforehand.
Bilka
Factorio Staff
Factorio Staff
Posts: 3636
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: Ambiguous associativity of noise operators

Post by Bilka »

Exponentiation and the unary operators are right-to-left associative. The rest of the operators are left-to-right associative. Docs improved for 2.0.67, thanks for the note.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Post Reply

Return to “Resolved Requests”