Skip to content

Commit

Permalink
Documentation of ambiguous syntax, operator suffix (#28525)
Browse files Browse the repository at this point in the history
* Documentation of amiguous syntax, operator suffix

This updates the documentation in line with the proposal in #28441 to disallow `+ᵃx`

Ideally, the parser should be updated together with the documentation, but I'm not familiar enough with the parser internals to do that myself.

This is a breaking change, since `+ᵃx` is currently legal syntax. (The way I interpret semantic versioning, the breaking change occurs when the documentation is updated. If the parser is later updated to work in accordance with the documentation, then that would technically be a bugfix, and wouldn't have to wait until the next major release. In practice though, people will be upset if code that was working in 1.0 suddenly stops working in 1.x.)

* fix whitespace

Co-authored-by: Kristoffer Carlsson <[email protected]>
  • Loading branch information
perrutquist and KristofferC authored May 11, 2020
1 parent 755df8e commit 4562ece
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/src/manual/variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ will reassign it. Most of the Unicode infix operators (in category Sm), such as
as infix operators and are available for user-defined methods (e.g. you can use `const ⊗ = kron`
to define `` as an infix Kronecker product). Operators can also be suffixed with modifying marks,
primes, and sub/superscripts, e.g. `+̂ₐ″` is parsed as an infix operator with the same precedence as `+`.
A space is required between an operator that ends with a subscript/superscript letter and a subsequent
variable name. For example, if `+ᵃ` is an operator, then `+ᵃx` must be written as `+ᵃ x` to distinguish
it from `+ ᵃx` where `ᵃx` is the variable name.

The only explicitly disallowed names for variables are the names of the built-in [Keywords](@ref):

Expand Down

3 comments on commit 4562ece

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily package evaluation, I will reply here when finished:

@nanosoldier runtests(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executing the daily benchmark build, I will reply here when finished:

@nanosoldier runbenchmarks(ALL, isdaily = true)

@nanosoldier
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @ararslan

Please sign in to comment.