Changeset 3297378
- Timestamp:
- 05/20/2025 12:24:41 PM (6 months ago)
- Location:
- loco-translate
- Files:
-
- 2 edited
- tags/2.7.3/lib/compiled/gettext.php (modified) (1 diff)
- trunk/lib/compiled/gettext.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
loco-translate/tags/2.7.3/lib/compiled/gettext.php
r3297124 r3297378 5 5 */ 6 6 interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable { 7 public function getArrayCopy() :array; }7 public function getArrayCopy(); } 8 8 class LocoHeaders extends ArrayIterator implements LocoArrayInterface { 9 9 private /*array*/ $map = []; -
loco-translate/trunk/lib/compiled/gettext.php
r3269005 r3297378 5 5 */ 6 6 interface LocoArrayInterface extends ArrayAccess, Iterator, Countable, JsonSerializable { 7 public function getArrayCopy() :array; }7 public function getArrayCopy(); } 8 8 class LocoHeaders extends ArrayIterator implements LocoArrayInterface { 9 9 private /*array*/ $map = []; … … 241 241 final public function unescapeMatch( array $r ):string { $s = $r[0]; $c = $s[1]; if( isset($this->map[$c]) ){ return $this->map[$c]; } if( 'u' === $c ){ $str = ''; $surrogates = false; foreach( explode('\\u',$s) as $i => $h ){ if( '' !== $h ){ $h = ltrim( trim($h,'{}'),'0'); $u = intval($h,16); $str.= loco_utf8_chr($u); if( ! $surrogates ){ $surrogates = $u >= 0xD800 && $u <= 0xDBFF; } } } if( $surrogates ){ $str = loco_resolve_surrogates($str); } return $str; } if( 'U' === $c ){ return loco_utf8_chr( intval(substr($s,2),16) ); } if( 'x' === $c ){ return chr( intval(substr($s,2),16) ); } if( ctype_digit($c) ){ return chr( intval(substr($s,1),8) ); } return $s; } 242 242 protected function stripSlashes( string $s ):string { return stripcslashes($s); } } 243 class LocoJsTokens extends LocoTokenizer { const T_KWORD = 1; const T_REGEX = 2;243 class LocoJsTokens extends LocoTokenizer { 244 244 private static /*LocoEscapeParser*/ $lex = null; 245 245 protected static /*array*/ $words = [ 'true' => 1, 'false' => 1, 'null' => 1, 'break' => T_BREAK, 'else' => T_ELSE, 'new' => T_NEW, 'var' => 1, 'case' => T_CASE, 'finally' => T_FINALLY, 'return' => T_RETURN, 'void' => 1, 'catch' => T_CATCH, 'for' => T_FOR, 'switch' => T_SWITCH, 'while' => T_WHILE, 'continue' => T_CONTINUE, 'function' => T_FUNCTION, 'this' => T_STRING, 'with' => 1, 'default' => T_DEFAULT, 'if' => T_IF, 'throw' => T_THROW, 'delete' => 1, 'in' => 1, 'try' => T_TRY, 'do' => T_DO, 'instanceof' => 1, 'typeof' => 1, ];
Note: See TracChangeset for help on using the changeset viewer.