@@ 40-49 (lines=10) @@ | ||
37 | return $token; |
|
38 | } |
|
39 | ||
40 | private function accept($tokenType) |
|
41 | { |
|
42 | $token = $this->scanner->peek(); |
|
43 | ||
44 | if ($token->type !== $tokenType) { |
|
45 | return false; |
|
46 | } |
|
47 | ||
48 | return $this->scanner->next(); |
|
49 | } |
|
50 | ||
51 | private function is($tokenType) |
|
52 | { |
|
@@ 51-60 (lines=10) @@ | ||
48 | return $this->scanner->next(); |
|
49 | } |
|
50 | ||
51 | private function is($tokenType) |
|
52 | { |
|
53 | if ($this->scanner->eof()) { |
|
54 | return false; |
|
55 | } |
|
56 | ||
57 | $token = $this->scanner->peek(); |
|
58 | ||
59 | return $token->type === $tokenType; |
|
60 | } |
|
61 | ||
62 | private function parseObject() |
|
63 | { |