Subversion Repositories ALCASAR

Rev

Rev 2976 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2976 Rev 3037
Line 157... Line 157...
157
 
157
 
158
    private function _encodeSpecialChars($script)
158
    private function _encodeSpecialChars($script)
159
    {
159
    {
160
        $parser = new ParseMaster();
160
        $parser = new ParseMaster();
161
        // replace: $name -> n, $$name -> na
161
        // replace: $name -> n, $$name -> na
-
 
162
        $parser->add(
162
        $parser->add('/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
163
            '/((\\x24+)([a-zA-Z$_]+))(\\d*)/',
163
                     array('fn' => '_replace_name')
164
            array('fn' => '_replace_name')
164
        );
165
        );
165
        // replace: _name -> _0, double-underscore (__name) is ignored
166
        // replace: _name -> _0, double-underscore (__name) is ignored
166
        $regexp = '/\\b_[A-Za-z\\d]\\w*/';
167
        $regexp = '/\\b_[A-Za-z\\d]\\w*/';
167
        // build the word list
168
        // build the word list
168
        $keywords = $this->_analyze($script, $regexp, '_encodePrivate');
169
        $keywords = $this->_analyze($script, $regexp, '_encodePrivate');
169
        // quick ref
170
        // quick ref
170
        $encoded = $keywords['encoded'];
171
        $encoded = $keywords['encoded'];
171
 
172
 
172
        $parser->add($regexp,
173
        $parser->add(
-
 
174
            $regexp,
173
            array(
175
            array(
174
                'fn' => '_replace_encoded',
176
                'fn' => '_replace_encoded',
175
                'data' => $encoded
177
                'data' => $encoded
176
            )
178
            )
177
        );
179
        );
Line 192... Line 194...
192
        // build the word list
194
        // build the word list
193
        $keywords = $this->_analyze($script, $regexp, $encode);
195
        $keywords = $this->_analyze($script, $regexp, $encode);
194
        $encoded = $keywords['encoded'];
196
        $encoded = $keywords['encoded'];
195
 
197
 
196
        // encode
198
        // encode
197
        $parser->add($regexp,
199
        $parser->add(
-
 
200
            $regexp,
198
            array(
201
            array(
199
                'fn' => '_replace_encoded',
202
                'fn' => '_replace_encoded',
200
                'data' => $encoded
203
                'data' => $encoded
201
            )
204
            )
202
        );
205
        );