com php-langspec: Restrict LHS of assignments to variable: spec/10-expressions.md spec/19-grammar.md
| From: | Nikita Popov | Date: | Tue, 15 Nov 2016 21:29:10 +0000 |
| Subject: | com php-langspec: Restrict LHS of assignments to variable: spec/10-expressions.md spec/19-grammar.md | ||
| Groups: | php.standards.cvs | ||
| Request: | Send a blank email to standards--cvs+get-363@lists.php.net to get a copy of this message | ||
Commit: 9c1e9d1aa1de4f1f82498ab210095d3a76e2521d
Author: Nikita Popov <nikic@php.net> Tue, 15 Nov 2016 22:29:10 +0100
Parents: 4bc7c825be72d52b3b4ecace46828d16c69ce7b1
Branches: master
Link: http://git.php.net/?p=php-langspec.git;a=commitdiff;h=9c1e9d1aa1de4f1f82498ab210095d3a76e2521d
Log:
Restrict LHS of assignments to variable
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 bd022a4..55891de 100644
--- a/spec/10-expressions.md
+++ b/spec/10-expressions.md
@@ -2882,12 +2882,14 @@ These operators associate right-to-left.
<pre>
<i>simple-assignment-expression:</i>
- <i>unary-expression</i> = <i>assignment-expression</i>
+ <i>variable</i> = <i>assignment-expression</i>
+ <i>list-intrinsic</i> = <i>assignment-expression</i>
</pre>
**Defined elsewhere**
-* [*unary-expression*](#general-4)
+* [*variable*](#variables)
+* [*list-intrinsic*](#list)
* [*assignment-expression*](#general-5)
**Constraints**
@@ -2950,18 +2952,16 @@ $a = new C; // make $a point to the allocated object
<pre>
<i>byref-assignment-expression:</i>
- <i>unary-expression</i> = & <i>assignment-expression</i>
+ <i>variable</i> = & <i>assignment-expression</i>
</pre>
**Defined elsewhere**
-* [*unary-expression*](#general-4)
+* [*variable*](#variables)
* [*assignment-expression*](#general-5)
**Constraints**
-*unary-expression* must designate a variable.
-
*assignment-expression* must be an lvalue or a call to a function that
returns a value byRef.
@@ -2994,7 +2994,7 @@ $b =& g2(); // make $b an alias to "xxx"
<pre>
<i>compound-assignment-expression:</i>
- <i>unary-expression compound-assignment-operator assignment-expression</i>
+ <i>variable compound-assignment-operator assignment-expression</i>
<i>compound-assignment-operator: one of</i>
**= *= /= %= += -= .= <<= >>= &= ^= |=
@@ -3002,7 +3002,7 @@ $b =& g2(); // make $b an alias to "xxx"
**Defined elsewhere**
-* [*unary-expression*](#general-4)
+* [*variable*](#variables)
* [*assignment-expression*](#general-5)
**Constraints**
diff --git a/spec/19-grammar.md b/spec/19-grammar.md
index 493f364..beb6cf5 100644
--- a/spec/19-grammar.md
+++ b/spec/19-grammar.md
@@ -673,13 +673,14 @@ The grammar notation is described in [Grammars
section](09-lexical-structure.md#
<i>compound-assignment-expression</i>
<i>simple-assignment-expression:</i>
- <i>unary-expression</i> = <i>assignment-expression</i>
+ <i>variable</i> = <i>assignment-expression</i>
+ <i>list-intrinsic</i> = <i>assignment-expression</i>
<i>byref-assignment-expression:</i>
- <i>unary-expression</i> = & <i>assignment-expression</i>
+ <i>variable</i> = & <i>assignment-expression</i>
<i>compound-assignment-expression:</i>
- <i>unary-expression compound-assignment-operator assignment-expression</i>
+ <i>variable compound-assignment-operator assignment-expression</i>
<i>compound-assignment-operator: one of</i>
**= *= /= %= += -= .= <<= >>= &= ^= |=