cvs: php4(PHP_4_3) /ext/ircg ircg_scanner.re
| From: | Sascha Schumann | Date: | Wed, 04 Jun 2003 07:01:27 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/ircg ircg_scanner.re | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-21515@lists.php.net to get a copy of this message | ||
sas Wed Jun 4 03:01:27 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/ircg ircg_scanner.re
Log:
fix and simplify
Index: php4/ext/ircg/ircg_scanner.re
diff -u php4/ext/ircg/ircg_scanner.re:1.18.8.2 php4/ext/ircg/ircg_scanner.re:1.18.8.3
--- php4/ext/ircg/ircg_scanner.re:1.18.8.2 Tue Jun 3 10:16:23 2003
+++ php4/ext/ircg/ircg_scanner.re Wed Jun 4 03:01:27 2003
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ircg_scanner.re,v 1.18.8.2 2003/06/03 14:16:23 sas Exp $ */
+/* $Id: ircg_scanner.re,v 1.18.8.3 2003/06/04 07:01:27 sas Exp $ */
#include <ext/standard/php_smart_str.h>
#include <stdio.h>
@@ -83,12 +83,9 @@
#define STD_PARA ircg_msg_scanner *ctx, const char *start, const char *YYCURSOR
#define STD_ARGS ctx, start, YYCURSOR
-#define passthru(na,nb,nc) do { \
- size_t __len = xp - start; \
- if (__len == 1) \
- smart_str_appendc_ex(mctx.result, start, 1); \
- else \
- smart_str_appendl_ex(mctx.result, start, __len, 1); \
+#define passthru() do { \
+ size_t __len = xp - start; \
+ smart_str_appendl_ex(mctx.result, start, __len, 1); \
} while (0)
static inline void handle_scheme(STD_PARA)
@@ -235,7 +232,7 @@
if (xp >= end) goto stop;
start = YYCURSOR;
/*!re2c
- scheme "://" { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else {
passthru(STD_ARGS); goto state_plain; } }
+ scheme "://" { if (auto_links) { handle_scheme(STD_ARGS); goto state_url; } else {
passthru(); goto state_plain; } }
coloresc { mctx.fg_code = mctx.bg_code = -1; goto state_color_fg; }
colorhex { mctx.fg_color[0] = mctx.bg_color[0] = 0; goto state_color_hex; }
"<" { add_entity(STD_ARGS, "<"); goto state_plain; }
@@ -246,15 +243,15 @@
bold { handle_bold(STD_ARGS, 0); goto state_plain; }
underline { handle_underline(STD_ARGS, 0); goto state_plain; }
italic { handle_italic(STD_ARGS, 0); goto state_plain; }
- anynoneof { passthru(STD_ARGS); goto state_plain; }
+ anynoneof { passthru(); goto state_plain; }
*/
-statc_color_hex:
+state_color_hex:
start = YYCURSOR;
/*!re2c
hex hex hex hex hex hex { handle_hex(STD_ARGS, 0); goto state_color_hex_bg; }
"," { goto state_color_hex_bg; }
- any { finish_color_stuff(STD_ARGS); passthru(STD_ARGS); goto state_plain; }
+ any { finish_color_stuff(STD_ARGS); passthru(); goto state_plain; }
*/
@@ -270,14 +267,14 @@
start = YYCURSOR;
/*!re2c
hex hex hex hex hex hex { handle_hex(STD_ARGS, 1); commit_color_hex(STD_ARGS); goto state_plain;
}
- any { commit_color_hex(STD_ARGS); passthru(STD_ARGS); goto state_plain; }
+ any { commit_color_hex(STD_ARGS); passthru(); goto state_plain; }
*/
state_url:
start = YYCURSOR;
/*!re2c
[-a-zA-Z0-9~_?=.@&+/#:;!*'()%,$]+ { handle_url(STD_ARGS); goto state_plain; }
- any { passthru(STD_ARGS); goto state_plain; }
+ any { passthru(); goto state_plain; }
*/
@@ -286,7 +283,7 @@
/*!re2c
digit digit? { handle_color_digit(STD_ARGS, 0); goto state_color_comma; }
"," { goto state_color_bg; }
- any { finish_color_stuff(STD_ARGS); passthru(STD_ARGS); goto state_plain; }
+ any { finish_color_stuff(STD_ARGS); passthru(); goto state_plain; }
*/
@@ -302,7 +299,7 @@
start = YYCURSOR;
/*!re2c
digit digit? { handle_color_digit(STD_ARGS, 1); commit_color_stuff(STD_ARGS); goto state_plain;
}
- any { commit_color_stuff(STD_ARGS); passthru(STD_ARGS); goto state_plain; }
+ any { commit_color_stuff(STD_ARGS); passthru(); goto state_plain; }
*/
stop: