com php-src: update the html table generator: ext/standard/html _tables/html_table_gen.php

From: Date: Sat, 13 Sep 2014 22:42:48 +0000
Subject: com php-src: update the html table generator: ext/standard/html _tables/html_table_gen.php
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-81576@lists.php.net to get a copy of this message
Commit: da10603ec93f44355dd0f51ff065c4d30a527dd9 Author: Anatol Belski <ab@php.net> Sun, 14 Sep 2014 00:42:48 +0200 Parents: 26cf7df1337e755f8ec709c316f97ab2c23ce8e8 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=da10603ec93f44355dd0f51ff065c4d30a527dd9 Log: update the html table generator Changed paths: M ext/standard/html_tables/html_table_gen.php Diff: diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php index 2aae244..a14cf50 100644 --- a/ext/standard/html_tables/html_table_gen.php +++ b/ext/standard/html_tables/html_table_gen.php @@ -371,18 +371,17 @@ $t = <<<'CODE' #define ENT_STAGE3_INDEX(k) ((k) & 0x3F) #define ENT_CODE_POINT_FROM_STAGES(i,j,k) (((i) << 12) | ((j) << 6) | (k)) -/* Table should be organized with a leading row telling the size of - * the table and the default entity (maybe NULL) and the rest being - * normal rows ordered by code point so that we can do a binary search */ +/* The default entity may be NULL. Binary search is still possible while + is senseless as there are just two rows (see also find_entity_for_char()). */ typedef union { struct { - unsigned size; /* number of remaining entries in the table */ const char *default_entity; + unsigned size; /* number of remaining entries in the table */ unsigned short default_entity_len; } leading_entry; struct { - unsigned second_cp; /* second code point */ const char *entity; + unsigned second_cp; /* second code point */ unsigned short entity_len; } normal_entry; } entity_multicodepoint_row; @@ -475,16 +474,16 @@ foreach ($multicp_rows as $k => $v) { if (key_exists("default", $v)) { if ($v['default'] == 'GT') /* hack to make > translate to &gt; not GT; */ $v['default'] = "gt"; - echo "\t{ {", sprintf("%02d", count($v) - 1), - ",\t\t", sprintf("\"%-21s", $v["default"].'",'), "\t", + echo "\t{ {", sprintf("\"%-21s", $v["default"].'",'), + "\t", sprintf("%02d", (count($v) - 1)), ",\t\t", sprintf("% 2d", strlen($v["default"])), '} },', "\n"; } else { - echo "\t{ {", sprintf("%02d", count($v)), - ",\t\t", sprintf("%-22s", 'NULL'), ",\t0} },\n"; + echo "\t{ {", sprintf("%-22s", 'NULL,'), + "\t", sprintf("%02d", count($v)), ",\t\t0} },\n"; } unset($v["default"]); foreach ($v as $l => $w) { - echo "\t{ {", sprintf("0x%05s", $l), ",\t", sprintf("\"%-21s", $w.'",'), "\t", + echo "\t{ {", sprintf("\"%-21s", $w.'",'), "\t", sprintf("0x%05s", $l), ",\t", sprintf("% 2d", strlen($w)), '} },', "\n"; } echo "};\n";

« previous php.cvs (#81576) next »