Skip to content

Commit 4562ece

Browse files
Documentation of ambiguous syntax, operator suffix (#28525)
* 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 <kristoffer.carlsson@chalmers.se>
1 parent 755df8e commit 4562ece

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/src/manual/variables.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ will reassign it. Most of the Unicode infix operators (in category Sm), such as
106106
as infix operators and are available for user-defined methods (e.g. you can use `const ⊗ = kron`
107107
to define `` as an infix Kronecker product). Operators can also be suffixed with modifying marks,
108108
primes, and sub/superscripts, e.g. `+̂ₐ″` is parsed as an infix operator with the same precedence as `+`.
109+
A space is required between an operator that ends with a subscript/superscript letter and a subsequent
110+
variable name. For example, if `+ᵃ` is an operator, then `+ᵃx` must be written as `+ᵃ x` to distinguish
111+
it from `+ ᵃx` where `ᵃx` is the variable name.
109112

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

0 commit comments

Comments
 (0)