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