MerlinofMines / EasyCommands

Github Repository for Ingame Scripts built by MerlinofMines. Uses MDK to Deploy to SpaceEngineerse
GNU General Public License v3.0
8 stars 3 forks source link

Minus Operation Support #132

Closed MerlinofMines closed 2 years ago

MerlinofMines commented 2 years ago

This commit adds support for "-" to mean either subtraction or negation, depending on it's surrounding context. This effectively enables support for negating variables without requiring -1 * variable. Now you can simply do -variable. Negation takes precedence, so -a-a = (-a) - a, vs -(a-a).

This commit also changes parentheses processing to throw out branches that do not resolve to a single value. The new expectation is that anything in parentheses should resolve to a single value, be it a selector, variable or command.

MerlinofMines commented 2 years ago

This commit resolves #124