Add operators to the doc comment specification (#4349) This PR adds operators to the referenceable members in section 4.2, with the accepted forms. See dart-lang/sdk#60948.
diff --git a/doc/dart_documentation_comment_specification.md b/doc/dart_documentation_comment_specification.md index 997600d..564ca15 100644 --- a/doc/dart_documentation_comment_specification.md +++ b/doc/dart_documentation_comment_specification.md
@@ -1,5 +1,5 @@ # **Dart Documentation Comments Specification** -Version: 1.1.0 +Version: 1.2.0 [TOC] @@ -189,6 +189,11 @@ ### **4.2. Members:** * Methods (instance and static) (e.g., `[myMethod]`, `[MyClass.myMethod]`) +* Operators (e.g., `[operator ==]`, `[MyClass.==]`, `[MyClass.operator []]`). An operator is referenced by its name, which is its symbol: `==`, `<`, `>`, `<=`, `>=`, `+`, `-`, `*`, `/`, `~/`, `%`, `|`, `^`, `&`, `<<`, `>>`, `>>>`, `~`, `[]` or `[]=`. + * An operator name can stand wherever a member name can: unqualified (`[==]`, `[[]]`) or qualified (`[MyClass.==]`, `[prefix.MyClass.[]]`). + * The keyword `operator` can be written in front of the name, as in the declaration. It does not change what the reference resolves to. Whitespace between `operator` and the name is optional (`[operator[]=]`). + * The name of the unary minus operator is `unary-`, as in the Dart language specification (`[MyClass.unary-]`). The name `-` always refers to the binary operator. + * Only operators that can be declared can be referenced. `!=`, for example, is not a member; reference `==` instead. * Fields (instance and static) (e.g., `[myField]`, `[MyClass.myField]`) * Getters and Setters (See [Section 6.2.2](#622-getters-and-setters) for full details) * Constructors (e.g., `[MyClass.new]`, `[MyClass.named]`)