enso/test
Kaz Wesley e5b85bf16e
Space-precedence does not apply to value-level operators (#10597)
In a sequence of value-level operators, whitespace does not affect relative precedence. Functional operators still follow the space-precedence rules.

The "functional" operators are: `>> << |> |>> <| <<| : .`, application, and any operator containing `<-` or `->`. All other operators are considered value-level operators.

Asymmetric whitespace can still be used to form *operator sections* of value-level operators, e.g. `+2 * 3` is still equivalent to `x -> (x+2) * 3`.

Precedence of application is unchanged, so `f x+y` is still equivalent to `f (x + y)` and `f x+y * z` is still equivalent to `(f (x + y)) * z`.

Any attempt to use spacing to override value-level operator precedence will be caught by the new enso linter. Mixed spacing (for clarity) in value-operator expressions is allowed, as long as it is consistent with the precedences of the operators.

Closes #10366.

# Important Notes
Precedence warnings:
- The parser emits a warning if the whitespace in an expression is inconsistent with its effective precedence.
- A new enso linter can be run with `./run libraries lint`. It parses all `.enso` files in `distribution/lib` and `test`, and reports any errors or warnings. It can also be run on individual files: `cargo run --release --bin check_syntax -- file1 file2...` (the result may be easier to read than the `./run` output).
- The linter is also run as part of `./run lint`, so it is checked in CI.

Additional language change:
- The exponentiation operator (`^`) now has higher precedence than the multiplication class (`*`, `/`, `%`). This change did not affect any current enso files.

Library changes:
- The libraries have been updated. The new warnings were used to identify all affected code; the changes themselves have not been programmatically verified (in many cases their equivalence relies on the commutativity of string concatenation).
2024-07-24 10:55:44 +00:00
..
AWS_Tests Space-precedence does not apply to value-level operators (#10597) 2024-07-24 10:55:44 +00:00
Base_Tests Space-precedence does not apply to value-level operators (#10597) 2024-07-24 10:55:44 +00:00
Benchmarks Detect compilation while benchmarking (#10574) 2024-07-18 15:49:16 +00:00
Examples_Tests Rename Map to Dictionary and Set to Hashset. (#10474) 2024-07-09 09:12:23 +00:00
Exploratory_Benchmarks Final step removing the Problem_Behavior publishing. (#10461) 2024-07-05 18:41:36 +00:00
Geo_Tests Snowflake Dialect pt. 6 - Union, Distinct and other improvements (#10576) 2024-07-19 16:04:00 +00:00
Google_Api_Test Enso tests can be run with filter from cmdline (#9065) 2024-02-22 12:31:44 +00:00
Helpers Implement private methods (#10060) 2024-05-31 08:00:20 +00:00
Image_Tests Writing to Data Links (#9750) 2024-04-25 17:55:49 +00:00
micro-distribution System.exit does proper context hard exit. (#10363) 2024-07-18 18:10:36 +00:00
Snowflake_Tests Initial template for the Extra Tests workflow (#10636) 2024-07-24 07:33:51 +00:00
Table_Tests Space-precedence does not apply to value-level operators (#10597) 2024-07-24 10:55:44 +00:00
Visualization_Tests Stop publishing First/Last as constructors and use auto-scoping for take and drop. (#10467) 2024-07-08 10:26:30 +00:00