File tree 3 files changed +40
-36
lines changed
3 files changed +40
-36
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## AST
4
4
5
- The AST builder class
6
-
7
- ** Parameters**
8
-
9
- - ` withPositions `
10
- - ` withSource `
11
-
12
- ** Properties**
13
-
14
- - ` withPositions ` ** [ Boolean] ( #boolean ) ** Should locate any node (by default false)
15
- - ` withSource ` ** [ Boolean] ( #boolean ) ** Should extract the node original code (by default false)
16
-
17
- ### resolvePrecedence
18
-
19
- Check and fix precence, by default using right
20
-
21
- ** Parameters**
22
-
23
- - ` result `
24
-
25
- ### prepare
26
-
27
- Prepares an AST node
28
-
29
- ** Parameters**
30
-
31
- - ` kind ` ** ([ String] ( #string ) | null)** Defines the node type
32
- (if null, the kind must be passed at the function call)
33
- - ` parser ` ** Parser** The parser instance (use for extracting locations)
34
-
35
- Returns ** [ Function] ( #function ) **
36
-
37
- ## AST
38
-
39
5
## Class hierarchy
40
6
41
7
- [ Location] ( #location )
@@ -151,6 +117,40 @@ Prepares an AST node
151
117
152
118
Returns ** [ Function] ( #function ) **
153
119
120
+ ## AST
121
+
122
+ The AST builder class
123
+
124
+ ** Parameters**
125
+
126
+ - ` withPositions `
127
+ - ` withSource `
128
+
129
+ ** Properties**
130
+
131
+ - ` withPositions ` ** [ Boolean] ( #boolean ) ** Should locate any node (by default false)
132
+ - ` withSource ` ** [ Boolean] ( #boolean ) ** Should extract the node original code (by default false)
133
+
134
+ ### resolvePrecedence
135
+
136
+ Check and fix precence, by default using right
137
+
138
+ ** Parameters**
139
+
140
+ - ` result `
141
+
142
+ ### prepare
143
+
144
+ Prepares an AST node
145
+
146
+ ** Parameters**
147
+
148
+ - ` kind ` ** ([ String] ( #string ) | null)** Defines the node type
149
+ (if null, the kind must be passed at the function call)
150
+ - ` parser ` ** Parser** The parser instance (use for extracting locations)
151
+
152
+ Returns ** [ Function] ( #function ) **
153
+
154
154
## Array
155
155
156
156
** Extends Expression**
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ var parser = require('php-parser');
11
11
var instance = new parser ({
12
12
parser: {
13
13
extractDoc: true ,
14
- suppressErrors: true
14
+ suppressErrors: true ,
15
+ php7: true
15
16
},
16
17
ast: {
17
18
withPositions: true
Original file line number Diff line number Diff line change @@ -238,6 +238,9 @@ Reading trait alias
238
238
trait_use_alias ::= namespace_name ( T_DOUBLE_COLON T_STRING )? (T_INSTEADOF namespace_name) | (T_AS member_flags? T_STRING)
239
239
```
240
240
241
+ name list : < https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L303 >
242
+ trait adaptation : < https://github.com/php/php-src/blob/master/Zend/zend_language_parser.y#L742 >
243
+
241
244
## read_variable_declaration
242
245
243
246
Reads a variable declaration
@@ -251,7 +254,7 @@ Reads a variable declaration
251
254
Reads a constant declaration
252
255
253
256
``` ebnf
254
- constant_declaration ::= T_STRING '=' expr
257
+ constant_declaration ::= ( T_STRING | IDENTIFIER) '=' expr
255
258
```
256
259
257
260
Returns ** Constant** [ :link : ] ( AST.md#constant )
You can’t perform that action at this time.
0 commit comments