File tree 2 files changed +3
-17
lines changed
2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ an experiment and the start of a conversation.
7
7
8
8
![ image] ( https://cloud.githubusercontent.com/assets/762848/19023070/4ab01c92-889a-11e6-9bb5-ec1a6816aba2.png )
9
9
10
- This is the v1 branch, which changes data structures to support syntax added after the initial release for php 7.0 .
10
+ This is the v0.1 branch, which changes data structures to support syntax added after the initial 0.0.x release line .
11
11
12
12
## Get Started
13
13
After you've [ configured your machine] ( docs/GettingStarted.md ) , you can use the parser to generate and work
Original file line number Diff line number Diff line change @@ -32,13 +32,7 @@ public function getNodeKindName() : string {
32
32
* @throws \Exception
33
33
*/
34
34
public function getStartPosition () : int {
35
- $ child = $ this ->getChildNodesAndTokens ()->current ();
36
- if ($ child instanceof Node) {
37
- return $ child ->getStartPosition ();
38
- } elseif ($ child instanceof Token) {
39
- return $ child ->start ;
40
- }
41
- throw new \Exception ("Unknown type in AST " );
35
+ return $ this ->getChildNodesAndTokens ()->current ()->getStartPosition ();
42
36
}
43
37
44
38
/**
@@ -58,15 +52,7 @@ public function getFullStartPosition() : int {
58
52
$ child = $ child [0 ];
59
53
}
60
54
61
- if ($ child instanceof Node) {
62
- return $ child ->getFullStartPosition ();
63
- }
64
-
65
- if ($ child instanceof Token) {
66
- return $ child ->fullStart ;
67
- }
68
-
69
- throw new \Exception ("Unknown type in AST: " . \gettype ($ child ));
55
+ return $ child ->getFullStartPosition ();
70
56
}
71
57
};
72
58
You can’t perform that action at this time.
0 commit comments