// /usr/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1 -quiet -I. -I. -DRUBY_EXPORT regex.c -quiet -dumpbase regex.c -march=athlon-xp -mtune=athlon-xp -momit-leaf-frame-pointer -auxbase regex -O3 -fweb -frename-registers -ftracer -ftree-vectorize -fPIC -o - -frandom-seed=0 # 1 "regex.c" # 1 "" # 1 "" # 1 "regex.c" # 24 "regex.c" # 1 "config.h" 1 # 25 "regex.c" 2 # 1 "/usr/include/string.h" 1 3 4 # 26 "/usr/include/string.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 323 "/usr/include/features.h" 3 4 # 1 "/usr/include/sys/cdefs.h" 1 3 4 # 313 "/usr/include/sys/cdefs.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 314 "/usr/include/sys/cdefs.h" 2 3 4 # 324 "/usr/include/features.h" 2 3 4 # 346 "/usr/include/features.h" 3 4 # 1 "/usr/include/gnu/stubs.h" 1 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 5 "/usr/include/gnu/stubs.h" 2 3 4 # 1 "/usr/include/gnu/stubs-32.h" 1 3 4 # 8 "/usr/include/gnu/stubs.h" 2 3 4 # 347 "/usr/include/features.h" 2 3 4 # 27 "/usr/include/string.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 214 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4 typedef unsigned int size_t; # 34 "/usr/include/string.h" 2 3 4 extern void *memcpy (void *__restrict __dest, __const void *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, __const void *__src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, __const void *__restrict __src, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int memcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void *memchr (__const void *__s, int __c, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 82 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, __const char *__restrict __src) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, __const char *__restrict __src, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 130 "/usr/include/string.h" 3 4 extern char *strdup (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 165 "/usr/include/string.h" 3 4 extern char *strchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strrchr (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 181 "/usr/include/string.h" 3 4 extern size_t strcspn (__const char *__s, __const char *__reject) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strpbrk (__const char *__s, __const char *__accept) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strstr (__const char *__haystack, __const char *__needle) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strtok (char *__restrict __s, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, __const char *__restrict __delim, char **__restrict __save_ptr) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2, 3))); # 240 "/usr/include/string.h" 3 4 extern size_t strlen (__const char *__s) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 254 "/usr/include/string.h" 3 4 extern char *strerror (int __errnum) __attribute__ ((__nothrow__)); # 270 "/usr/include/string.h" 3 4 extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (2))); # 288 "/usr/include/string.h" 3 4 extern void __bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern void bcopy (__const void *__src, void *__dest, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); extern int bcmp (__const void *__s1, __const void *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *index (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *rindex (__const char *__s, int __c) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern int ffs (int __i) __attribute__ ((__nothrow__)) __attribute__ ((__const__)); # 325 "/usr/include/string.h" 3 4 extern int strcasecmp (__const char *__s1, __const char *__s2) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (__const char *__s1, __const char *__s2, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 348 "/usr/include/string.h" 3 4 extern char *strsep (char **__restrict __stringp, __const char *__restrict __delim) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); # 414 "/usr/include/string.h" 3 4 # 1 "/usr/include/bits/string.h" 1 3 4 # 415 "/usr/include/string.h" 2 3 4 # 1 "/usr/include/bits/string2.h" 1 3 4 # 52 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 37 "/usr/include/endian.h" 3 4 # 1 "/usr/include/bits/endian.h" 1 3 4 # 38 "/usr/include/endian.h" 2 3 4 # 53 "/usr/include/bits/string2.h" 2 3 4 # 1 "/usr/include/bits/types.h" 1 3 4 # 28 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/wordsize.h" 1 3 4 # 29 "/usr/include/bits/types.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 32 "/usr/include/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; __extension__ typedef signed long long int __int64_t; __extension__ typedef unsigned long long int __uint64_t; __extension__ typedef long long int __quad_t; __extension__ typedef unsigned long long int __u_quad_t; # 134 "/usr/include/bits/types.h" 3 4 # 1 "/usr/include/bits/typesizes.h" 1 3 4 # 135 "/usr/include/bits/types.h" 2 3 4 __extension__ typedef __u_quad_t __dev_t; __extension__ typedef unsigned int __uid_t; __extension__ typedef unsigned int __gid_t; __extension__ typedef unsigned long int __ino_t; __extension__ typedef __u_quad_t __ino64_t; __extension__ typedef unsigned int __mode_t; __extension__ typedef unsigned int __nlink_t; __extension__ typedef long int __off_t; __extension__ typedef __quad_t __off64_t; __extension__ typedef int __pid_t; __extension__ typedef struct { int __val[2]; } __fsid_t; __extension__ typedef long int __clock_t; __extension__ typedef unsigned long int __rlim_t; __extension__ typedef __u_quad_t __rlim64_t; __extension__ typedef unsigned int __id_t; __extension__ typedef long int __time_t; __extension__ typedef unsigned int __useconds_t; __extension__ typedef long int __suseconds_t; __extension__ typedef int __daddr_t; __extension__ typedef long int __swblk_t; __extension__ typedef int __key_t; __extension__ typedef int __clockid_t; __extension__ typedef void * __timer_t; __extension__ typedef long int __blksize_t; __extension__ typedef long int __blkcnt_t; __extension__ typedef __quad_t __blkcnt64_t; __extension__ typedef unsigned long int __fsblkcnt_t; __extension__ typedef __u_quad_t __fsblkcnt64_t; __extension__ typedef unsigned long int __fsfilcnt_t; __extension__ typedef __u_quad_t __fsfilcnt64_t; __extension__ typedef int __ssize_t; typedef __off64_t __loff_t; typedef __quad_t *__qaddr_t; typedef char *__caddr_t; __extension__ typedef int __intptr_t; __extension__ typedef unsigned int __socklen_t; # 54 "/usr/include/bits/string2.h" 2 3 4 # 394 "/usr/include/bits/string2.h" 3 4 extern void *__rawmemchr (const void *__s, int __c); # 969 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strcspn_c1 (__const char *__s, int __reject); extern __inline size_t __strcspn_c1 (__const char *__s, int __reject) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject) ++__result; return __result; } extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2); extern __inline size_t __strcspn_c2 (__const char *__s, int __reject1, int __reject2) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2) ++__result; return __result; } extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3); extern __inline size_t __strcspn_c3 (__const char *__s, int __reject1, int __reject2, int __reject3) { register size_t __result = 0; while (__s[__result] != '\0' && __s[__result] != __reject1 && __s[__result] != __reject2 && __s[__result] != __reject3) ++__result; return __result; } # 1045 "/usr/include/bits/string2.h" 3 4 extern __inline size_t __strspn_c1 (__const char *__s, int __accept); extern __inline size_t __strspn_c1 (__const char *__s, int __accept) { register size_t __result = 0; while (__s[__result] == __accept) ++__result; return __result; } extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2); extern __inline size_t __strspn_c2 (__const char *__s, int __accept1, int __accept2) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2) ++__result; return __result; } extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline size_t __strspn_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { register size_t __result = 0; while (__s[__result] == __accept1 || __s[__result] == __accept2 || __s[__result] == __accept3) ++__result; return __result; } # 1121 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strpbrk_c2 (__const char *__s, int __accept1, int __accept2); extern __inline char * __strpbrk_c2 (__const char *__s, int __accept1, int __accept2) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } extern __inline char *__strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3); extern __inline char * __strpbrk_c3 (__const char *__s, int __accept1, int __accept2, int __accept3) { while (*__s != '\0' && *__s != __accept1 && *__s != __accept2 && *__s != __accept3) ++__s; return *__s == '\0' ? ((void *)0) : (char *) (size_t) __s; } # 1173 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strtok_r_1c (char *__s, char __sep, char **__nextp); extern __inline char * __strtok_r_1c (char *__s, char __sep, char **__nextp) { char *__result; if (__s == ((void *)0)) __s = *__nextp; while (*__s == __sep) ++__s; __result = ((void *)0); if (*__s != '\0') { __result = __s++; while (*__s != '\0') if (*__s++ == __sep) { __s[-1] = '\0'; break; } *__nextp = __s; } return __result; } # 1205 "/usr/include/bits/string2.h" 3 4 extern char *__strsep_g (char **__stringp, __const char *__delim); # 1223 "/usr/include/bits/string2.h" 3 4 extern __inline char *__strsep_1c (char **__s, char __reject); extern __inline char * __strsep_1c (char **__s, char __reject) { register char *__retval = *__s; if (__retval != ((void *)0) && (*__s = (__extension__ (__builtin_constant_p (__reject) && !__builtin_constant_p (__retval) && (__reject) == '\0' ? (char *) __rawmemchr (__retval, __reject) : __builtin_strchr (__retval, __reject)))) != ((void *)0)) *(*__s)++ = '\0'; return __retval; } extern __inline char *__strsep_2c (char **__s, char __reject1, char __reject2); extern __inline char * __strsep_2c (char **__s, char __reject1, char __reject2) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } extern __inline char *__strsep_3c (char **__s, char __reject1, char __reject2, char __reject3); extern __inline char * __strsep_3c (char **__s, char __reject1, char __reject2, char __reject3) { register char *__retval = *__s; if (__retval != ((void *)0)) { register char *__cp = __retval; while (1) { if (*__cp == '\0') { __cp = ((void *)0); break; } if (*__cp == __reject1 || *__cp == __reject2 || *__cp == __reject3) { *__cp++ = '\0'; break; } ++__cp; } *__s = __cp; } return __retval; } # 1299 "/usr/include/bits/string2.h" 3 4 # 1 "/usr/include/stdlib.h" 1 3 4 # 33 "/usr/include/stdlib.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 34 "/usr/include/stdlib.h" 2 3 4 # 587 "/usr/include/stdlib.h" 3 4 extern void *malloc (size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; extern void *calloc (size_t __nmemb, size_t __size) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)) ; # 978 "/usr/include/stdlib.h" 3 4 # 1300 "/usr/include/bits/string2.h" 2 3 4 extern char *__strdup (__const char *__string) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 1323 "/usr/include/bits/string2.h" 3 4 extern char *__strndup (__const char *__string, size_t __n) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); # 418 "/usr/include/string.h" 2 3 4 # 426 "/usr/include/string.h" 3 4 # 28 "regex.c" 2 # 1 "/usr/include/stdio.h" 1 3 4 # 30 "/usr/include/stdio.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 35 "/usr/include/stdio.h" 2 3 4 # 44 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE FILE; # 62 "/usr/include/stdio.h" 3 4 typedef struct _IO_FILE __FILE; # 72 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/libio.h" 1 3 4 # 32 "/usr/include/libio.h" 3 4 # 1 "/usr/include/_G_config.h" 1 3 4 # 14 "/usr/include/_G_config.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 326 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4 typedef long int wchar_t; # 355 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4 typedef unsigned int wint_t; # 15 "/usr/include/_G_config.h" 2 3 4 # 24 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/include/bits/wchar.h" 1 3 4 # 51 "/usr/include/wchar.h" 2 3 4 # 76 "/usr/include/wchar.h" 3 4 typedef struct { int __count; union { wint_t __wch; char __wchb[4]; } __value; } __mbstate_t; # 25 "/usr/include/_G_config.h" 2 3 4 typedef struct { __off_t __pos; __mbstate_t __state; } _G_fpos_t; typedef struct { __off64_t __pos; __mbstate_t __state; } _G_fpos64_t; # 44 "/usr/include/_G_config.h" 3 4 # 1 "/usr/include/gconv.h" 1 3 4 # 28 "/usr/include/gconv.h" 3 4 # 1 "/usr/include/wchar.h" 1 3 4 # 48 "/usr/include/wchar.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 49 "/usr/include/wchar.h" 2 3 4 # 29 "/usr/include/gconv.h" 2 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 32 "/usr/include/gconv.h" 2 3 4 enum { __GCONV_OK = 0, __GCONV_NOCONV, __GCONV_NODB, __GCONV_NOMEM, __GCONV_EMPTY_INPUT, __GCONV_FULL_OUTPUT, __GCONV_ILLEGAL_INPUT, __GCONV_INCOMPLETE_INPUT, __GCONV_ILLEGAL_DESCRIPTOR, __GCONV_INTERNAL_ERROR }; enum { __GCONV_IS_LAST = 0x0001, __GCONV_IGNORE_ERRORS = 0x0002 }; struct __gconv_step; struct __gconv_step_data; struct __gconv_loaded_object; struct __gconv_trans_data; typedef int (*__gconv_fct) (struct __gconv_step *, struct __gconv_step_data *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *, int, int); typedef wint_t (*__gconv_btowc_fct) (struct __gconv_step *, unsigned char); typedef int (*__gconv_init_fct) (struct __gconv_step *); typedef void (*__gconv_end_fct) (struct __gconv_step *); typedef int (*__gconv_trans_fct) (struct __gconv_step *, struct __gconv_step_data *, void *, __const unsigned char *, __const unsigned char **, __const unsigned char *, unsigned char **, size_t *); typedef int (*__gconv_trans_context_fct) (void *, __const unsigned char *, __const unsigned char *, unsigned char *, unsigned char *); typedef int (*__gconv_trans_query_fct) (__const char *, __const char ***, size_t *); typedef int (*__gconv_trans_init_fct) (void **, const char *); typedef void (*__gconv_trans_end_fct) (void *); struct __gconv_trans_data { __gconv_trans_fct __trans_fct; __gconv_trans_context_fct __trans_context_fct; __gconv_trans_end_fct __trans_end_fct; void *__data; struct __gconv_trans_data *__next; }; struct __gconv_step { struct __gconv_loaded_object *__shlib_handle; __const char *__modname; int __counter; char *__from_name; char *__to_name; __gconv_fct __fct; __gconv_btowc_fct __btowc_fct; __gconv_init_fct __init_fct; __gconv_end_fct __end_fct; int __min_needed_from; int __max_needed_from; int __min_needed_to; int __max_needed_to; int __stateful; void *__data; }; struct __gconv_step_data { unsigned char *__outbuf; unsigned char *__outbufend; int __flags; int __invocation_counter; int __internal_use; __mbstate_t *__statep; __mbstate_t __state; struct __gconv_trans_data *__trans; }; typedef struct __gconv_info { size_t __nsteps; struct __gconv_step *__steps; __extension__ struct __gconv_step_data __data []; } *__gconv_t; # 45 "/usr/include/_G_config.h" 2 3 4 typedef union { struct __gconv_info __cd; struct { struct __gconv_info __cd; struct __gconv_step_data __data; } __combined; } _G_iconv_t; typedef int _G_int16_t __attribute__ ((__mode__ (__HI__))); typedef int _G_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__))); # 33 "/usr/include/libio.h" 2 3 4 # 53 "/usr/include/libio.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 1 3 4 # 43 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 54 "/usr/include/libio.h" 2 3 4 # 166 "/usr/include/libio.h" 3 4 struct _IO_jump_t; struct _IO_FILE; # 176 "/usr/include/libio.h" 3 4 typedef void _IO_lock_t; struct _IO_marker { struct _IO_marker *_next; struct _IO_FILE *_sbuf; int _pos; # 199 "/usr/include/libio.h" 3 4 }; enum __codecvt_result { __codecvt_ok, __codecvt_partial, __codecvt_error, __codecvt_noconv }; # 267 "/usr/include/libio.h" 3 4 struct _IO_FILE { int _flags; char* _IO_read_ptr; char* _IO_read_end; char* _IO_read_base; char* _IO_write_base; char* _IO_write_ptr; char* _IO_write_end; char* _IO_buf_base; char* _IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; # 315 "/usr/include/libio.h" 3 4 __off64_t _offset; # 324 "/usr/include/libio.h" 3 4 void *__pad1; void *__pad2; void *__pad3; void *__pad4; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; typedef struct _IO_FILE _IO_FILE; struct _IO_FILE_plus; extern struct _IO_FILE_plus _IO_2_1_stdin_; extern struct _IO_FILE_plus _IO_2_1_stdout_; extern struct _IO_FILE_plus _IO_2_1_stderr_; # 360 "/usr/include/libio.h" 3 4 typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t __io_write_fn (void *__cookie, __const char *__buf, size_t __n); typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w); typedef int __io_close_fn (void *__cookie); # 412 "/usr/include/libio.h" 3 4 extern int __underflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern int __uflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern int __overflow (_IO_FILE *, int) __attribute__ ((__nothrow__)); extern wint_t __wunderflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern wint_t __wuflow (_IO_FILE *) __attribute__ ((__nothrow__)); extern wint_t __woverflow (_IO_FILE *, wint_t) __attribute__ ((__nothrow__)); # 450 "/usr/include/libio.h" 3 4 extern int _IO_getc (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_putc (int __c, _IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern int _IO_peekc_locked (_IO_FILE *__fp) __attribute__ ((__nothrow__)); extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__)); extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__)); # 480 "/usr/include/libio.h" 3 4 extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict, __gnuc_va_list, int *__restrict); extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict, __gnuc_va_list); extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t) __attribute__ ((__nothrow__)); extern size_t _IO_sgetn (_IO_FILE *, void *, size_t) __attribute__ ((__nothrow__)); extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int) __attribute__ ((__nothrow__)); extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int) __attribute__ ((__nothrow__)); extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__)); # 73 "/usr/include/stdio.h" 2 3 4 # 86 "/usr/include/stdio.h" 3 4 typedef _G_fpos64_t fpos_t; # 138 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio_lim.h" 1 3 4 # 139 "/usr/include/stdio.h" 2 3 4 extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; extern int remove (__const char *__filename) __attribute__ ((__nothrow__)); extern int rename (__const char *__old, __const char *__new) __attribute__ ((__nothrow__)); # 172 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile (void) __asm__ ("" "tmpfile64"); # 183 "/usr/include/stdio.h" 3 4 extern char *tmpnam (char *__s) __attribute__ ((__nothrow__)); extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__)); # 201 "/usr/include/stdio.h" 3 4 extern char *tempnam (__const char *__dir, __const char *__pfx) __attribute__ ((__nothrow__)) __attribute__ ((__malloc__)); extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 226 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 240 "/usr/include/stdio.h" 3 4 # 257 "/usr/include/stdio.h" 3 4 extern FILE *fopen (__const char *__restrict __filename, __const char *__restrict __modes) __asm__ ("" "fopen64"); extern FILE *freopen (__const char *__restrict __filename, __const char *__restrict __modes, FILE *__restrict __stream) __asm__ ("" "freopen64"); # 278 "/usr/include/stdio.h" 3 4 extern FILE *fdopen (int __fd, __const char *__modes) __attribute__ ((__nothrow__)); # 304 "/usr/include/stdio.h" 3 4 extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__)); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) __attribute__ ((__nothrow__)); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) __attribute__ ((__nothrow__)); extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__)); extern int fprintf (FILE *__restrict __stream, __const char *__restrict __format, ...); extern int printf (__const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); extern int vfprintf (FILE *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (__const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)); extern int snprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, __const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0))); # 398 "/usr/include/stdio.h" 3 4 extern int fscanf (FILE *__restrict __stream, __const char *__restrict __format, ...) ; extern int scanf (__const char *__restrict __format, ...) ; extern int sscanf (__const char *__restrict __s, __const char *__restrict __format, ...) __attribute__ ((__nothrow__)); # 440 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); # 464 "/usr/include/stdio.h" 3 4 extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 475 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 508 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; extern char *gets (char *__s) ; # 589 "/usr/include/stdio.h" 3 4 extern int fputs (__const char *__restrict __s, FILE *__restrict __stream); extern int puts (__const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s) ; # 642 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (__const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 686 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off64_t __off, int __whence) __asm__ ("" "fseeko64"); extern __off64_t ftello (FILE *__stream) __asm__ ("" "ftello64"); # 711 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos) __asm__ ("" "fgetpos64"); extern int fsetpos (FILE *__stream, __const fpos_t *__pos) __asm__ ("" "fsetpos64"); # 729 "/usr/include/stdio.h" 3 4 extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__)); extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void perror (__const char *__s); # 1 "/usr/include/bits/sys_errlist.h" 1 3 4 # 27 "/usr/include/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern __const char *__const sys_errlist[]; # 759 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) __attribute__ ((__nothrow__)) ; extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__)) ; # 778 "/usr/include/stdio.h" 3 4 extern FILE *popen (__const char *__command, __const char *__modes) ; extern int pclose (FILE *__stream); extern char *ctermid (char *__s) __attribute__ ((__nothrow__)); # 818 "/usr/include/stdio.h" 3 4 extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__)); extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__)) ; extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__)); # 839 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/bits/stdio.h" 1 3 4 # 33 "/usr/include/bits/stdio.h" 3 4 extern __inline int vprintf (__const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline int getchar (void) { return _IO_getc (stdin); } extern __inline int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline int putchar (int __c) { return _IO_putc (__c, stdout); } extern __inline int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } # 111 "/usr/include/bits/stdio.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) feof_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x10) != 0); } extern __inline int __attribute__ ((__nothrow__)) ferror_unlocked (FILE *__stream) { return (((__stream)->_flags & 0x20) != 0); } # 840 "/usr/include/stdio.h" 2 3 4 # 848 "/usr/include/stdio.h" 3 4 # 34 "regex.c" 2 # 1 "/usr/include/ctype.h" 1 3 4 # 30 "/usr/include/ctype.h" 3 4 # 48 "/usr/include/ctype.h" 3 4 enum { _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) }; # 81 "/usr/include/ctype.h" 3 4 extern __const unsigned short int **__ctype_b_loc (void) __attribute__ ((__const)); extern __const __int32_t **__ctype_tolower_loc (void) __attribute__ ((__const)); extern __const __int32_t **__ctype_toupper_loc (void) __attribute__ ((__const)); # 96 "/usr/include/ctype.h" 3 4 extern int isalnum (int) __attribute__ ((__nothrow__)); extern int isalpha (int) __attribute__ ((__nothrow__)); extern int iscntrl (int) __attribute__ ((__nothrow__)); extern int isdigit (int) __attribute__ ((__nothrow__)); extern int islower (int) __attribute__ ((__nothrow__)); extern int isgraph (int) __attribute__ ((__nothrow__)); extern int isprint (int) __attribute__ ((__nothrow__)); extern int ispunct (int) __attribute__ ((__nothrow__)); extern int isspace (int) __attribute__ ((__nothrow__)); extern int isupper (int) __attribute__ ((__nothrow__)); extern int isxdigit (int) __attribute__ ((__nothrow__)); extern int tolower (int __c) __attribute__ ((__nothrow__)); extern int toupper (int __c) __attribute__ ((__nothrow__)); # 142 "/usr/include/ctype.h" 3 4 extern int isascii (int __c) __attribute__ ((__nothrow__)); extern int toascii (int __c) __attribute__ ((__nothrow__)); extern int _toupper (int) __attribute__ ((__nothrow__)); extern int _tolower (int) __attribute__ ((__nothrow__)); # 190 "/usr/include/ctype.h" 3 4 extern __inline int __attribute__ ((__nothrow__)) tolower (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } extern __inline int __attribute__ ((__nothrow__)) toupper (int __c) { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # 323 "/usr/include/ctype.h" 3 4 # 37 "regex.c" 2 # 1 "/usr/include/sys/types.h" 1 3 4 # 29 "/usr/include/sys/types.h" 3 4 typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino64_t ino_t; # 62 "/usr/include/sys/types.h" 3 4 typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; typedef __off64_t off_t; # 100 "/usr/include/sys/types.h" 3 4 typedef __pid_t pid_t; typedef __id_t id_t; typedef __ssize_t ssize_t; typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 133 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/time.h" 1 3 4 # 75 "/usr/include/time.h" 3 4 typedef __time_t time_t; # 93 "/usr/include/time.h" 3 4 typedef __clockid_t clockid_t; # 105 "/usr/include/time.h" 3 4 typedef __timer_t timer_t; # 134 "/usr/include/sys/types.h" 2 3 4 # 147 "/usr/include/sys/types.h" 3 4 # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 148 "/usr/include/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 195 "/usr/include/sys/types.h" 3 4 typedef int int8_t __attribute__ ((__mode__ (__QI__))); typedef int int16_t __attribute__ ((__mode__ (__HI__))); typedef int int32_t __attribute__ ((__mode__ (__SI__))); typedef int int64_t __attribute__ ((__mode__ (__DI__))); typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__))); typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__))); typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__))); typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__))); typedef int register_t __attribute__ ((__mode__ (__word__))); # 220 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/sys/select.h" 1 3 4 # 31 "/usr/include/sys/select.h" 3 4 # 1 "/usr/include/bits/select.h" 1 3 4 # 32 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/sigset.h" 1 3 4 # 23 "/usr/include/bits/sigset.h" 3 4 typedef int __sig_atomic_t; typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 35 "/usr/include/sys/select.h" 2 3 4 typedef __sigset_t sigset_t; # 1 "/usr/include/time.h" 1 3 4 # 121 "/usr/include/time.h" 3 4 struct timespec { __time_t tv_sec; long int tv_nsec; }; # 45 "/usr/include/sys/select.h" 2 3 4 # 1 "/usr/include/bits/time.h" 1 3 4 # 69 "/usr/include/bits/time.h" 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 47 "/usr/include/sys/select.h" 2 3 4 typedef __suseconds_t suseconds_t; typedef long int __fd_mask; # 67 "/usr/include/sys/select.h" 3 4 typedef struct { __fd_mask __fds_bits[1024 / (8 * sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 99 "/usr/include/sys/select.h" 3 4 # 109 "/usr/include/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 121 "/usr/include/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 221 "/usr/include/sys/types.h" 2 3 4 # 1 "/usr/include/sys/sysmacros.h" 1 3 4 # 29 "/usr/include/sys/sysmacros.h" 3 4 __extension__ extern __inline unsigned int gnu_dev_major (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__)); __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_major (unsigned long long int __dev) { return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff); } __extension__ extern __inline unsigned int __attribute__ ((__nothrow__)) gnu_dev_minor (unsigned long long int __dev) { return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff); } __extension__ extern __inline unsigned long long int __attribute__ ((__nothrow__)) gnu_dev_makedev (unsigned int __major, unsigned int __minor) { return ((__minor & 0xff) | ((__major & 0xfff) << 8) | (((unsigned long long int) (__minor & ~0xff)) << 12) | (((unsigned long long int) (__major & ~0xfff)) << 32)); } # 224 "/usr/include/sys/types.h" 2 3 4 # 248 "/usr/include/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt_t; typedef __fsblkcnt64_t fsblkcnt_t; typedef __fsfilcnt64_t fsfilcnt_t; # 270 "/usr/include/sys/types.h" 3 4 # 1 "/usr/include/bits/pthreadtypes.h" 1 3 4 # 36 "/usr/include/bits/pthreadtypes.h" 3 4 typedef unsigned long int pthread_t; typedef union { char __size[36]; long int __align; } pthread_attr_t; typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; typedef union { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; int __kind; unsigned int __nusers; __extension__ union { int __spins; __pthread_slist_t __list; }; } __data; char __size[24]; long int __align; } pthread_mutex_t; typedef union { char __size[4]; long int __align; } pthread_mutexattr_t; typedef union { struct { int __lock; unsigned int __futex; __extension__ unsigned long long int __total_seq; __extension__ unsigned long long int __wakeup_seq; __extension__ unsigned long long int __woken_seq; void *__mutex; unsigned int __nwaiters; unsigned int __broadcast_seq; } __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { char __size[4]; long int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; typedef union { struct { int __lock; unsigned int __nr_readers; unsigned int __readers_wakeup; unsigned int __writer_wakeup; unsigned int __nr_readers_queued; unsigned int __nr_writers_queued; unsigned int __flags; int __writer; } __data; char __size[32]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[20]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 271 "/usr/include/sys/types.h" 2 3 4 # 38 "regex.c" 2 # 48 "regex.c" # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 152 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 3 4 typedef int ptrdiff_t; # 49 "regex.c" 2 # 65 "regex.c" # 1 "defines.h" 1 # 49 "defines.h" void *ruby_xmalloc (long); void *ruby_xcalloc (long,long); void *ruby_xrealloc (void*,long); void ruby_xfree (void*); # 66 "regex.c" 2 extern int rb_prohibit_interrupt; extern int rb_trap_pending; void rb_trap_exec (void); # 157 "regex.c" # 1 "regex.h" 1 # 44 "regex.h" # 1 "/usr/lib/gcc/i686-pc-linux-gnu/4.1.1/include/stddef.h" 1 3 4 # 45 "regex.h" 2 # 91 "regex.h" extern const unsigned char *re_mbctab; void ruby_re_mbcinit (int); # 108 "regex.h" typedef union { unsigned char *word; struct { unsigned is_active : 1; unsigned matched_something : 1; } bits; } ruby_register_info_type; struct re_pattern_buffer { char *buffer; int allocated; int used; char *fastmap; char *must; int *must_skip; long options; long re_nsub; char fastmap_accurate; char can_be_null; # 144 "regex.h" unsigned char **regstart; unsigned char **regend; unsigned char **old_regstart; unsigned char **old_regend; ruby_register_info_type *reg_info; unsigned char **best_regstart; unsigned char **best_regend; }; typedef struct re_pattern_buffer regex_t; # 165 "regex.h" struct re_registers { int allocated; int num_regs; int *beg; int *end; }; typedef size_t regoff_t; typedef struct { regoff_t rm_so; regoff_t rm_eo; } regmatch_t; extern char *ruby_re_compile_pattern (const char *, int, struct re_pattern_buffer *); void ruby_re_free_pattern (struct re_pattern_buffer *); extern int ruby_re_adjust_startpos (struct re_pattern_buffer *, const char*, int, int, int); extern void ruby_re_compile_fastmap (struct re_pattern_buffer *); extern int ruby_re_search (struct re_pattern_buffer *, const char*, int, int, int, struct re_registers *); extern int ruby_re_match (struct re_pattern_buffer *, const char *, int, int, struct re_registers *); extern void ruby_re_set_casetable (const char *table); extern void ruby_re_copy_registers (struct re_registers*, struct re_registers*); extern void ruby_re_free_registers (struct re_registers*); # 158 "regex.c" 2 static void store_jump (char*, int, char*); static void insert_jump (int, char*, char*, char*); static void store_jump_n (char*, int, char*, unsigned); static void insert_jump_n (int, char*, char*, char*, unsigned); static void insert_op (int, char*, char*); static void insert_op_2 (int, char*, char*, int, int); static int memcmp_translate (unsigned char*, unsigned char*, int); # 177 "regex.c" static char re_syntax_table[256]; static void init_syntax_once (void); static const unsigned char *translate = 0; static void init_regs (struct re_registers*, unsigned int); static void bm_init_skip (int *, unsigned char*, int, const unsigned char*); static int current_mbctype = 0; # 1 "util.h" 1 # 38 "util.h" unsigned long ruby_scan_oct (const char*, int, int*); unsigned long ruby_scan_hex (const char*, int, int*); void ruby_qsort (void*, const int, const int, int (*)(), void*); void ruby_setenv (const char*, const char*); void ruby_unsetenv (const char*); char *ruby_strdup (const char*); char *ruby_getcwd (void); double ruby_strtod (const char*, char **); # 188 "regex.c" 2 void rb_warn (const char*, ...); static void init_syntax_once() { register int c; static int done = 0; if (done) return; memset(re_syntax_table, 0, sizeof re_syntax_table); for (c=0; c<=0x7f; c++) if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISalnum)) re_syntax_table[c] = 1; re_syntax_table['_'] = 1; for (c=0x80; c<=0xff; c++) if (((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISalnum)) re_syntax_table[c] = 2; done = 1; } void ruby_re_set_casetable(table) const char *table; { translate = (const unsigned char*)table; } # 293 "regex.c" enum regexpcode { unused=0, exactn=1, begline, endline, begbuf, endbuf, endbuf2, begpos, jump, jump_past_alt, on_failure_jump, finalize_jump, maybe_finalize_jump, dummy_failure_jump, push_dummy_failure, succeed_n, jump_n, try_next, finalize_push, finalize_push_n, set_number_at, anychar, anychar_repeat, charset, charset_not, start_memory, stop_memory, start_paren, stop_paren, casefold_on, casefold_off, option_set, start_nowidth, stop_nowidth, pop_and_fail, stop_backtrack, duplicate, wordchar, notwordchar, wordbeg, wordend, wordbound, notwordbound }; # 422 "regex.c" long re_set_syntax(syntax) long syntax; { return 0; } # 478 "regex.c" typedef unsigned int (*mbc_startpos_func_t) (const char *string, unsigned int pos); static unsigned int asc_startpos (const char *string, unsigned int pos); static unsigned int euc_startpos (const char *string, unsigned int pos); static unsigned int sjis_startpos (const char *string, unsigned int pos); static unsigned int utf8_startpos (const char *string, unsigned int pos); static const mbc_startpos_func_t mbc_startpos_func[4] = { asc_startpos, euc_startpos, sjis_startpos, utf8_startpos }; static unsigned int utf8_firstbyte(c) unsigned long c; { if (c < 0x80) return c; if (c <= 0x7ff) return ((c>>6)&0xff)|0xc0; if (c <= 0xffff) return ((c>>12)&0xff)|0xe0; if (c <= 0x1fffff) return ((c>>18)&0xff)|0xf0; if (c <= 0x3ffffff) return ((c>>24)&0xff)|0xf8; if (c <= 0x7fffffff) return ((c>>30)&0xff)|0xfc; return 0xfe; } static void print_mbc(c) unsigned int c; { if (current_mbctype == 3) { if (c < 0x80) printf("%c", (int)c); else if (c <= 0x7ff) printf("%c%c", (int)utf8_firstbyte(c), (int)(c & 0x3f)); else if (c <= 0xffff) printf("%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); else if (c <= 0x1fffff) printf("%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 12) & 0x3f), (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); else if (c <= 0x3ffffff) printf("%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 18) & 0x3f), (int)((c >> 12) & 0x3f), (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); else if (c <= 0x7fffffff) printf("%c%c%c%c%c%c", (int)utf8_firstbyte(c), (int)((c >> 24) & 0x3f), (int)((c >> 18) & 0x3f), (int)((c >> 12) & 0x3f), (int)((c >> 6) & 0x3f), (int)(c & 0x3f)); } else if (c < 0xff) { printf("\\%o", (int)c); } else { printf("%c%c", (int)(c >> 8), (int)(c &0xff)); } } # 660 "regex.c" static void set_list_bits(c1, c2, b) unsigned long c1, c2; unsigned char *b; { unsigned char sbc_size = b[-1]; unsigned short mbc_size = ((unsigned char)(&b[sbc_size])[0] | (unsigned char)(&b[sbc_size])[1] << 8); unsigned short beg, end, upb; if (c1 > c2) return; b = &b[sbc_size + 2]; for (beg = 0, upb = mbc_size; beg < upb; ) { unsigned short mid = (unsigned short)(beg + upb) >> 1; if ((int)c1 - 1 > (int)((unsigned int)((unsigned char)(&b[mid*8+4])[0] << 24 | (unsigned char)(&b[mid*8+4])[1] << 16 | (unsigned char)(&b[mid*8+4])[2] << 8 | (unsigned char)(&b[mid*8+4])[3]))) beg = mid + 1; else upb = mid; } for (end = beg, upb = mbc_size; end < upb; ) { unsigned short mid = (unsigned short)(end + upb) >> 1; if ((int)c2 >= (int)((unsigned int)((unsigned char)(&b[mid*8])[0] << 24 | (unsigned char)(&b[mid*8])[1] << 16 | (unsigned char)(&b[mid*8])[2] << 8 | (unsigned char)(&b[mid*8])[3])) - 1) end = mid + 1; else upb = mid; } if (beg != end) { if (c1 > ((unsigned int)((unsigned char)(&b[beg*8])[0] << 24 | (unsigned char)(&b[beg*8])[1] << 16 | (unsigned char)(&b[beg*8])[2] << 8 | (unsigned char)(&b[beg*8])[3]))) c1 = ((unsigned int)((unsigned char)(&b[beg*8])[0] << 24 | (unsigned char)(&b[beg*8])[1] << 16 | (unsigned char)(&b[beg*8])[2] << 8 | (unsigned char)(&b[beg*8])[3])); if (c2 < ((unsigned int)((unsigned char)(&b[(end - 1)*8+4])[0] << 24 | (unsigned char)(&b[(end - 1)*8+4])[1] << 16 | (unsigned char)(&b[(end - 1)*8+4])[2] << 8 | (unsigned char)(&b[(end - 1)*8+4])[3]))) c2 = ((unsigned int)((unsigned char)(&b[(end - 1)*8+4])[0] << 24 | (unsigned char)(&b[(end - 1)*8+4])[1] << 16 | (unsigned char)(&b[(end - 1)*8+4])[2] << 8 | (unsigned char)(&b[(end - 1)*8+4])[3])); } if (end < mbc_size && end != beg + 1) memmove(&b[(beg + 1)*8], &b[end*8], (mbc_size - end)*8); do { (&b[beg*8 + 0])[0] = (unsigned char)(((c1) >>24) & 0xff); (&b[beg*8 + 0])[1] = (unsigned char)(((c1) >>16) & 0xff); (&b[beg*8 + 0])[2] = (unsigned char)(((c1) >> 8) & 0xff); (&b[beg*8 + 0])[3] = (unsigned char)(((c1) >> 0) & 0xff); } while (0); do { (&b[beg*8 + 4])[0] = (unsigned char)(((c2) >>24) & 0xff); (&b[beg*8 + 4])[1] = (unsigned char)(((c2) >>16) & 0xff); (&b[beg*8 + 4])[2] = (unsigned char)(((c2) >> 8) & 0xff); (&b[beg*8 + 4])[3] = (unsigned char)(((c2) >> 0) & 0xff); } while (0); mbc_size += beg - end + 1; do { (&b[-2])[0] = (mbc_size) & 0377; (&b[-2])[1] = (mbc_size) >> 8; } while (0); } static int is_in_list_sbc(c, b) unsigned long c; const unsigned char *b; { unsigned short size; size = *b++; return ((int)c / 8 < (int)size && b[c / 8] & 1 << c % 8); } static int is_in_list_mbc(c, b) unsigned long c; const unsigned char *b; { unsigned short size; unsigned short i, j; size = *b++; b += size + 2; size = ((unsigned char)(&b[-2])[0] | (unsigned char)(&b[-2])[1] << 8); if (size == 0) return 0; for (i = 0, j = size; i < j; ) { unsigned short k = (unsigned short)(i + j) >> 1; if (c > ((unsigned int)((unsigned char)(&b[k*8+4])[0] << 24 | (unsigned char)(&b[k*8+4])[1] << 16 | (unsigned char)(&b[k*8+4])[2] << 8 | (unsigned char)(&b[k*8+4])[3]))) i = k + 1; else j = k; } if (i < size && ((unsigned int)((unsigned char)(&b[i*8])[0] << 24 | (unsigned char)(&b[i*8])[1] << 16 | (unsigned char)(&b[i*8])[2] << 8 | (unsigned char)(&b[i*8])[3])) <= c) return 1; return 0; } static int is_in_list(c, b) unsigned long c; const unsigned char *b; { return is_in_list_sbc(c, b) || (current_mbctype ? is_in_list_mbc(c, b) : 0); } static void print_partial_compiled_pattern(start, end) unsigned char *start; unsigned char *end; { int mcnt, mcnt2; unsigned char *p = start; unsigned char *pend = end; if (start == ((void *)0)) { printf("(null)\n"); return; } while (p < pend) { switch ((enum regexpcode)*p++) { case unused: printf("/unused"); break; case exactn: mcnt = *p++; printf("/exactn/%d", mcnt); do { putchar('/'); printf("%c", *p++); } while (--mcnt); break; case start_memory: mcnt = *p++; printf("/start_memory/%d/%d", mcnt, *p++); break; case stop_memory: mcnt = *p++; printf("/stop_memory/%d/%d", mcnt, *p++); break; case start_paren: printf("/start_paren"); break; case stop_paren: printf("/stop_paren"); break; case casefold_on: printf("/casefold_on"); break; case casefold_off: printf("/casefold_off"); break; case option_set: printf("/option_set/%d", *p++); break; case start_nowidth: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/start_nowidth//%d", mcnt); break; case stop_nowidth: printf("/stop_nowidth//"); p += 2; break; case pop_and_fail: printf("/pop_and_fail"); break; case stop_backtrack: printf("/stop_backtrack//"); p += 2; break; case duplicate: printf("/duplicate/%d", *p++); break; case anychar: printf("/anychar"); break; case anychar_repeat: printf("/anychar_repeat"); break; case charset: case charset_not: { register int c; printf("/charset%s", (enum regexpcode)*(p - 1) == charset_not ? "_not" : ""); mcnt = *p++; printf("/%d", mcnt); for (c = 0; c < mcnt; c++) { unsigned bit; unsigned char map_byte = p[c]; putchar('/'); for (bit = 0; bit < 8; bit++) if (map_byte & (1 << bit)) printf("%c", c * 8 + bit); } p += mcnt; mcnt = ((p) += 2, (unsigned char)(p)[-2] | (unsigned char)(p)[-1] << 8); putchar('/'); while (mcnt--) { print_mbc(((unsigned int)((p) += 4, (unsigned char)(p)[-4] << 24 | (unsigned char)(p)[-3] << 16 | (unsigned char)(p)[-2] << 8 | (unsigned char)(p)[-1]))); putchar('-'); print_mbc(((unsigned int)((p) += 4, (unsigned char)(p)[-4] << 24 | (unsigned char)(p)[-3] << 16 | (unsigned char)(p)[-2] << 8 | (unsigned char)(p)[-1]))); } break; } case begline: printf("/begline"); break; case endline: printf("/endline"); break; case on_failure_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/on_failure_jump//%d", mcnt); break; case dummy_failure_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/dummy_failure_jump//%d", mcnt); break; case push_dummy_failure: printf("/push_dummy_failure"); break; case finalize_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/finalize_jump//%d", mcnt); break; case maybe_finalize_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/maybe_finalize_jump//%d", mcnt); break; case jump_past_alt: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/jump_past_alt//%d", mcnt); break; case jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/jump//%d", mcnt); break; case succeed_n: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { do { (mcnt2) = *(p) & 0377; (mcnt2) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/succeed_n//%d//%d", mcnt, mcnt2); break; case jump_n: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { do { (mcnt2) = *(p) & 0377; (mcnt2) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/jump_n//%d//%d", mcnt, mcnt2); break; case set_number_at: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { do { (mcnt2) = *(p) & 0377; (mcnt2) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/set_number_at//%d//%d", mcnt, mcnt2); break; case try_next: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/try_next//%d", mcnt); break; case finalize_push: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/finalize_push//%d", mcnt); break; case finalize_push_n: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { do { (mcnt2) = *(p) & 0377; (mcnt2) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); printf("/finalize_push_n//%d//%d", mcnt, mcnt2); break; case wordbound: printf("/wordbound"); break; case notwordbound: printf("/notwordbound"); break; case wordbeg: printf("/wordbeg"); break; case wordend: printf("/wordend"); case wordchar: printf("/wordchar"); break; case notwordchar: printf("/notwordchar"); break; case begbuf: printf("/begbuf"); break; case endbuf: printf("/endbuf"); break; case endbuf2: printf("/endbuf2"); break; case begpos: printf("/begpos"); break; default: printf("?%d", *(p-1)); } } printf("/\n"); } static void print_compiled_pattern(bufp) struct re_pattern_buffer *bufp; { unsigned char *buffer = (unsigned char*)bufp->buffer; print_partial_compiled_pattern(buffer, buffer + bufp->used); } static char* calculate_must_string(start, end) char *start; char *end; { int mcnt; int max = 0; unsigned char *p = start; unsigned char *pend = end; char *must = 0; if (start == ((void *)0)) return 0; while (p < pend) { switch ((enum regexpcode)*p++) { case unused: break; case exactn: mcnt = *p; if (mcnt > max) { must = p; max = mcnt; } p += mcnt+1; break; case start_memory: case stop_memory: p += 2; break; case duplicate: case option_set: p++; break; case casefold_on: case casefold_off: return 0; case pop_and_fail: case anychar: case anychar_repeat: case begline: case endline: case wordbound: case notwordbound: case wordbeg: case wordend: case wordchar: case notwordchar: case begbuf: case endbuf: case endbuf2: case begpos: case push_dummy_failure: case start_paren: case stop_paren: break; case charset: case charset_not: mcnt = *p++; p += mcnt; mcnt = ((p) += 2, (unsigned char)(p)[-2] | (unsigned char)(p)[-1] << 8); while (mcnt--) { p += 8; } break; case on_failure_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (mcnt > 0) p += mcnt; if ((enum regexpcode)p[-3] == jump) { p -= 2; do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (mcnt > 0) p += mcnt; } break; case dummy_failure_jump: case succeed_n: case try_next: case jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (mcnt > 0) p += mcnt; break; case start_nowidth: case stop_nowidth: case stop_backtrack: case finalize_jump: case maybe_finalize_jump: case finalize_push: p += 2; break; case jump_n: case set_number_at: case finalize_push_n: p += 4; break; default: break; } } return must; } static unsigned int read_backslash(c) int c; { switch (c) { case 'n': return '\n'; case 't': return '\t'; case 'r': return '\r'; case 'f': return '\f'; case 'v': return '\v'; case 'a': return '\007'; case 'b': return '\010'; case 'e': return '\033'; } return c; } static unsigned int read_special(p, pend, pp) const char *p, *pend, **pp; { int c; do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); switch (c) { case 'M': do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); if (c != '-') return -1; do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); *pp = p; if (c == '\\') { return read_special(--p, pend, pp) | 0x80; } else if (c == -1) return ~0; else { return ((c & 0xff) | 0x80); } case 'C': do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); if (c != '-') return ~0; case 'c': do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); *pp = p; if (c == '\\') { c = read_special(--p, pend, pp); } else if (c == '?') return 0177; else if (c == -1) return ~0; return c & 0x9f; default: *pp = p + 1; return read_backslash(c); } end_of_pattern: return ~0; } # 1208 "regex.c" char * ruby_re_compile_pattern(pattern, size, bufp) const char *pattern; int size; struct re_pattern_buffer *bufp; { register char *b = bufp->buffer; register const char *p = pattern; const char *nextp; const char *pend = pattern + size; register unsigned int c, c1 = 0; const char *p0; int numlen; static char error_msg[200 +1]; char *pending_exact = 0; char *fixup_alt_jump = 0; char *laststart = 0; char zero_times_ok; char many_times_ok; char greedy; char *begalt = b; const char *beg_interval; int lower_bound; int upper_bound; # 1276 "regex.c" int stacka[40]; int *stackb = stacka; int *stackp = stackb; int *stacke = stackb + 40; int regnum = 1; int range = 0; int had_mbchar = 0; int had_num_literal = 0; int had_char_class = 0; int options = bufp->options; bufp->fastmap_accurate = 0; bufp->must = 0; bufp->must_skip = 0; init_syntax_once(); if (bufp->allocated == 0) { bufp->allocated = 28; bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, 28); if (!bufp->buffer) goto memory_exhausted; begalt = b = bufp->buffer; } while (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); switch (c) { case '$': if (bufp->options & ((((1L)<<1)<<1)<<1)) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(endbuf); } while (0); } else { p0 = p; while (p0 != pend) { if (*p0 == '\\' && p0 + 1 != pend && (p0[1] == 'b' || p0[1] == 'B')) p0 += 2; else break; } do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(endline); } while (0); } break; case '^': if (bufp->options & ((((1L)<<1)<<1)<<1)) do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(begbuf); } while (0); else do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(begline); } while (0); break; case '+': case '?': case '*': if (!laststart) { snprintf(error_msg, 200, "invalid regular expression; there's no previous pattern, to which '%c' would define cardinality at %d", c, p-pattern); do { ; if (stackb != stacka) ruby_xfree(stackb); return(error_msg); } while(0); } zero_times_ok = c != '+'; many_times_ok = c != '?'; greedy = 1; if (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); switch (c) { case '?': greedy = 0; break; case '*': case '+': goto nested_meta; default: p--; break; } } repeat: if (!laststart) break; if (greedy && many_times_ok && *laststart == anychar && b - laststart <= 2) { if (b[-1] == stop_paren) b--; if (zero_times_ok) *laststart = anychar_repeat; else { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(anychar_repeat); } while (0); } break; } if (many_times_ok) { do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); store_jump(b,greedy?maybe_finalize_jump:finalize_push,laststart-3); b += 3; } do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump(on_failure_jump, laststart, b + 3, b); b += 3; if (zero_times_ok) { if (greedy == 0) { do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump(try_next, laststart, b + 3, b); b += 3; } } else { do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump(dummy_failure_jump, laststart, laststart + 6, b); b += 3; } break; case '.': laststart = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(anychar); } while (0); break; case '[': if (p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; '[' can't be the last character ie. can't start range at the end of pattern"); } while(0); while ((b - bufp->buffer + 9 + (1 << 8) / 8) > bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); laststart = b; if (*p == '^') { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(charset_not); } while (0); p++; } else do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(charset); } while (0); p0 = p; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)((1 << 8) / 8); } while (0); memset(b, 0, (1 << 8) / 8 + 2); had_mbchar = 0; had_num_literal = 0; had_char_class = 0; for (;;) { int size; unsigned last = (unsigned)-1; if ((size = ((unsigned char)(&b[(1 << 8) / 8])[0] | (unsigned char)(&b[(1 << 8) / 8])[1] << 8)) || current_mbctype) { size = (1 << 8) / 8 + 2 + size*8 + 8; while (b + size + 1 > bufp->buffer + bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } range_retry: if (range && had_char_class) { do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; can't use character class as an end value of range"); } while(0); } do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); if (c == ']') { if (p == p0 + 1) { if (p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; empty character class"); } while(0); rb_warn("character class has `]' without escape"); } else break; } if (had_char_class && c == '-' && *p != ']') do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; can't use character class as a start value of range"); } while(0); if (re_mbctab[(unsigned char)(c)]) { do { if (p + (re_mbctab[(unsigned char)(c)]+1) - 1 >= pend) goto end_of_pattern; do { if (current_mbctype == 3) { int n = (re_mbctab[(unsigned char)(c)]+1) - 1; c &= (1<<(8 -2-n)) - 1; while (n--) { c = c << 6 | (*p++ & ((1<<6)-1)); } } else { c <<= 8; c |= (unsigned char)*(p)++; } } while (0); } while(0); had_mbchar++; } had_char_class = 0; if (c == '-' && ((p != p0 + 1 && *p != ']') || (p[0] == '-' && p[1] != ']') || range)) rb_warn("character class has `-' without escape"); if (c == '[' && *p != ':') rb_warn("character class has `[' without escape"); if (c == '\\') { do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); switch (c) { case 'w': for (c = 0; c < (1 << 8); c++) { if (re_syntax_table[c] == 1 || (!current_mbctype && re_syntax_table[c] == 2)) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); } if (current_mbctype) { set_list_bits(0x80, 0xffffffff, b); } had_char_class = 1; last = -1; continue; case 'W': for (c = 0; c < (1 << 8); c++) { if (re_syntax_table[c] != 1 && ((current_mbctype && !re_mbctab[c]) || (!current_mbctype && re_syntax_table[c] != 2))) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); } had_char_class = 1; last = -1; continue; case 's': for (c = 0; c < 256; c++) if ((1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISspace))) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); had_char_class = 1; last = -1; continue; case 'S': for (c = 0; c < 256; c++) if (!(1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISspace))) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); if (current_mbctype) set_list_bits(0x80, 0xffffffff, b); had_char_class = 1; last = -1; continue; case 'd': for (c = '0'; c <= '9'; c++) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); had_char_class = 1; last = -1; continue; case 'D': for (c = 0; c < 256; c++) if (!(1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))) (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); if (current_mbctype) set_list_bits(0x80, 0xffffffff, b); had_char_class = 1; last = -1; continue; case 'x': c = ruby_scan_hex(p, 2, &numlen); if (numlen == 0) goto invalid_escape; p += numlen; had_num_literal = 1; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': p--; c = ruby_scan_oct(p, 3, &numlen); p += numlen; had_num_literal = 1; break; case 'M': case 'C': case 'c': { const char *pp; --p; c = read_special(p, pend, &pp); if (c > 255) goto invalid_escape; p = pp; had_num_literal = 1; } break; default: c = read_backslash(c); if (re_mbctab[(unsigned char)(c)]) { do { if (p + (re_mbctab[(unsigned char)(c)]+1) - 1 >= pend) goto end_of_pattern; do { if (current_mbctype == 3) { int n = (re_mbctab[(unsigned char)(c)]+1) - 1; c &= (1<<(8 -2-n)) - 1; while (n--) { c = c << 6 | (*p++ & ((1<<6)-1)); } } else { c <<= 8; c |= (unsigned char)*(p)++; } } while (0); } while(0); had_mbchar++; } break; } } else if (c == '[' && *p == ':') { char str[6 + 1]; do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); c1 = 0; if (p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; re can't end '[[:'"); } while(0); for (;;) { do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); if (c == ':' || c == ']' || p == pend || c1 == 6) break; str[c1++] = c; } str[c1] = '\0'; if (c == ':' && *p == ']') { int ch; char is_alnum = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("alnum") && (__s1_len = strlen (str), __s2_len = strlen ("alnum"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "alnum") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) ? __builtin_strcmp (str, "alnum") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alnum"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) && (__s2_len = strlen ("alnum"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "alnum") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alnum"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alnum"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alnum"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alnum"))[3]); } } __result; }))) : __builtin_strcmp (str, "alnum")))); }) == 0)); char is_alpha = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("alpha") && (__s1_len = strlen (str), __s2_len = strlen ("alpha"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "alpha") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) ? __builtin_strcmp (str, "alpha") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alpha"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) && (__s2_len = strlen ("alpha"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "alpha") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alpha"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alpha"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alpha"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alpha"))[3]); } } __result; }))) : __builtin_strcmp (str, "alpha")))); }) == 0)); char is_blank = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("blank") && (__s1_len = strlen (str), __s2_len = strlen ("blank"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "blank") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) ? __builtin_strcmp (str, "blank") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("blank"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) && (__s2_len = strlen ("blank"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "blank") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("blank"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("blank"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("blank"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("blank"))[3]); } } __result; }))) : __builtin_strcmp (str, "blank")))); }) == 0)); char is_cntrl = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("cntrl") && (__s1_len = strlen (str), __s2_len = strlen ("cntrl"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "cntrl") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) ? __builtin_strcmp (str, "cntrl") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("cntrl"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) && (__s2_len = strlen ("cntrl"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "cntrl") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("cntrl"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("cntrl"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("cntrl"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("cntrl"))[3]); } } __result; }))) : __builtin_strcmp (str, "cntrl")))); }) == 0)); char is_digit = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("digit") && (__s1_len = strlen (str), __s2_len = strlen ("digit"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "digit") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) ? __builtin_strcmp (str, "digit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("digit"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) && (__s2_len = strlen ("digit"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "digit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("digit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("digit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("digit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("digit"))[3]); } } __result; }))) : __builtin_strcmp (str, "digit")))); }) == 0)); char is_graph = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("graph") && (__s1_len = strlen (str), __s2_len = strlen ("graph"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "graph") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) ? __builtin_strcmp (str, "graph") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("graph"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) && (__s2_len = strlen ("graph"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "graph") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("graph"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("graph"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("graph"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("graph"))[3]); } } __result; }))) : __builtin_strcmp (str, "graph")))); }) == 0)); char is_lower = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("lower") && (__s1_len = strlen (str), __s2_len = strlen ("lower"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "lower") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) ? __builtin_strcmp (str, "lower") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("lower"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) && (__s2_len = strlen ("lower"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "lower") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("lower"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("lower"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("lower"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("lower"))[3]); } } __result; }))) : __builtin_strcmp (str, "lower")))); }) == 0)); char is_print = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("print") && (__s1_len = strlen (str), __s2_len = strlen ("print"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "print") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) ? __builtin_strcmp (str, "print") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("print"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) && (__s2_len = strlen ("print"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "print") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("print"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("print"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("print"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("print"))[3]); } } __result; }))) : __builtin_strcmp (str, "print")))); }) == 0)); char is_punct = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("punct") && (__s1_len = strlen (str), __s2_len = strlen ("punct"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "punct") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) ? __builtin_strcmp (str, "punct") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("punct"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) && (__s2_len = strlen ("punct"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "punct") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("punct"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("punct"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("punct"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("punct"))[3]); } } __result; }))) : __builtin_strcmp (str, "punct")))); }) == 0)); char is_space = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("space") && (__s1_len = strlen (str), __s2_len = strlen ("space"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "space") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) ? __builtin_strcmp (str, "space") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("space"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) && (__s2_len = strlen ("space"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "space") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("space"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("space"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("space"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("space"))[3]); } } __result; }))) : __builtin_strcmp (str, "space")))); }) == 0)); char is_upper = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("upper") && (__s1_len = strlen (str), __s2_len = strlen ("upper"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "upper") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) ? __builtin_strcmp (str, "upper") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("upper"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) && (__s2_len = strlen ("upper"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "upper") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("upper"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("upper"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("upper"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("upper"))[3]); } } __result; }))) : __builtin_strcmp (str, "upper")))); }) == 0)); char is_xdigit = ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("xdigit") && (__s1_len = strlen (str), __s2_len = strlen ("xdigit"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "xdigit") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) ? __builtin_strcmp (str, "xdigit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xdigit"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) && (__s2_len = strlen ("xdigit"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "xdigit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xdigit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xdigit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xdigit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xdigit"))[3]); } } __result; }))) : __builtin_strcmp (str, "xdigit")))); }) == 0)); if (!(((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("alpha") && (__s1_len = strlen (str), __s2_len = strlen ("alpha"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "alpha") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) ? __builtin_strcmp (str, "alpha") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alpha"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alpha") && ((size_t)(const void *)(("alpha") + 1) - (size_t)(const void *)("alpha") == 1) && (__s2_len = strlen ("alpha"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "alpha") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alpha"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alpha"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alpha"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alpha"))[3]); } } __result; }))) : __builtin_strcmp (str, "alpha")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("upper") && (__s1_len = strlen (str), __s2_len = strlen ("upper"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "upper") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) ? __builtin_strcmp (str, "upper") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("upper"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("upper") && ((size_t)(const void *)(("upper") + 1) - (size_t)(const void *)("upper") == 1) && (__s2_len = strlen ("upper"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "upper") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("upper"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("upper"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("upper"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("upper"))[3]); } } __result; }))) : __builtin_strcmp (str, "upper")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("lower") && (__s1_len = strlen (str), __s2_len = strlen ("lower"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "lower") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) ? __builtin_strcmp (str, "lower") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("lower"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("lower") && ((size_t)(const void *)(("lower") + 1) - (size_t)(const void *)("lower") == 1) && (__s2_len = strlen ("lower"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "lower") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("lower"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("lower"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("lower"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("lower"))[3]); } } __result; }))) : __builtin_strcmp (str, "lower")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("digit") && (__s1_len = strlen (str), __s2_len = strlen ("digit"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "digit") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) ? __builtin_strcmp (str, "digit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("digit"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("digit") && ((size_t)(const void *)(("digit") + 1) - (size_t)(const void *)("digit") == 1) && (__s2_len = strlen ("digit"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "digit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("digit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("digit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("digit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("digit"))[3]); } } __result; }))) : __builtin_strcmp (str, "digit")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("alnum") && (__s1_len = strlen (str), __s2_len = strlen ("alnum"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "alnum") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) ? __builtin_strcmp (str, "alnum") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("alnum"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("alnum") && ((size_t)(const void *)(("alnum") + 1) - (size_t)(const void *)("alnum") == 1) && (__s2_len = strlen ("alnum"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "alnum") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("alnum"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("alnum"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("alnum"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("alnum"))[3]); } } __result; }))) : __builtin_strcmp (str, "alnum")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("xdigit") && (__s1_len = strlen (str), __s2_len = strlen ("xdigit"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "xdigit") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) ? __builtin_strcmp (str, "xdigit") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("xdigit"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("xdigit") && ((size_t)(const void *)(("xdigit") + 1) - (size_t)(const void *)("xdigit") == 1) && (__s2_len = strlen ("xdigit"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "xdigit") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("xdigit"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("xdigit"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("xdigit"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("xdigit"))[3]); } } __result; }))) : __builtin_strcmp (str, "xdigit")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("space") && (__s1_len = strlen (str), __s2_len = strlen ("space"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "space") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) ? __builtin_strcmp (str, "space") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("space"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("space") && ((size_t)(const void *)(("space") + 1) - (size_t)(const void *)("space") == 1) && (__s2_len = strlen ("space"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "space") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("space"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("space"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("space"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("space"))[3]); } } __result; }))) : __builtin_strcmp (str, "space")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("print") && (__s1_len = strlen (str), __s2_len = strlen ("print"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "print") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) ? __builtin_strcmp (str, "print") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("print"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("print") && ((size_t)(const void *)(("print") + 1) - (size_t)(const void *)("print") == 1) && (__s2_len = strlen ("print"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "print") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("print"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("print"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("print"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("print"))[3]); } } __result; }))) : __builtin_strcmp (str, "print")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("punct") && (__s1_len = strlen (str), __s2_len = strlen ("punct"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "punct") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) ? __builtin_strcmp (str, "punct") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("punct"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("punct") && ((size_t)(const void *)(("punct") + 1) - (size_t)(const void *)("punct") == 1) && (__s2_len = strlen ("punct"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "punct") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("punct"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("punct"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("punct"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("punct"))[3]); } } __result; }))) : __builtin_strcmp (str, "punct")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("graph") && (__s1_len = strlen (str), __s2_len = strlen ("graph"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "graph") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) ? __builtin_strcmp (str, "graph") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("graph"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("graph") && ((size_t)(const void *)(("graph") + 1) - (size_t)(const void *)("graph") == 1) && (__s2_len = strlen ("graph"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "graph") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("graph"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("graph"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("graph"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("graph"))[3]); } } __result; }))) : __builtin_strcmp (str, "graph")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("cntrl") && (__s1_len = strlen (str), __s2_len = strlen ("cntrl"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "cntrl") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) ? __builtin_strcmp (str, "cntrl") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("cntrl"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("cntrl") && ((size_t)(const void *)(("cntrl") + 1) - (size_t)(const void *)("cntrl") == 1) && (__s2_len = strlen ("cntrl"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "cntrl") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("cntrl"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("cntrl"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("cntrl"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("cntrl"))[3]); } } __result; }))) : __builtin_strcmp (str, "cntrl")))); }) == 0)) || ((__extension__ ({ size_t __s1_len, __s2_len; (__builtin_constant_p (str) && __builtin_constant_p ("blank") && (__s1_len = strlen (str), __s2_len = strlen ("blank"), (!((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) || __s1_len >= 4) && (!((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) || __s2_len >= 4)) ? __builtin_strcmp (str, "blank") : (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) && (__s1_len = strlen (str), __s1_len < 4) ? (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) ? __builtin_strcmp (str, "blank") : (__extension__ ({ __const unsigned char *__s2 = (__const unsigned char *) (__const char *) ("blank"); register int __result = (((__const unsigned char *) (__const char *) (str))[0] - __s2[0]); if (__s1_len > 0 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[1] - __s2[1]); if (__s1_len > 1 && __result == 0) { __result = (((__const unsigned char *) (__const char *) (str))[2] - __s2[2]); if (__s1_len > 2 && __result == 0) __result = (((__const unsigned char *) (__const char *) (str))[3] - __s2[3]); } } __result; }))) : (__builtin_constant_p ("blank") && ((size_t)(const void *)(("blank") + 1) - (size_t)(const void *)("blank") == 1) && (__s2_len = strlen ("blank"), __s2_len < 4) ? (__builtin_constant_p (str) && ((size_t)(const void *)((str) + 1) - (size_t)(const void *)(str) == 1) ? __builtin_strcmp (str, "blank") : (__extension__ ({ __const unsigned char *__s1 = (__const unsigned char *) (__const char *) (str); register int __result = __s1[0] - ((__const unsigned char *) (__const char *) ("blank"))[0]; if (__s2_len > 0 && __result == 0) { __result = (__s1[1] - ((__const unsigned char *) (__const char *) ("blank"))[1]); if (__s2_len > 1 && __result == 0) { __result = (__s1[2] - ((__const unsigned char *) (__const char *) ("blank"))[2]); if (__s2_len > 2 && __result == 0) __result = (__s1[3] - ((__const unsigned char *) (__const char *) ("blank"))[3]); } } __result; }))) : __builtin_strcmp (str, "blank")))); }) == 0)))){ snprintf(error_msg, 200, "invalid regular expression; [:%s:] is not a character class", str); do { ; if (stackb != stacka) ruby_xfree(stackb); return(error_msg); } while(0); } do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); if (p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; range doesn't have ending ']' after a character class"); } while(0); for (ch = 0; ch < 1 << 8; ch++) { if ( (is_alnum && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalnum))) || (is_alpha && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISalpha))) || (is_blank && ((ch) == ' ' || (ch) == '\t')) || (is_cntrl && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _IScntrl))) || (is_digit && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISdigit))) || (is_graph && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISgraph))) || (is_lower && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISlower))) || (is_print && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISprint))) || (is_punct && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISpunct))) || (is_space && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISspace))) || (is_upper && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISupper))) || (is_xdigit && (1 && ((*__ctype_b_loc ())[(int) ((ch))] & (unsigned short int) _ISxdigit)))) (b[(unsigned char)(ch) / 8] |= 1 << ((unsigned char)(ch) % 8)); } had_char_class = 1; continue; } else { c1 += 2; while (c1--) p--; rb_warn("character class has `[' without escape"); c = '['; } } if (range) { if (last > c) goto invalid_pattern; range = 0; if (had_mbchar == 0) { if (((options&(1L)) && translate)) { for (;last<=c;last++) (b[(unsigned char)(translate[last]) / 8] |= 1 << ((unsigned char)(translate[last]) % 8)); } else { for (;last<=c;last++) (b[(unsigned char)(last) / 8] |= 1 << ((unsigned char)(last) % 8)); } } else if (had_mbchar == 2) { set_list_bits(last, c, b); } else { goto invalid_pattern; } } else if (p[0] == '-' && p[1] != ']') { last = c; do {if (p == pend) goto end_of_pattern; c1 = (unsigned char)*p++; } while (0); range = 1; goto range_retry; } else { if (((options&(1L)) && translate) && c < 0x100) c = (unsigned char)translate[c]; if (had_mbchar == 0 && (!current_mbctype || !had_num_literal)) { (b[(unsigned char)(c) / 8] |= 1 << ((unsigned char)(c) % 8)); had_num_literal = 0; } else { set_list_bits(c, c, b); } } had_mbchar = 0; } while ((int)b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; if (b[-1] != (1 << 8) / 8) memmove(&b[(unsigned char)b[-1]], &b[(1 << 8) / 8], 2 + ((unsigned char)(&b[(1 << 8) / 8])[0] | (unsigned char)(&b[(1 << 8) / 8])[1] << 8)*8); b += b[-1] + 2 + ((unsigned char)(&b[(unsigned char)b[-1]])[0] | (unsigned char)(&b[(unsigned char)b[-1]])[1] << 8)*8; had_num_literal = 0; break; case '(': { int old_options = options; int push_option = 0; int casefold = 0; do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); if (c == '?') { int negative = 0; do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); switch (c) { case 'x': case 'm': case 'i': case '-': for (;;) { switch (c) { case '-': negative = 1; break; case ':': case ')': break; case 'x': if (negative) options &= ~((1L)<<1); else options |= ((1L)<<1); break; case 'm': if (negative) { if (options&(((1L)<<1)<<1)) { options &= ~(((1L)<<1)<<1); } } else if (!(options&(((1L)<<1)<<1))) { options |= (((1L)<<1)<<1); } push_option = 1; break; case 'i': if (negative) { if (options&(1L)) { options &= ~(1L); } } else if (!(options&(1L))) { options |= (1L); } casefold = 1; break; default: do { ; if (stackb != stacka) ruby_xfree(stackb); return("undefined (?...) inline option"); } while(0); } if (c == ')') { c = '#'; break; } if (c == ':') break; do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); } break; case '#': for (;;) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); if (c == ')') break; } c = '#'; break; case ':': case '=': case '!': case '>': break; default: do { ; if (stackb != stacka) ruby_xfree(stackb); return("undefined (?...) sequence"); } while(0); } } else { p--; c = '('; } if (c == '#') { if (push_option) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(option_set); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(options); } while (0); } if (casefold) { if (options & (1L)) do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(casefold_on); } while (0); else do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(casefold_off); } while (0); } break; } if (stackp+8 >= stacke) { do { int *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (int*)ruby_xmalloc(2 * xlen * sizeof(int)); memcpy(stackx, stackb, xlen * sizeof (int)); } else { stackx = (int*)ruby_xrealloc(stackb, 2 * xlen * sizeof(int)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } *stackp++ = b - bufp->buffer; *stackp++ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; *stackp++ = begalt - bufp->buffer; switch (c) { case '(': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(start_memory); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(regnum); } while (0); *stackp++ = regnum++; *stackp++ = b - bufp->buffer; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); if (regnum >= ((1<<8)-1)) goto too_big; break; case '=': case '!': case '>': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(start_nowidth); } while (0); *stackp++ = b - bufp->buffer; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); if (c != '!') break; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(on_failure_jump); } while (0); *stackp++ = b - bufp->buffer; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); break; case ':': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(start_paren); } while (0); pending_exact = 0; default: break; } if (push_option) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(option_set); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(options); } while (0); } if (casefold) { if (options & (1L)) do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(casefold_on); } while (0); else do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(casefold_off); } while (0); } *stackp++ = c; *stackp++ = old_options; fixup_alt_jump = 0; laststart = 0; begalt = b; } break; case ')': if (stackp == stackb) do { ; if (stackb != stacka) ruby_xfree(stackb); return("unmatched )"); } while(0); pending_exact = 0; if (fixup_alt_jump) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(push_dummy_failure); } while (0); store_jump(fixup_alt_jump, jump, b); } if (options != stackp[-1]) { if ((options ^ stackp[-1]) & (1L)) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)((options&(1L))?casefold_off:casefold_on); } while (0); } if ((options ^ stackp[-1]) != (1L)) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(option_set); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stackp[-1]); } while (0); } } p0 = b; options = *--stackp; switch (c = *--stackp) { case '(': { char *loc = bufp->buffer + *--stackp; *loc = regnum - stackp[-1]; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_memory); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stackp[-1]); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(regnum - stackp[-1]); } while (0); stackp--; } break; case '!': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(pop_and_fail); } while (0); do { (bufp->buffer+stackp[-1])[0] = (b - bufp->buffer - stackp[-1] - 2) & 0377; (bufp->buffer+stackp[-1])[1] = (b - bufp->buffer - stackp[-1] - 2) >> 8; } while (0); stackp--; case '=': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_nowidth); } while (0); do { (bufp->buffer+stackp[-1])[0] = (b - bufp->buffer - stackp[-1] - 2) & 0377; (bufp->buffer+stackp[-1])[1] = (b - bufp->buffer - stackp[-1] - 2) >> 8; } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); stackp--; break; case '>': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_backtrack); } while (0); do { (bufp->buffer+stackp[-1])[0] = (b - bufp->buffer - stackp[-1] - 2) & 0377; (bufp->buffer+stackp[-1])[1] = (b - bufp->buffer - stackp[-1] - 2) >> 8; } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); stackp--; break; case ':': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_paren); } while (0); break; default: break; } begalt = *--stackp + bufp->buffer; stackp--; fixup_alt_jump = *stackp ? *stackp + bufp->buffer - 1 : 0; laststart = *--stackp + bufp->buffer; if (c == '!' || c == '=') laststart = b; break; case '|': do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump(on_failure_jump, begalt, b + 6, b); pending_exact = 0; b += 3; # 1992 "regex.c" if (fixup_alt_jump) store_jump(fixup_alt_jump, jump_past_alt, b); fixup_alt_jump = b; do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); b += 3; laststart = 0; begalt = b; break; case '{': if (!laststart) { snprintf(error_msg, 200, "invalid regular expression; there's no previous pattern, to which '{' would define cardinality at %d", p-pattern); do { ; if (stackb != stacka) ruby_xfree(stackb); return(error_msg); } while(0); } if( p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; '{' can't be last character"); } while(0); beg_interval = p - 1; lower_bound = -1; upper_bound = -1; do { if (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); while ((1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))) { if (lower_bound < 0) lower_bound = 0; lower_bound = lower_bound * 10 + c - '0'; if (p == pend) break; do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); } } } while (0); if (c == ',') { do { if (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); while ((1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))) { if (upper_bound < 0) upper_bound = 0; upper_bound = upper_bound * 10 + c - '0'; if (p == pend) break; do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); } } } while (0); } else upper_bound = lower_bound; if (lower_bound < 0 || c != '}') goto unfetch_interval; if (lower_bound >= ((1 << 15) - 1) || upper_bound >= ((1 << 15) - 1)) do { ; if (stackb != stacka) ruby_xfree(stackb); return("too big quantifier in {,}"); } while(0); if (upper_bound < 0) upper_bound = ((1 << 15) - 1); if (lower_bound > upper_bound) do { ; if (stackb != stacka) ruby_xfree(stackb); return("can't do {n,m} with n > m"); } while(0); beg_interval = 0; pending_exact = 0; greedy = 1; if (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); if (c == '?') greedy = 0; else p--; } if (lower_bound == 0) { zero_times_ok = 1; if (upper_bound == ((1 << 15) - 1)) { many_times_ok = 1; goto repeat; } if (upper_bound == 1) { many_times_ok = 0; goto repeat; } } if (lower_bound == 1) { if (upper_bound == 1) { break; } if (upper_bound == ((1 << 15) - 1)) { many_times_ok = 1; zero_times_ok = 0; goto repeat; } } if (upper_bound == 0) { do { while (b - bufp->buffer + (3) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump(jump, laststart, b + 3, b); b += 3; break; } if (lower_bound == upper_bound) { int mcnt; int skip_stop_paren = 0; if (b[-1] == stop_paren) { skip_stop_paren = 1; b--; } if (*laststart == exactn && laststart[1]+2 == b - laststart && laststart[1]*lower_bound < 256) { mcnt = laststart[1]; do { while (b - bufp->buffer + ((lower_bound-1)*mcnt) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); laststart[1] = lower_bound*mcnt; while (--lower_bound) { memcpy(b, laststart+2, mcnt); b += mcnt; } if (skip_stop_paren) do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_paren); } while (0); break; } if (lower_bound < 5 && b - laststart < 10) { mcnt = b - laststart; do { while (b - bufp->buffer + ((lower_bound-1)*mcnt) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); while (--lower_bound) { memcpy(b, laststart, mcnt); b += mcnt; } if (skip_stop_paren) do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(stop_paren); } while (0); break; } if (skip_stop_paren) b++; } # 2129 "regex.c" { unsigned nbytes = upper_bound == 1 ? 10 : 20; do { while (b - bufp->buffer + (nbytes) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); insert_jump_n(succeed_n, laststart, b + (nbytes/2), b, lower_bound); b += 5; insert_op_2(set_number_at, laststart, b, 5, lower_bound); b += 5; if (upper_bound > 1) { do { while (b - bufp->buffer + (5) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); store_jump_n(b, greedy?jump_n:finalize_push_n, laststart + 5, upper_bound - 1); b += 5; # 2177 "regex.c" insert_op_2(set_number_at, laststart, b, b - laststart, upper_bound - 1); b += 5; } } break; unfetch_interval: rb_warn("regexp has invalid interval"); p = beg_interval; beg_interval = 0; do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); goto normal_char; case '\\': if (p == pend) do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression; '\\' can't be last character"); } while(0); do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); switch (c) { case 's': case 'S': case 'd': case 'D': while (b - bufp->buffer + 9 + (1 << 8) / 8 > bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); laststart = b; if (c == 's' || c == 'd') { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(charset); } while (0); } else { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(charset_not); } while (0); } do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)((1 << 8) / 8); } while (0); memset(b, 0, (1 << 8) / 8 + 2); if (c == 's' || c == 'S') { (b[(unsigned char)(' ') / 8] |= 1 << ((unsigned char)(' ') % 8)); (b[(unsigned char)('\t') / 8] |= 1 << ((unsigned char)('\t') % 8)); (b[(unsigned char)('\n') / 8] |= 1 << ((unsigned char)('\n') % 8)); (b[(unsigned char)('\r') / 8] |= 1 << ((unsigned char)('\r') % 8)); (b[(unsigned char)('\f') / 8] |= 1 << ((unsigned char)('\f') % 8)); } else { char cc; for (cc = '0'; cc <= '9'; cc++) { (b[(unsigned char)(cc) / 8] |= 1 << ((unsigned char)(cc) % 8)); } } while ((int)b[-1] > 0 && b[b[-1] - 1] == 0) b[-1]--; if (b[-1] != (1 << 8) / 8) memmove(&b[(unsigned char)b[-1]], &b[(1 << 8) / 8], 2 + ((unsigned char)(&b[(1 << 8) / 8])[0] | (unsigned char)(&b[(1 << 8) / 8])[1] << 8)*8); b += b[-1] + 2 + ((unsigned char)(&b[(unsigned char)b[-1]])[0] | (unsigned char)(&b[(unsigned char)b[-1]])[1] << 8)*8; break; case 'w': laststart = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(wordchar); } while (0); break; case 'W': laststart = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(notwordchar); } while (0); break; # 2263 "regex.c" case 'b': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(wordbound); } while (0); break; case 'B': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(notwordbound); } while (0); break; case 'A': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(begbuf); } while (0); break; case 'Z': if ((bufp->options & ((((1L)<<1)<<1)<<1)) == 0) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(endbuf2); } while (0); break; } case 'z': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(endbuf); } while (0); break; case 'G': do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(begpos); } while (0); break; case 'x': had_mbchar = 0; c = ruby_scan_hex(p, 2, &numlen); if (numlen == 0) goto invalid_escape; p += numlen; had_num_literal = 1; goto numeric_char; case '0': had_mbchar = 0; c = ruby_scan_oct(p, 2, &numlen); p += numlen; had_num_literal = 1; goto numeric_char; case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': p--; p0 = p; had_mbchar = 0; c1 = 0; do { if (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); while ((1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))) { if (c1 < 0) c1 = 0; c1 = c1 * 10 + c - '0'; if (p == pend) break; do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); } } } while (0); if (!(1 && ((*__ctype_b_loc ())[(int) ((c))] & (unsigned short int) _ISdigit))) p--; if (9 < c1 && c1 >= regnum) { c = ruby_scan_oct(p0, 3, &numlen) & 0xff; p = p0 + numlen; c1 = 0; had_num_literal = 1; goto numeric_char; } laststart = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(duplicate); } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(c1); } while (0); break; case 'M': case 'C': case 'c': p0 = --p; c = read_special(p, pend, &p0); if (c > 255) goto invalid_escape; p = p0; had_num_literal = 1; goto numeric_char; default: c = read_backslash(c); goto normal_char; } break; case '#': if (options & ((1L)<<1)) { while (p != pend) { do {if (p == pend) goto end_of_pattern; c = (unsigned char) *p++; if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; } while (0); if (c == '\n') break; } break; } goto normal_char; case ' ': case '\t': case '\f': case '\r': case '\n': if (options & ((1L)<<1)) break; default: if (c == ']') rb_warn("regexp has `]' without escape"); else if (c == '}') rb_warn("regexp has `}' without escape"); normal_char: had_mbchar = 0; if (re_mbctab[(unsigned char)(c)]) { had_mbchar = 1; c1 = p - pattern; } numeric_char: nextp = p + (re_mbctab[(unsigned char)(c)]+1) - 1; if (!pending_exact || pending_exact + *pending_exact + 1 != b || *pending_exact >= (c1 ? 0176 : 0177) || (nextp < pend && ( *nextp == '+' || *nextp == '?' || *nextp == '*' || *nextp == '^' || *nextp == '{'))) { laststart = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(exactn); } while (0); pending_exact = b; do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0); } while (0); } if (had_num_literal || c == 0xff) { do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(0xff); } while (0); (*pending_exact)++; had_num_literal = 0; } do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(c); } while (0); (*pending_exact)++; if (had_mbchar) { int len = (re_mbctab[(unsigned char)(c)]+1) - 1; while (len--) { do {if (p == pend) goto end_of_pattern; c = (unsigned char)*p++; } while (0); do { do { while (b - bufp->buffer + (1) >= bufp->allocated) do { char *old_buffer = bufp->buffer; if (bufp->allocated == (1L<<16)) goto too_big; bufp->allocated *= 2; if (bufp->allocated > (1L<<16)) bufp->allocated = (1L<<16); bufp->buffer = (char*)ruby_xrealloc(bufp->buffer, bufp->allocated); if (bufp->buffer == 0) goto memory_exhausted; b = (b - old_buffer) + bufp->buffer; if (fixup_alt_jump) fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer; if (laststart) laststart = (laststart - old_buffer) + bufp->buffer; begalt = (begalt - old_buffer) + bufp->buffer; if (pending_exact) pending_exact = (pending_exact - old_buffer) + bufp->buffer; } while (0); } while (0); *b++ = (char)(c); } while (0); (*pending_exact)++; } } } } if (fixup_alt_jump) store_jump(fixup_alt_jump, jump, b); if (stackp != stackb) do { ; if (stackb != stacka) ruby_xfree(stackb); return("unmatched ("); } while(0); laststart = bufp->buffer; if (laststart != b) { if (*laststart == dummy_failure_jump) laststart += 3; else if (*laststart == try_next) laststart += 3; if (*laststart == anychar_repeat) { bufp->options |= (((((((1L)<<1)<<1)<<1)<<1)<<1)<<1); } } bufp->used = b - bufp->buffer; bufp->re_nsub = regnum; laststart = bufp->buffer; if (laststart != b) { if (*laststart == start_memory) laststart += 3; if (*laststart == exactn) { bufp->options |= ((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1); bufp->must = laststart+1; } } if (!bufp->must) { bufp->must = calculate_must_string(bufp->buffer, b); } if (current_mbctype == 2) bufp->options |= (((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1); else if (bufp->must) { int i; int len = (unsigned char)bufp->must[0]; for (i=1; imust[i] == 0xff || (current_mbctype && re_mbctab[(unsigned char)(bufp->must[i])])) { bufp->options |= (((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1); break; } } if (!(bufp->options & (((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1))) { bufp->must_skip = (int *) ruby_xmalloc((1 << 8)*sizeof(int)); bm_init_skip(bufp->must_skip, (unsigned char*)bufp->must+1, (unsigned char)bufp->must[0], (unsigned char*)(((bufp->options&((1L)|((((((1L)<<1)<<1)<<1)<<1)<<1))) && translate)?translate:0)); } } bufp->regstart = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); bufp->regend = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); bufp->old_regstart = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); bufp->old_regend = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); bufp->reg_info = ((ruby_register_info_type*)ruby_xmalloc((regnum)*sizeof(ruby_register_info_type))); bufp->best_regstart = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); bufp->best_regend = ((unsigned char**)ruby_xmalloc((regnum)*sizeof(unsigned char*))); do { ; if (stackb != stacka) ruby_xfree(stackb); return(0); } while(0); invalid_pattern: do { ; if (stackb != stacka) ruby_xfree(stackb); return("invalid regular expression"); } while(0); end_of_pattern: do { ; if (stackb != stacka) ruby_xfree(stackb); return("premature end of regular expression"); } while(0); too_big: do { ; if (stackb != stacka) ruby_xfree(stackb); return("regular expression too big"); } while(0); memory_exhausted: do { ; if (stackb != stacka) ruby_xfree(stackb); return("memory exhausted"); } while(0); nested_meta: do { ; if (stackb != stacka) ruby_xfree(stackb); return("nested *?+ in regexp"); } while(0); invalid_escape: do { ; if (stackb != stacka) ruby_xfree(stackb); return("Invalid escape character syntax"); } while(0); } void ruby_re_free_pattern(bufp) struct re_pattern_buffer *bufp; { ruby_xfree(bufp->buffer); ruby_xfree(bufp->fastmap); if (bufp->must_skip) ruby_xfree(bufp->must_skip); ruby_xfree(bufp->regstart); ruby_xfree(bufp->regend); ruby_xfree(bufp->old_regstart); ruby_xfree(bufp->old_regend); ruby_xfree(bufp->best_regstart); ruby_xfree(bufp->best_regend); ruby_xfree(bufp->reg_info); ruby_xfree(bufp); } static void store_jump(from, opcode, to) char *from, *to; int opcode; { from[0] = (char)opcode; do { (from + 1)[0] = (to - (from + 3)) & 0377; (from + 1)[1] = (to - (from + 3)) >> 8; } while (0); } # 2523 "regex.c" static void insert_jump(op, from, to, current_end) int op; char *from, *to, *current_end; { register char *pfrom = current_end; register char *pto = current_end + 3; while (pfrom != from) *--pto = *--pfrom; store_jump(from, op, to); } # 2545 "regex.c" static void store_jump_n(from, opcode, to, n) char *from, *to; int opcode; unsigned n; { from[0] = (char)opcode; do { (from + 1)[0] = (to - (from + 3)) & 0377; (from + 1)[1] = (to - (from + 3)) >> 8; } while (0); do { (from + 3)[0] = (n) & 0377; (from + 3)[1] = (n) >> 8; } while (0); } # 2565 "regex.c" static void insert_jump_n(op, from, to, current_end, n) int op; char *from, *to, *current_end; unsigned n; { register char *pfrom = current_end; register char *pto = current_end + 5; while (pfrom != from) *--pto = *--pfrom; store_jump_n(from, op, to, n); } # 2586 "regex.c" static void insert_op(op, there, current_end) int op; char *there, *current_end; { register char *pfrom = current_end; register char *pto = current_end + 1; while (pfrom != there) *--pto = *--pfrom; there[0] = (char)op; } # 2607 "regex.c" static void insert_op_2(op, there, current_end, num_1, num_2) int op; char *there, *current_end; int num_1, num_2; { register char *pfrom = current_end; register char *pto = current_end + 5; while (pfrom != there) *--pto = *--pfrom; there[0] = (char)op; do { (there + 1)[0] = (num_1) & 0377; (there + 1)[1] = (num_1) >> 8; } while (0); do { (there + 3)[0] = (num_2) & 0377; (there + 3)[1] = (num_2) >> 8; } while (0); } static int slow_match(little, lend, big, bend, translate) const unsigned char *little, *lend; const unsigned char *big, *bend; const unsigned char *translate; { int c; while (little < lend && big < bend) { c = *little++; if (c == 0xff) c = *little++; if (!(translate?(translate[*big++]==translate[c]):((*big++)==(c)))) break; } if (little == lend) return 1; return 0; } static int slow_search(little, llen, big, blen, translate) const unsigned char *little; int llen; const unsigned char *big; int blen; const char *translate; { const unsigned char *bsave = big; const unsigned char *bend = big + blen; register int c; int fescape = 0; c = *little; if (c == 0xff) { c = little[1]; fescape = 1; } else if (translate && !re_mbctab[(unsigned char)(c)]) { c = translate[c]; } while (big < bend) { if (fescape) { while (big < bend) { if (*big == c) break; big++; } } else if (translate && !re_mbctab[(unsigned char)(c)]) { while (big < bend) { if (re_mbctab[(unsigned char)(*big)]) big+=(re_mbctab[(unsigned char)(*big)]+1)-1; else if (translate[*big] == c) break; big++; } } else { while (big < bend) { if (*big == c) break; if (re_mbctab[(unsigned char)(*big)]) big+=(re_mbctab[(unsigned char)(*big)]+1)-1; big++; } } if (slow_match(little, little+llen, big, bend, translate)) return big - bsave; big+=(re_mbctab[(unsigned char)(*big)]+1); } return -1; } static void bm_init_skip(skip, pat, m, translate) int *skip; unsigned char *pat; int m; const unsigned char *translate; { int j, c; for (c=0; c<256; c++) { skip[c] = m; } if (translate) { for (j=0; j= 0 && translate[big[k]] == translate[little[j]]) { k--; j--; } if (j < 0) return k+1; i += skip[translate[big[i]]]; } return -1; } while (i < blen) { k = i; j = llen-1; while (j >= 0 && big[k] == little[j]) { k--; j--; } if (j < 0) return k+1; i += skip[big[i]]; } return -1; } # 2769 "regex.c" void ruby_re_compile_fastmap(bufp) struct re_pattern_buffer *bufp; { unsigned char *pattern = (unsigned char*)bufp->buffer; int size = bufp->used; register char *fastmap = bufp->fastmap; register unsigned char *p = pattern; register unsigned char *pend = pattern + size; register int j, k; unsigned is_a_succeed_n; unsigned char *stacka[160]; unsigned char **stackb = stacka; unsigned char **stackp = stackb; unsigned char **stacke = stackb + 160; int options = bufp->options; memset(fastmap, 0, (1 << 8)); bufp->fastmap_accurate = 1; bufp->can_be_null = 0; while (p) { is_a_succeed_n = 0; if (p == pend) { bufp->can_be_null = 1; break; } switch ((enum regexpcode)*p++) { case exactn: if (p[1] == 0xff) { if (((options&(1L)) && translate)) fastmap[translate[p[2]]] = 2; else fastmap[p[2]] = 2; bufp->options |= ((((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1); } else if (((options&(1L)) && translate)) fastmap[translate[p[1]]] = 1; else fastmap[p[1]] = 1; break; case begline: case begbuf: case begpos: case endbuf: case endbuf2: case wordbound: case notwordbound: case wordbeg: case wordend: case pop_and_fail: case push_dummy_failure: case start_paren: case stop_paren: continue; case casefold_on: bufp->options |= ((((((1L)<<1)<<1)<<1)<<1)<<1); options |= (1L); continue; case casefold_off: options &= ~(1L); continue; case option_set: options = *p++; continue; case endline: if (((options&(1L)) && translate)) fastmap[translate['\n']] = 1; else fastmap['\n'] = 1; if ((options & ((((1L)<<1)<<1)<<1)) == 0 && bufp->can_be_null == 0) bufp->can_be_null = 2; break; case jump_n: case finalize_jump: case maybe_finalize_jump: case jump: case jump_past_alt: case dummy_failure_jump: case finalize_push: case finalize_push_n: do { do { (j) = *(p) & 0377; (j) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); p += j; if (j > 0) continue; if ((enum regexpcode)*p != on_failure_jump && (enum regexpcode)*p != try_next && (enum regexpcode)*p != succeed_n) continue; p++; do { do { (j) = *(p) & 0377; (j) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); p += j; if (stackp != stackb && *stackp == p) stackp--; continue; case try_next: case start_nowidth: case stop_nowidth: case stop_backtrack: p += 2; continue; case succeed_n: is_a_succeed_n = 1; do { (k) = *(p + 2) & 0377; (k) += ((signed char)(*(char*)((p + 2) + 1))) << 8; } while (0); if (k != 0) { p += 4; continue; } case on_failure_jump: do { do { (j) = *(p) & 0377; (j) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (p + j < pend) { if (stackp == stacke) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } *++stackp = p + j; } else { bufp->can_be_null = 1; } if (is_a_succeed_n) do { do { (k) = *(p) & 0377; (k) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); continue; case set_number_at: p += 4; continue; case start_memory: case stop_memory: p += 2; continue; case duplicate: bufp->can_be_null = 1; if (*p >= bufp->re_nsub) break; fastmap['\n'] = 1; case anychar_repeat: case anychar: for (j = 0; j < (1 << 8); j++) { if (j != '\n' || (options & (((1L)<<1)<<1))) fastmap[j] = 1; } if (bufp->can_be_null) { do { ; if (stackb != stacka) ruby_xfree(stackb); return; } while(0); } if ((enum regexpcode)p[-1] == anychar_repeat) { continue; } break; case wordchar: for (j = 0; j < 0x80; j++) { if (re_syntax_table[j] == 1) fastmap[j] = 1; } switch (current_mbctype) { case 0: for (j = 0x80; j < (1 << 8); j++) { if (re_syntax_table[j] == 2) fastmap[j] = 1; } break; case 1: case 2: case 3: for (j = 0x80; j < (1 << 8); j++) { if (re_mbctab[j]) fastmap[j] = 1; } break; } break; case notwordchar: for (j = 0; j < 0x80; j++) if (re_syntax_table[j] != 1) fastmap[j] = 1; switch (current_mbctype) { case 0: for (j = 0x80; j < (1 << 8); j++) { if (re_syntax_table[j] != 2) fastmap[j] = 1; } break; case 1: case 2: case 3: for (j = 0x80; j < (1 << 8); j++) { if (!re_mbctab[j]) fastmap[j] = 1; } break; } break; case charset: for (j = *p++ * 8 - 1; j >= 0; j--) if (p[j / 8] & (1 << (j % 8))) { int tmp = ((options&(1L)) && translate)?translate[j]:j; fastmap[tmp] = 1; } { unsigned short size; unsigned long c, beg, end; p += p[-1] + 2; size = ((unsigned char)(&p[-2])[0] | (unsigned char)(&p[-2])[1] << 8); for (j = 0; j < (int)size; j++) { c = ((unsigned int)((unsigned char)(&p[j*8])[0] << 24 | (unsigned char)(&p[j*8])[1] << 16 | (unsigned char)(&p[j*8])[2] << 8 | (unsigned char)(&p[j*8])[3])); beg = ((current_mbctype != 3) ? ((c<0x100) ? (c) : (((c)>>8)&0xff)) : utf8_firstbyte(c)); c = ((unsigned int)((unsigned char)(&p[j*8+4])[0] << 24 | (unsigned char)(&p[j*8+4])[1] << 16 | (unsigned char)(&p[j*8+4])[2] << 8 | (unsigned char)(&p[j*8+4])[3])); end = ((current_mbctype != 3) ? ((c<0x100) ? (c) : (((c)>>8)&0xff)) : utf8_firstbyte(c)); while (beg <= end) { if (c < 0x100) { fastmap[beg] = 2; bufp->options |= ((((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1); } else if (re_mbctab[(unsigned char)(beg)]) fastmap[beg] = 1; beg++; } } } break; case charset_not: # 3039 "regex.c" for (j = *p * 8; j < (1 << 8); j++) if (!re_mbctab[(unsigned char)(j)]) fastmap[j] = 1; for (j = *p++ * 8 - 1; j >= 0; j--) if (!(p[j / 8] & (1 << (j % 8)))) { if (!re_mbctab[(unsigned char)(j)]) fastmap[j] = 1; } { unsigned short size; unsigned long c, beg; int num_literal = 0; p += p[-1] + 2; size = ((unsigned char)(&p[-2])[0] | (unsigned char)(&p[-2])[1] << 8); if (size == 0) { for (j = 0x80; j < (1 << 8); j++) if (re_mbctab[(unsigned char)(j)]) fastmap[j] = 1; break; } for (j = 0,c = 0;j < (int)size; j++) { unsigned int cc = ((unsigned int)((unsigned char)(&p[j*8])[0] << 24 | (unsigned char)(&p[j*8])[1] << 16 | (unsigned char)(&p[j*8])[2] << 8 | (unsigned char)(&p[j*8])[3])); beg = ((current_mbctype != 3) ? ((cc<0x100) ? (cc) : (((cc)>>8)&0xff)) : utf8_firstbyte(cc)); while (c <= beg) { if (re_mbctab[(unsigned char)(c)]) fastmap[c] = 1; c++; } cc = ((unsigned int)((unsigned char)(&p[j*8+4])[0] << 24 | (unsigned char)(&p[j*8+4])[1] << 16 | (unsigned char)(&p[j*8+4])[2] << 8 | (unsigned char)(&p[j*8+4])[3])); if (cc < 0xff) { num_literal = 1; while (c <= cc) { if (re_mbctab[(unsigned char)(c)]) fastmap[c] = 1; c++; } } c = ((current_mbctype != 3) ? ((cc<0x100) ? (cc) : (((cc)>>8)&0xff)) : utf8_firstbyte(cc)); } for (j = c; j < (1 << 8); j++) { if (num_literal) fastmap[j] = 1; if (re_mbctab[(unsigned char)(j)]) fastmap[j] = 1; } } break; case unused: break; } if (stackp != stackb) p = *stackp--; else break; } do { ; if (stackb != stacka) ruby_xfree(stackb); return; } while(0); } int ruby_re_adjust_startpos(bufp, string, size, startpos, range) struct re_pattern_buffer *bufp; const char *string; int size, startpos, range; { if (!bufp->fastmap_accurate) { ruby_re_compile_fastmap(bufp); } if (current_mbctype && startpos>0 && !(bufp->options&((((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1))) { int i = (*mbc_startpos_func[current_mbctype])((string), (startpos)); if (i < startpos) { if (range > 0) { startpos = i + (re_mbctab[(unsigned char)(string[i])]+1); } else { int len = (re_mbctab[(unsigned char)(string[i])]+1); if (i + len <= startpos) startpos = i + len; else startpos = i; } } } return startpos; } static int re_match_exec (struct re_pattern_buffer *, const char *, int, int, int, struct re_registers *); # 3155 "regex.c" int ruby_re_search(bufp, string, size, startpos, range, regs) struct re_pattern_buffer *bufp; const char *string; int size, startpos, range; struct re_registers *regs; { register char *fastmap = bufp->fastmap; int val, anchor = 0, initpos = startpos; if (startpos < 0 || startpos > size) return -1; if (fastmap && !bufp->fastmap_accurate) { ruby_re_compile_fastmap(bufp); } if (bufp->used > 0) { switch ((enum regexpcode)bufp->buffer[0]) { case begbuf: begbuf_match: if (range > 0) { if (startpos > 0) return -1; else { val = ruby_re_match(bufp, string, size, 0, regs); if (val >= 0) return 0; return val; } } break; case begline: anchor = 1; break; case begpos: val = ruby_re_match(bufp, string, size, startpos, regs); if (val >= 0) return startpos; return val; default: break; } } if (bufp->options & (((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)) { if (bufp->options&(((1L)<<1)<<1) && range > 0) { goto begbuf_match; } anchor = 1; } if (bufp->must) { int len = ((unsigned char*)bufp->must)[0]; int pos, pbeg, pend; pbeg = startpos; pend = startpos + range; if (pbeg > pend) { pos = pend; pend = pbeg; pbeg = pos; } pend = size; if (bufp->options & (((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1)<<1)) { pos = slow_search(bufp->must+1, len, string+pbeg, pend-pbeg, ((bufp->options&((1L)|((((((1L)<<1)<<1)<<1)<<1)<<1))) && translate)?translate:0); } else { pos = bm_search(bufp->must+1, len, string+pbeg, pend-pbeg, bufp->must_skip, ((bufp->options&((1L)|((((((1L)<<1)<<1)<<1)<<1)<<1))) && translate)?translate:0); } if (pos == -1) return -1; if (range > 0 && (bufp->options & ((((((((1L)<<1)<<1)<<1)<<1)<<1)<<1)<<1))) { startpos += pos; range -= pos; if (range < 0) return -1; } } for (;;) { if (fastmap && startpos < size && bufp->can_be_null != 1 && !(anchor && startpos == 0)) { if (range > 0) { register unsigned char *p, c; int irange = range; p = (unsigned char*)string+startpos; while (range > 0) { c = *p++; if (re_mbctab[(unsigned char)(c)]) { int len; if (fastmap[c]) break; len = (re_mbctab[(unsigned char)(c)]+1) - 1; while (len--) { c = *p++; range--; if (fastmap[c] == 2) goto startpos_adjust; } } else { if (fastmap[((bufp->options&((1L)|((((((1L)<<1)<<1)<<1)<<1)<<1))) && translate) ? translate[c] : c]) break; } range--; } startpos_adjust: startpos += irange - range; } else { register unsigned char c; c = string[startpos]; c &= 0xff; if (((bufp->options&((1L)|((((((1L)<<1)<<1)<<1)<<1)<<1))) && translate) ? !fastmap[translate[c]] : !fastmap[c]) goto advance; } } if (startpos > size) return -1; if ((anchor || !bufp->can_be_null) && range > 0 && size > 0 && startpos == size) return -1; val = re_match_exec(bufp, string, size, startpos, initpos, regs); if (val >= 0) return startpos; if (val == -2) return -2; if (range > 0) { if (anchor && startpos < size && (startpos < 1 || string[startpos-1] != '\n')) { while (range > 0 && string[startpos] != '\n') { range--; startpos++; } } } advance: if (!range) break; else if (range > 0) { const char *d = string + startpos; if (re_mbctab[(unsigned char)(*d)]) { int len = (re_mbctab[(unsigned char)(*d)]+1) - 1; range-=len, startpos+=len; if (!range) break; } range--, startpos++; } else { range++, startpos--; { const char *s, *d, *p; s = string; d = string + startpos; for (p = d; p-- > s && re_mbctab[(unsigned char)(*p)]; ) ; if (!((d - p) & 1)) { if (!range) break; range++, startpos--; } } } } return -1; } # 3479 "regex.c" static void init_regs(regs, num_regs) struct re_registers *regs; unsigned int num_regs; { int i; regs->num_regs = num_regs; if (num_regs < 10) num_regs = 10; if (regs->allocated == 0) { regs->beg = ((int*)ruby_xmalloc((num_regs)*sizeof(int))); regs->end = ((int*)ruby_xmalloc((num_regs)*sizeof(int))); regs->allocated = num_regs; } else if (regs->allocated < num_regs) { (regs->beg=((int*)ruby_xrealloc(regs->beg,(num_regs)*sizeof(int)))); (regs->end=((int*)ruby_xrealloc(regs->end,(num_regs)*sizeof(int)))); regs->allocated = num_regs; } for (i=0; ibeg[i] = regs->end[i] = -1; } } # 3520 "regex.c" int ruby_re_match(bufp, string_arg, size, pos, regs) struct re_pattern_buffer *bufp; const char *string_arg; int size, pos; struct re_registers *regs; { return re_match_exec(bufp, string_arg, size, pos, pos, regs); } static int re_match_exec(bufp, string_arg, size, pos, beg, regs) struct re_pattern_buffer *bufp; const char *string_arg; int size, pos, beg; struct re_registers *regs; { register unsigned char *p = (unsigned char*)bufp->buffer; unsigned char *p1; register unsigned char *pend = p + bufp->used; unsigned num_regs = bufp->re_nsub; unsigned char *string = (unsigned char*)string_arg; register unsigned char *d, *dend; register int mcnt; int options = bufp->options; # 3561 "regex.c" unsigned char **stacka; unsigned char **stackb; unsigned char **stackp; unsigned char **stacke; # 3574 "regex.c" unsigned char **regstart = bufp->regstart; unsigned char **regend = bufp->regend; unsigned char **old_regstart = bufp->old_regstart; unsigned char **old_regend = bufp->old_regend; # 3592 "regex.c" ruby_register_info_type *reg_info = bufp->reg_info; unsigned best_regs_set = 0; unsigned char **best_regstart = bufp->best_regstart; unsigned char **best_regend = bufp->best_regend; int num_failure_counts = 0; if (regs) { init_regs(regs, num_regs); } stacka = ((unsigned char**)__builtin_alloca(((num_regs * 3 + 4) * 160)*sizeof(unsigned char*))); stackb = stacka; stackp = stackb; stacke = &stackb[(num_regs * 3 + 4) * 160]; # 3623 "regex.c" for (mcnt = 0; mcnt < num_regs; mcnt++) { regstart[mcnt] = regend[mcnt] = old_regstart[mcnt] = old_regend[mcnt] = best_regstart[mcnt] = best_regend[mcnt] = ((unsigned char*)-1); ((reg_info[mcnt]).bits.is_active) = 0; ((reg_info[mcnt]).bits.matched_something) = 0; } # 3645 "regex.c" d = string + pos, dend = string + size; for (;;) { if (p == pend) { if ((bufp->options & (((((1L)<<1)<<1)<<1)<<1)) && d != dend) { if (best_regs_set) goto restore_best_regs; while (stackp != stackb && stackp[-1] == ((unsigned char*)1)) { if (best_regs_set) goto restore_best_regs; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); } if (stackp != stackb) { if (! best_regs_set || (d > best_regend[0])) { best_regs_set = 1; best_regend[0] = d; for (mcnt = 1; mcnt < num_regs; mcnt++) { best_regstart[mcnt] = regstart[mcnt]; best_regend[mcnt] = regend[mcnt]; } } goto fail; } else if (best_regs_set) { restore_best_regs: d = best_regend[0]; for (mcnt = 0; mcnt < num_regs; mcnt++) { regstart[mcnt] = best_regstart[mcnt]; regend[mcnt] = best_regend[mcnt]; } } } if (regs) { regs->beg[0] = pos; regs->end[0] = d - string; for (mcnt = 1; mcnt < num_regs; mcnt++) { if (((regend[mcnt]) == ((unsigned char*)-1))) { regs->beg[mcnt] = -1; regs->end[mcnt] = -1; continue; } regs->beg[mcnt] = regstart[mcnt] - string; regs->end[mcnt] = regend[mcnt] - string; } } do { ; if (stackb != stacka) ruby_xfree(stackb); return((d - pos - string)); } while(0); } switch ((enum regexpcode)*p++) { case start_memory: old_regstart[*p] = regstart[*p]; regstart[*p] = d; ((reg_info[*p]).bits.is_active) = 1; ((reg_info[*p]).bits.matched_something) = 0; p += 2; continue; case stop_memory: old_regend[*p] = regend[*p]; regend[*p] = d; ((reg_info[*p]).bits.is_active) = 0; p += 2; continue; case start_paren: case stop_paren: break; case duplicate: { int regno = *p++; register unsigned char *d2, *dend2; if (regno >= num_regs) goto fail; if (((reg_info[regno]).bits.is_active)) goto fail; d2 = regstart[regno]; if (((d2) == ((unsigned char*)-1))) goto fail; dend2 = regend[regno]; if (((dend2) == ((unsigned char*)-1))) goto fail; for (;;) { if (d2 == dend2) break; if (d == dend) goto fail; mcnt = dend - d; if (mcnt > dend2 - d2) mcnt = dend2 - d2; if ((options & (1L)) ? memcmp_translate(d, d2, mcnt) : memcmp((char*)d, (char*)d2, mcnt)) goto fail; d += mcnt, d2 += mcnt; } } break; case start_nowidth: do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = 0; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); if (stackp - stackb > ((1 << 15) - 1)) { do { ; if (stackb != stacka) ruby_xfree(stackb); return((-2)); } while(0); } do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { (p+mcnt)[0] = (stackp - stackb) & 0377; (p+mcnt)[1] = (stackp - stackb) >> 8; } while (0); continue; case stop_nowidth: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); stackp = stackb + mcnt; d = stackp[-3]; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); continue; case stop_backtrack: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); stackp = stackb + mcnt; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); continue; case pop_and_fail: do { (mcnt) = *(p+1) & 0377; (mcnt) += ((signed char)(*(char*)((p+1) + 1))) << 8; } while (0); stackp = stackb + mcnt; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); goto fail; case anychar: if (d == dend) goto fail; if (re_mbctab[(unsigned char)(*d)]) { if (d + (re_mbctab[(unsigned char)(*d)]+1) > dend) goto fail; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); d += (re_mbctab[(unsigned char)(*d)]+1); break; } if (!(options&(((1L)<<1)<<1)) && (((options&(1L)) && translate) ? translate[*d] : *d) == '\n') goto fail; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); d++; break; case anychar_repeat: for (;;) { do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); if (d == dend) goto fail; if (re_mbctab[(unsigned char)(*d)]) { if (d + (re_mbctab[(unsigned char)(*d)]+1) > dend) goto fail; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); d += (re_mbctab[(unsigned char)(*d)]+1); continue; } if (!(options&(((1L)<<1)<<1)) && (((options&(1L)) && translate) ? translate[*d] : *d) == '\n') goto fail; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); d++; } break; case charset: case charset_not: { int not; int part = 0; unsigned char *dsave = d + 1; int cc, c; if (d == dend) goto fail; c = (unsigned char)*d++; if (re_mbctab[(unsigned char)(c)]) { if (d + (re_mbctab[(unsigned char)(c)]+1) - 1 <= dend) { cc = c; do { if (current_mbctype == 3) { int n = (re_mbctab[(unsigned char)(c)]+1) - 1; c &= (1<<(8 -2-n)) - 1; while (n--) { c = c << 6 | (*d++ & ((1<<6)-1)); } } else { c <<= 8; c |= (unsigned char)*(d)++; } } while (0); not = is_in_list_mbc(c, p); if (!not) { part = not = is_in_list_sbc(cc, p); } } else { not = is_in_list(c, p); } } else { if (((options&(1L)) && translate)) c = (unsigned char)translate[c]; not = is_in_list(c, p); } if (*(p - 1) == (unsigned char)charset_not) { not = !not; } if (!not) goto fail; p += 1 + *p + 2 + ((unsigned char)(&p[1 + *p])[0] | (unsigned char)(&p[1 + *p])[1] << 8)*8; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); if (part) d = dsave; break; } case begline: if (size == 0 || ((d) == string)) break; if (d[-1] == '\n' && !((d) == dend)) break; goto fail; case endline: if (((d) == dend)) { break; } else if (*d == '\n') break; goto fail; case begbuf: if (((d) == string)) break; goto fail; case endbuf: if (((d) == dend)) break; goto fail; case endbuf2: if (((d) == dend)) { break; } if (*d == '\n' && ((d+1) == dend)) break; goto fail; # 3951 "regex.c" case begpos: if (d - string == beg) break; goto fail; case on_failure_jump: on_failure: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p + mcnt; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); continue; case maybe_finalize_jump: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); p1 = p; # 3982 "regex.c" while (p1 + 2 < pend) { if ((enum regexpcode)*p1 == stop_memory || (enum regexpcode)*p1 == start_memory) p1 += 3; else if ( (enum regexpcode)*p1 == stop_paren) p1 += 1; else break; } if (p1 == pend) p[-3] = (unsigned char)finalize_jump; else if (*p1 == (unsigned char)exactn || *p1 == (unsigned char)endline) { register int c = *p1 == (unsigned char)endline ? '\n' : p1[2]; register unsigned char *p2 = p + mcnt; if (p2[3] == (unsigned char)exactn && p2[5] != c) p[-3] = (unsigned char)finalize_jump; else if (p2[3] == (unsigned char)charset || p2[3] == (unsigned char)charset_not) { int not; if (re_mbctab[(unsigned char)(c)]) { unsigned char *pp = p1+3; do { if (current_mbctype == 3) { int n = (re_mbctab[(unsigned char)(c)]+1) - 1; c &= (1<<(8 -2-n)) - 1; while (n--) { c = c << 6 | (*pp++ & ((1<<6)-1)); } } else { c <<= 8; c |= (unsigned char)*(pp)++; } } while (0); } not = is_in_list(c, p2 + 4); if (p2[3] == (unsigned char)charset_not) not = !not; if (!not) p[-3] = (unsigned char)finalize_jump; } } p -= 2; if (p[-1] != (unsigned char)finalize_jump) { p[-1] = (unsigned char)jump; goto nofinalize; } # 4033 "regex.c" case finalize_jump: if (stackp > stackb && stackp[-3] == d) { p = stackp[-4]; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); continue; } do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); case jump_past_alt: case jump: nofinalize: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (mcnt < 0 && stackp > stackb && stackp[-3] == d) goto fail; p += mcnt; continue; case dummy_failure_jump: do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = 0; *stackp++ = 0; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); goto nofinalize; case push_dummy_failure: p1 = p; while (p1 + 2 < pend) { if ((enum regexpcode)*p1 == stop_memory || (enum regexpcode)*p1 == start_memory) p1 += 3; else if ( (enum regexpcode)*p1 == stop_paren) p1 += 1; else break; } if (p1 < pend && (enum regexpcode)*p1 == jump) p[-1] = unused; else do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = 0; *stackp++ = 0; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); break; case succeed_n: do { (mcnt) = *(p + 2) & 0377; (mcnt) += ((signed char)(*(char*)((p + 2) + 1))) << 8; } while (0); if (mcnt != 0) { mcnt--; p += 2; do { int c; do { (c) = *(p) & 0377; (c) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); do { if (stacke - stackp <= (2)) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)c; *stackp++ = (p); num_failure_counts++; } while (0); do { do { (p)[0] = (mcnt) & 0377; (p)[1] = (mcnt) >> 8; } while (0); (p) += 2; } while (0); do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = 0; *stackp++ = 0; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); } else { goto on_failure; } continue; case jump_n: do { (mcnt) = *(p + 2) & 0377; (mcnt) += ((signed char)(*(char*)((p + 2) + 1))) << 8; } while (0); if (mcnt) { mcnt--; do { int c; do { (c) = *(p + 2) & 0377; (c) += ((signed char)(*(char*)((p + 2) + 1))) << 8; } while (0); do { if (stacke - stackp <= (2)) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)c; *stackp++ = (p + 2); num_failure_counts++; } while (0); do { (p + 2)[0] = (mcnt) & 0377; (p + 2)[1] = (mcnt) >> 8; } while (0); goto nofinalize; } else p += 4; continue; case set_number_at: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); p1 = p + mcnt; do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { (p1)[0] = (mcnt) & 0377; (p1)[1] = (mcnt) >> 8; } while (0); continue; case try_next: do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (p + mcnt < pend) { do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); stackp[-1] = ((unsigned char*)1); } p += mcnt; continue; case finalize_push: do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); if (mcnt < 0 && stackp > stackb && stackp[-3] == d) goto fail; do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p + mcnt; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); stackp[-1] = ((unsigned char*)1); continue; case finalize_push_n: do { (mcnt) = *(p + 2) & 0377; (mcnt) += ((signed char)(*(char*)((p + 2) + 1))) << 8; } while (0); if (mcnt) { int pos, i; mcnt--; do { (p + 2)[0] = (mcnt) & 0377; (p + 2)[1] = (mcnt) >> 8; } while (0); do { (pos) = *(p) & 0377; (pos) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); do { (i) = *(p+pos+5) & 0377; (i) += ((signed char)(*(char*)((p+pos+5) + 1))) << 8; } while (0); if (i > 0) goto nofinalize; do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); do { do { (mcnt) = *(p) & 0377; (mcnt) += ((signed char)(*(char*)((p) + 1))) << 8; } while (0); (p) += 2; } while (0); do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p + mcnt; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); stackp[-1] = ((unsigned char*)1); p += 2; } else p += 4; continue; case unused: continue; case casefold_on: options |= (1L); continue; case casefold_off: options &= ~(1L); continue; case option_set: options = *p++; continue; case wordbound: if (((d) == string)) { if (((d) == dend)) goto fail; if ((re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) break; else goto fail; } if (((d) == dend)) { if (((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2))))) break; else goto fail; } if (((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2)))) != (re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) break; goto fail; case notwordbound: if (((d) == string)) { if ((re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) goto fail; else break; } if (((d) == dend)) { if (((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2))))) goto fail; else break; } if (((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2)))) != (re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) goto fail; break; case wordbeg: if ((re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2)) && (((d) == string) || !((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2)))))) break; goto fail; case wordend: if (!((d) == string) && ((current_mbctype == 2)? (re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 1 || (current_mbctype ? (re_mbctab[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] && (((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))+(re_mbctab[(unsigned char)(*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1)))]+1))<=dend): re_syntax_table[*((d)-(!(((d)-1) == string)&& re_mbctab[(unsigned char)((d)[-2])]?2:1))] == 2)): ((current_mbctype && ((d)[-1] >= 0x80)) || (re_syntax_table[*((d)-1)] == 1 || (current_mbctype ? (re_mbctab[*((d)-1)] && (((d)-1)+(re_mbctab[(unsigned char)(*((d)-1))]+1))<=dend): re_syntax_table[*((d)-1)] == 2)))) && (!(re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2)) || ((d) == dend))) break; goto fail; case wordchar: if (d == dend) goto fail; if (!(re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) goto fail; if (re_mbctab[(unsigned char)(*d)] && d + (re_mbctab[(unsigned char)(*d)]+1) - 1 < dend) d += (re_mbctab[(unsigned char)(*d)]+1) - 1; d++; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); break; case notwordchar: if (d == dend) goto fail; if ((re_syntax_table[*(d)] == 1 || (current_mbctype ? (re_mbctab[*(d)] && ((d)+(re_mbctab[(unsigned char)(*(d))]+1))<=dend): re_syntax_table[*(d)] == 2))) goto fail; if (re_mbctab[(unsigned char)(*d)] && d + (re_mbctab[(unsigned char)(*d)]+1) - 1 < dend) d += (re_mbctab[(unsigned char)(*d)]+1) - 1; d++; do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); break; case exactn: mcnt = *p++; if (((options&(1L)) && translate)) { do { unsigned char c; if (d == dend) goto fail; if (*p == 0xff) { p++; if (!--mcnt || ((d) == dend) || (unsigned char)*d++ != (unsigned char)*p++) goto fail; continue; } c = *d++; if (re_mbctab[(unsigned char)(c)]) { int n; if (c != (unsigned char)*p++) goto fail; for (n = (re_mbctab[(unsigned char)(c)]+1) - 1; n > 0; n--) if (!--mcnt || ((d) == dend) || (unsigned char)*d++ != (unsigned char)*p++) goto fail; continue; } if ((unsigned char)translate[c] != (unsigned char)translate[*p++]) goto fail; } while (--mcnt); } else { do { if (d == dend) goto fail; if (*p == 0xff) {p++; mcnt--;} if (*d++ != *p++) goto fail; } while (--mcnt); } do { unsigned this_reg; for (this_reg = 0; this_reg < num_regs; this_reg++) { if (((reg_info[this_reg]).bits.is_active)) ((reg_info[this_reg]).bits.matched_something) = 1; else ((reg_info[this_reg]).bits.matched_something) = 0; } } while(0); break; } do { if (!rb_prohibit_interrupt) { if (rb_trap_pending) rb_trap_exec(); }} while (0); continue; fail: if (stackp != stackb) { short last_used_reg, this_reg; if (stackp[-4] == 0 || (best_regs_set && stackp[-1] == ((unsigned char*)1))) { do { long temp; stackp -= 4; temp = (long)*--stackp; temp *= 3; stackp -= temp; temp = (long)*--stackp; while (temp--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } num_failure_counts = 0; } while(0); goto fail; } stackp--; options = (long)*--stackp; d = *--stackp; p = *--stackp; last_used_reg = (long)*--stackp; for (this_reg = num_regs - 1; this_reg > last_used_reg; this_reg--) { regend[this_reg] = ((unsigned char*)-1); regstart[this_reg] = ((unsigned char*)-1); ((reg_info[this_reg]).bits.is_active) = 0; ((reg_info[this_reg]).bits.matched_something) = 0; } for ( ; this_reg > 0; this_reg--) { reg_info[this_reg].word = *--stackp; regend[this_reg] = *--stackp; regstart[this_reg] = *--stackp; } mcnt = (long)*--stackp; while (mcnt--) { do { unsigned char *ptr = *--stackp; int count = (long)*--stackp; do { (ptr)[0] = (count) & 0377; (ptr)[1] = (count) >> 8; } while (0); } while (0); } if (p < pend) { int is_a_jump_n = 0; int failed_paren = 0; p1 = p; switch ((enum regexpcode)*p1) { case jump_n: case finalize_push_n: is_a_jump_n = 1; case maybe_finalize_jump: case finalize_jump: case finalize_push: case jump: p1++; do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((signed char)(*(char*)((p1) + 1))) << 8; } while (0); (p1) += 2; } while (0); if (mcnt >= 0) break; p1 += mcnt; if (( is_a_jump_n && (enum regexpcode)*p1 == succeed_n) || (!is_a_jump_n && (enum regexpcode)*p1 == on_failure_jump)) { if (failed_paren) { p1++; do { do { (mcnt) = *(p1) & 0377; (mcnt) += ((signed char)(*(char*)((p1) + 1))) << 8; } while (0); (p1) += 2; } while (0); do { long last_used_reg, this_reg; for (last_used_reg = num_regs-1; last_used_reg > 0; last_used_reg--) if (!((regstart[last_used_reg]) == ((unsigned char*)-1))) break; do { if (stacke - stackp <= ((last_used_reg * 3 + 4 + 1))) { do { unsigned char* *stackx; unsigned int xlen = stacke - stackb; if (stackb == stacka) { stackx = (unsigned char**)ruby_xmalloc(2 * xlen * sizeof(unsigned char*)); memcpy(stackx, stackb, xlen * sizeof (unsigned char*)); } else { stackx = (unsigned char**)ruby_xrealloc(stackb, 2 * xlen * sizeof(unsigned char*)); } stackp = stackx + (stackp - stackb); stackb = stackx; stacke = stackb + 2 * xlen; } while (0); } } while (0); *stackp++ = (unsigned char*)(long)num_failure_counts; num_failure_counts = 0; for (this_reg = 1; this_reg <= last_used_reg; this_reg++) { *stackp++ = regstart[this_reg]; *stackp++ = regend[this_reg]; *stackp++ = reg_info[this_reg].word; } *stackp++ = (unsigned char*)last_used_reg; *stackp++ = p1 + mcnt; *stackp++ = d; *stackp++ = (unsigned char*)(long)options; *stackp++ = (unsigned char*)0; } while(0); } goto fail; } break; default: ; } } } else break; } if (best_regs_set) goto restore_best_regs; do { ; if (stackb != stacka) ruby_xfree(stackb); return((-1)); } while(0); } static int memcmp_translate(s1, s2, len) unsigned char *s1, *s2; register int len; { register unsigned char *p1 = s1, *p2 = s2, c; while (len) { c = *p1++; if (re_mbctab[(unsigned char)(c)]) { int n; if (c != *p2++) return 1; for (n = (re_mbctab[(unsigned char)(c)]+1) - 1; n > 0; n--) if (!--len || *p1++ != *p2++) return 1; } else if (translate[c] != translate[*p2++]) return 1; len--; } return 0; } void ruby_re_copy_registers(regs1, regs2) struct re_registers *regs1, *regs2; { int i; if (regs1 == regs2) return; if (regs1->allocated == 0) { regs1->beg = ((int*)ruby_xmalloc((regs2->num_regs)*sizeof(int))); regs1->end = ((int*)ruby_xmalloc((regs2->num_regs)*sizeof(int))); regs1->allocated = regs2->num_regs; } else if (regs1->allocated < regs2->num_regs) { (regs1->beg=((int*)ruby_xrealloc(regs1->beg,(regs2->num_regs)*sizeof(int)))); (regs1->end=((int*)ruby_xrealloc(regs1->end,(regs2->num_regs)*sizeof(int)))); regs1->allocated = regs2->num_regs; } for (i=0; inum_regs; i++) { regs1->beg[i] = regs2->beg[i]; regs1->end[i] = regs2->end[i]; } regs1->num_regs = regs2->num_regs; } void ruby_re_free_registers(regs) struct re_registers *regs; { if (regs->allocated == 0) return; if (regs->beg) ruby_xfree(regs->beg); if (regs->end) ruby_xfree(regs->end); } static const unsigned char mbctab_ascii[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; static const unsigned char mbctab_euc[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, }; static const unsigned char mbctab_sjis[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 }; static const unsigned char mbctab_sjis_trail[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0 }; static const unsigned char mbctab_utf8[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 0, 0, }; const unsigned char *re_mbctab = mbctab_ascii; void ruby_re_mbcinit(mbctype) int mbctype; { switch (mbctype) { case 0: re_mbctab = mbctab_ascii; current_mbctype = 0; break; case 1: re_mbctab = mbctab_euc; current_mbctype = 1; break; case 2: re_mbctab = mbctab_sjis; current_mbctype = 2; break; case 3: re_mbctab = mbctab_utf8; current_mbctype = 3; break; } } static unsigned int asc_startpos(string, pos) const char *string; unsigned int pos; { return pos; } static unsigned int euc_startpos(string, pos) const char *string; unsigned int pos; { unsigned int i = pos, w; while (i > 0 && !((unsigned char)((string[i]) - 0xa1) > 0xfe - 0xa1)) { --i; } if (i == pos || i + (w = ((mbctab_euc)[(unsigned char)((string[i]))]+1)) > pos) { return i; } i += w; return i + ((pos - i) & ~1); } static unsigned int sjis_startpos(string, pos) const char *string; unsigned int pos; { unsigned int i = pos, w; if (i > 0 && mbctab_sjis_trail[(unsigned char)(string[i])]) { do { if (!(mbctab_sjis)[(unsigned char)((string[--i]))]) { ++i; break; } } while (i > 0); } if (i == pos || i + (w = ((mbctab_sjis)[(unsigned char)((string[i]))]+1)) > pos) { return i; } i += w; return i + ((pos - i) & ~1); } static unsigned int utf8_startpos(string, pos) const char *string; unsigned int pos; { unsigned int i = pos, w; while (i > 0 && !((unsigned char)((string[i]) & 0xc0) != 0x80)) { --i; } if (i == pos || i + (w = ((mbctab_utf8)[(unsigned char)((string[i]))]+1)) > pos) { return i; } return i + w; }