| @@ 108-130 (lines=23) @@ | ||
| 105 | $this->emit(Token::T_SPREAD, $points, $location); |
|
| 106 | } |
|
| 107 | ||
| 108 | private function str() |
|
| 109 | { |
|
| 110 | $this->scanner->next(); |
|
| 111 | $location = $this->getLocation(); |
|
| 112 | $string = ''; |
|
| 113 | $previousChar = false; |
|
| 114 | ||
| 115 | while (true) { |
|
| 116 | if ($this->scanner->eof()) { |
|
| 117 | throw $this->getError('Unclosed quote'); |
|
| 118 | } |
|
| 119 | $next = $this->scanner->peek(); |
|
| 120 | if ($previousChar !== '\\' && $next === '"') { |
|
| 121 | $this->scanner->next(); |
|
| 122 | break; |
|
| 123 | } |
|
| 124 | $previousChar = $this->scanner->next(); |
|
| 125 | $string .= $previousChar; |
|
| 126 | } |
|
| 127 | ||
| 128 | $string = json_decode('"' . $string . '"'); |
|
| 129 | $this->emit(Token::T_STRING, $string, $location); |
|
| 130 | } |
|
| 131 | ||
| 132 | private function integerPart() |
|
| 133 | { |
|
| @@ 79-101 (lines=23) @@ | ||
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | private function str() |
|
| 80 | { |
|
| 81 | $this->scanner->next(); |
|
| 82 | $location = $this->getLocation(); |
|
| 83 | $string = ''; |
|
| 84 | $previousChar = false; |
|
| 85 | ||
| 86 | while (true) { |
|
| 87 | if ($this->scanner->eof()) { |
|
| 88 | throw $this->getError('Unclosed quote'); |
|
| 89 | } |
|
| 90 | $next = $this->scanner->peek(); |
|
| 91 | if ($previousChar !== '\\' && $next === '"') { |
|
| 92 | $this->scanner->next(); |
|
| 93 | break; |
|
| 94 | } |
|
| 95 | $previousChar = $this->scanner->next(); |
|
| 96 | $string .= $previousChar; |
|
| 97 | } |
|
| 98 | ||
| 99 | $string = json_decode('"' . $string . '"'); |
|
| 100 | $this->emit(Token::T_STRING, $string, $location); |
|
| 101 | } |
|
| 102 | ||
| 103 | private function integerPart() |
|
| 104 | { |
|