| @@ 807-846 (lines=40) @@ | ||
| 804 | return $_success; |
|
| 805 | } |
|
| 806 | ||
| 807 | protected function parseEMPTY_STRING() |
|
| 808 | { |
|
| 809 | $_position = $this->position; |
|
| 810 | ||
| 811 | if (isset($this->cache['EMPTY_STRING'][$_position])) { |
|
| 812 | $_success = $this->cache['EMPTY_STRING'][$_position]['success']; |
|
| 813 | $this->position = $this->cache['EMPTY_STRING'][$_position]['position']; |
|
| 814 | $this->value = $this->cache['EMPTY_STRING'][$_position]['value']; |
|
| 815 | ||
| 816 | return $_success; |
|
| 817 | } |
|
| 818 | ||
| 819 | if (substr($this->string, $this->position, strlen('""')) === '""') { |
|
| 820 | $_success = true; |
|
| 821 | $this->value = substr($this->string, $this->position, strlen('""')); |
|
| 822 | $this->position += strlen('""'); |
|
| 823 | } else { |
|
| 824 | $_success = false; |
|
| 825 | ||
| 826 | $this->report($this->position, '\'""\''); |
|
| 827 | } |
|
| 828 | ||
| 829 | if ($_success) { |
|
| 830 | $this->value = call_user_func(function () { |
|
| 831 | return ''; |
|
| 832 | }); |
|
| 833 | } |
|
| 834 | ||
| 835 | $this->cache['EMPTY_STRING'][$_position] = array( |
|
| 836 | 'success' => $_success, |
|
| 837 | 'position' => $this->position, |
|
| 838 | 'value' => $this->value |
|
| 839 | ); |
|
| 840 | ||
| 841 | if (!$_success) { |
|
| 842 | $this->report($_position, 'EMPTY_STRING'); |
|
| 843 | } |
|
| 844 | ||
| 845 | return $_success; |
|
| 846 | } |
|
| 847 | ||
| 848 | protected function parseQUOTED_STRING() |
|
| 849 | { |
|
| @@ 969-1008 (lines=40) @@ | ||
| 966 | return $_success; |
|
| 967 | } |
|
| 968 | ||
| 969 | protected function parseESCAPED_QUOTE() |
|
| 970 | { |
|
| 971 | $_position = $this->position; |
|
| 972 | ||
| 973 | if (isset($this->cache['ESCAPED_QUOTE'][$_position])) { |
|
| 974 | $_success = $this->cache['ESCAPED_QUOTE'][$_position]['success']; |
|
| 975 | $this->position = $this->cache['ESCAPED_QUOTE'][$_position]['position']; |
|
| 976 | $this->value = $this->cache['ESCAPED_QUOTE'][$_position]['value']; |
|
| 977 | ||
| 978 | return $_success; |
|
| 979 | } |
|
| 980 | ||
| 981 | if (substr($this->string, $this->position, strlen('\"')) === '\"') { |
|
| 982 | $_success = true; |
|
| 983 | $this->value = substr($this->string, $this->position, strlen('\"')); |
|
| 984 | $this->position += strlen('\"'); |
|
| 985 | } else { |
|
| 986 | $_success = false; |
|
| 987 | ||
| 988 | $this->report($this->position, '\'\\"\''); |
|
| 989 | } |
|
| 990 | ||
| 991 | if ($_success) { |
|
| 992 | $this->value = call_user_func(function () { |
|
| 993 | return '"'; |
|
| 994 | }); |
|
| 995 | } |
|
| 996 | ||
| 997 | $this->cache['ESCAPED_QUOTE'][$_position] = array( |
|
| 998 | 'success' => $_success, |
|
| 999 | 'position' => $this->position, |
|
| 1000 | 'value' => $this->value |
|
| 1001 | ); |
|
| 1002 | ||
| 1003 | if (!$_success) { |
|
| 1004 | $this->report($_position, 'ESCAPED_QUOTE'); |
|
| 1005 | } |
|
| 1006 | ||
| 1007 | return $_success; |
|
| 1008 | } |
|
| 1009 | ||
| 1010 | protected function parseRAW_STRING() |
|
| 1011 | { |
|