File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -12,13 +12,25 @@ var KIND = 'variable';
12
12
* be any expression in general, an expression can also be a pattern.
13
13
* @constructor Variable
14
14
* @extends {Expression }
15
- * @property {String|Node } name
16
- * @property {boolean } byref
15
+ * @example
16
+ * // PHP code :
17
+ * &$foo
18
+ * // AST output
19
+ * {
20
+ * "kind": "variable",
21
+ * "name": "foo",
22
+ * "byref": true,
23
+ * "curly": false
24
+ * }
25
+ * @property {String|Node } name The variable name (can be a complex expression when the name is resolved dynamically)
26
+ * @property {boolean } byref Indicate if the variable reference is used, ex `&$foo`
27
+ * @property {boolean } curly Indicate if the name is defined between curlies, ex `${foo}`
17
28
*/
18
- var Variable = Expr . extends ( function Variable ( name , byref , location ) {
29
+ var Variable = Expr . extends ( function Variable ( name , byref , curly , location ) {
19
30
Expr . apply ( this , [ KIND , location ] ) ;
20
31
this . name = name ;
21
32
this . byref = byref || false ;
33
+ this . curly = curly || false ;
22
34
} ) ;
23
35
24
36
module . exports = Variable ;
You can’t perform that action at this time.
0 commit comments