diff options
| author | fgendreau <[email protected]> | 2014-02-08 21:43:39 -0500 |
|---|---|---|
| committer | fgendreau <[email protected]> | 2014-02-08 21:43:39 -0500 |
| commit | 074b5589ad6d4c56355db9209f0c6e29d2b4e1ef (patch) | |
| tree | a09e659621d54356aa206d730323729cbfa43198 /CCPP.class.php | |
| parent | 7bf4d64c7fee4f59bd00dcee97bdb47d9af21dcc (diff) | |
Update CCPP.class.php
Problem with inlined comments '//' which don't get suppressed. (line 381)
Added support for T_DOC_COMMENT since they were not suppressed either. (line 380)
Removed a single new-line character at the end of T_OPEN_TAG. (line 324)
Diffstat (limited to 'CCPP.class.php')
| -rw-r--r-- | CCPP.class.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/CCPP.class.php b/CCPP.class.php index 1532449..d57533b 100644 --- a/CCPP.class.php +++ b/CCPP.class.php @@ -321,7 +321,7 @@ class CCPP if (is_string($value)) //Operator $code .= $value; elseif ($value[0] == T_OPEN_TAG) // <?php tag - $code .= $sPOT.'echo \'<?php\';'.$sPCT."\n\n"; + $code .= $sPOT.'echo \'<?php\';'.$sPCT."\n"; elseif ($value[0] == T_WHITESPACE && $this->options['translate.compactWhitespaces']) //Replaces whitespaces with single space character $code .= ' '; elseif ($value[0] == T_STRING) { @@ -377,6 +377,8 @@ class CCPP $code .= $sPOT.'$this->_processor_warning('.$this->_protector_singleQuoted($op).', '.$value[2].');'.$sPCT."\n"; } // END Directives + elseif ($value[0] == T_DOC_COMMENT); //skip /** */ PHPDoc comments. + elseif ($value[1][0] == '/' && $value[1][1] == '/'); // skip inlined '//' comments (not recognized as T_COMMENT as of zend 2.4) else $code .= strtr($value[1], $protectPOT); //Unrecognized token is appended as is } return $code; // Return compiled code @@ -551,4 +553,4 @@ class CCPP { return '\''.$this->_protector_escapeSingleQuote($string).'\''; } -}
\ No newline at end of file +} |
