com php-langspec: Mark instanceof as left-associative: spec/10-expressions.md spec/19-grammar.md
| From: | Nikita Popov | Date: | Fri, 15 Mar 2019 08:54:22 +0000 |
| Subject: | com php-langspec: Mark instanceof as left-associative: spec/10-expressions.md spec/19-grammar.md | ||
| Groups: | php.standards.cvs | ||
| Request: | Send a blank email to standards--cvs+get-426@lists.php.net to get a copy of this message | ||
Commit: 15aa45273f4e5533ed252a612a5e6e7349a4d3ec
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 15 Mar 2019 09:54:22 +0100
Parents: 63d72a6df5d2c7b1b7a8aedde1410c780cfd92af
Branches: master
Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=15aa45273f4e5533ed252a612a5e6e7349a4d3ec
Log:
Mark instanceof as left-associative
May not have been originally intended this way, but it's how the
language works right now, so specify it as such (#226).
Bugs:
https://bugs.php.net/226
Changed paths:
M spec/10-expressions.md
M spec/19-grammar.md
Diff:
diff --git a/spec/10-expressions.md b/spec/10-expressions.md
index 988acaf..8c8af69 100644
--- a/spec/10-expressions.md
+++ b/spec/10-expressions.md
@@ -1935,7 +1935,7 @@ instanceof-expression:
instanceof-subject 'instanceof' class-type-designator
instanceof-subject:
- unary-expression
+ instanceof-expression
-->
<pre>
@@ -1944,17 +1944,13 @@ instanceof-subject:
<i><a
href="#grammar-instanceof-subject">instanceof-subject</a></i> instanceof
<i><a
href="#grammar-class-type-designator">class-type-designator</a></i>
<i id="grammar-instanceof-subject">instanceof-subject:</i>
- <i><a
href="#grammar-unary-expression">unary-expression</a></i>
+ <i><a
href="#grammar-instanceof-expression">instanceof-expression</a></i>
</pre>
-**Constraints**
-
-The *unary-expression* in *instanceof-subject* must not be any form of literal.
-
**Semantics**
Operator
instanceof returns TRUE if the value designated by
-*unary-expression* in *instanceof-subject* is an object having the type specified
+*instanceof-subject* is an object having the type specified
by *class-type-designator*, is an object whose type is derived from that type,
or is an object whose type implements the interface specified by *class-type-designator*.
Otherwise, it returns FALSE.
diff --git a/spec/19-grammar.md b/spec/19-grammar.md
index 6b66633..0cc4f68 100644
--- a/spec/19-grammar.md
+++ b/spec/19-grammar.md
@@ -563,7 +563,7 @@ The grammar notation is described in [Grammars section](09-lexical-structure.md#
<i><a
href="#grammar-instanceof-subject">instanceof-subject</a></i> instanceof
<i><a
href="#grammar-class-type-designator">class-type-designator</a></i>
<i id="grammar-instanceof-subject">instanceof-subject:</i>
- <i><a
href="#grammar-unary-expression">unary-expression</a></i>
+ <i><a
href="#grammar-instanceof-expression">instanceof-expression</a></i>
<i id="grammar-logical-NOT-expression">logical-NOT-expression:</i>
<i><a
href="#grammar-instanceof-expression">instanceof-expression</a></i>