| @@ 794-833 (lines=40) @@ | ||
| 791 | return $_success; |
|
| 792 | } |
|
| 793 | ||
| 794 | protected function parseEMPTY_STRING() |
|
| 795 | { |
|
| 796 | $_position = $this->position; |
|
| 797 | ||
| 798 | if (isset($this->cache['EMPTY_STRING'][$_position])) { |
|
| 799 | $_success = $this->cache['EMPTY_STRING'][$_position]['success']; |
|
| 800 | $this->position = $this->cache['EMPTY_STRING'][$_position]['position']; |
|
| 801 | $this->value = $this->cache['EMPTY_STRING'][$_position]['value']; |
|
| 802 | ||
| 803 | return $_success; |
|
| 804 | } |
|
| 805 | ||
| 806 | if (substr($this->string, $this->position, strlen('""')) === '""') { |
|
| 807 | $_success = true; |
|
| 808 | $this->value = substr($this->string, $this->position, strlen('""')); |
|
| 809 | $this->position += strlen('""'); |
|
| 810 | } else { |
|
| 811 | $_success = false; |
|
| 812 | ||
| 813 | $this->report($this->position, '\'""\''); |
|
| 814 | } |
|
| 815 | ||
| 816 | if ($_success) { |
|
| 817 | $this->value = call_user_func(function () { |
|
| 818 | return ''; |
|
| 819 | }); |
|
| 820 | } |
|
| 821 | ||
| 822 | $this->cache['EMPTY_STRING'][$_position] = array( |
|
| 823 | 'success' => $_success, |
|
| 824 | 'position' => $this->position, |
|
| 825 | 'value' => $this->value |
|
| 826 | ); |
|
| 827 | ||
| 828 | if (!$_success) { |
|
| 829 | $this->report($_position, 'EMPTY_STRING'); |
|
| 830 | } |
|
| 831 | ||
| 832 | return $_success; |
|
| 833 | } |
|
| 834 | ||
| 835 | protected function parseQUOTED_STRING() |
|
| 836 | { |
|
| @@ 956-995 (lines=40) @@ | ||
| 953 | return $_success; |
|
| 954 | } |
|
| 955 | ||
| 956 | protected function parseESCAPED_QUOTE() |
|
| 957 | { |
|
| 958 | $_position = $this->position; |
|
| 959 | ||
| 960 | if (isset($this->cache['ESCAPED_QUOTE'][$_position])) { |
|
| 961 | $_success = $this->cache['ESCAPED_QUOTE'][$_position]['success']; |
|
| 962 | $this->position = $this->cache['ESCAPED_QUOTE'][$_position]['position']; |
|
| 963 | $this->value = $this->cache['ESCAPED_QUOTE'][$_position]['value']; |
|
| 964 | ||
| 965 | return $_success; |
|
| 966 | } |
|
| 967 | ||
| 968 | if (substr($this->string, $this->position, strlen('\"')) === '\"') { |
|
| 969 | $_success = true; |
|
| 970 | $this->value = substr($this->string, $this->position, strlen('\"')); |
|
| 971 | $this->position += strlen('\"'); |
|
| 972 | } else { |
|
| 973 | $_success = false; |
|
| 974 | ||
| 975 | $this->report($this->position, '\'\\"\''); |
|
| 976 | } |
|
| 977 | ||
| 978 | if ($_success) { |
|
| 979 | $this->value = call_user_func(function () { |
|
| 980 | return '"'; |
|
| 981 | }); |
|
| 982 | } |
|
| 983 | ||
| 984 | $this->cache['ESCAPED_QUOTE'][$_position] = array( |
|
| 985 | 'success' => $_success, |
|
| 986 | 'position' => $this->position, |
|
| 987 | 'value' => $this->value |
|
| 988 | ); |
|
| 989 | ||
| 990 | if (!$_success) { |
|
| 991 | $this->report($_position, 'ESCAPED_QUOTE'); |
|
| 992 | } |
|
| 993 | ||
| 994 | return $_success; |
|
| 995 | } |
|
| 996 | ||
| 997 | protected function parseRAW_STRING() |
|
| 998 | { |
|