summaryrefslogtreecommitdiff
path: root/regex.h
diff options
context:
space:
mode:
authorYukihiro Matsumoto <matz@ruby-lang.org>1995-03-15 14:59:18 +0900
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-17 22:09:31 +0900
commitd349889e770a2078c247d9d28070e86a54b856f4 (patch)
tree8bdbf87f3ff78ef237c4ff8efa061fbb8dc5a226 /regex.h
parent881c5a9c320c637ee0f6526b40cf70c1379ab656 (diff)
version 0.69v0_69
https://cache.ruby-lang.org/pub/ruby/1.0/ruby-0.69.tar.gz Wed Mar 15 14:59:18 1995 Yukihiro Matsumoto (matz@ix-02) * version 0.69 * eval.c(method_missing): unknownから名称変更. * eval.c(single_method_added): 特異メソッドが定義された時に呼ばれ るメソッド.hookとして使える.実際に定義される直前に呼ばれる. Tue Mar 14 14:46:44 1995 Yukihiro Matsumoto (matz@ix-02) * ruby.c(proc_options): 引数の解析を自分でやることにより引数指定の 方法がperlに近付いた.getopt_longはもう使わない. * dir.c(glob): `{}'のネストを許すようにした. Mon Mar 13 17:56:25 1995 Yukihiro Matsumoto (matz@ix-02) * glob.c: Glob(ワイルドカードオブジェクト)はなくなった.ワイルドカー ドの展開はDir.glob(文字列)を使う.ワイルドカードのマッチは正規表 現で代用. Fri Mar 10 18:35:46 1995 Yukihiro Matsumoto (matz@ix-02) * eval.c: Mathのようなモジュールは自分自身でextendする. * eval.c: クラスやモジュールを定義した既に同名のものがあれば追加定 義となるように.ただし.superクラスの違いなどはチェックする. * regex.c: debug. * math.c: 定数PIとEを定義. Thu Mar 9 21:35:12 1995 Yukihiro Matsumoto (matz@ix-02) * regex.c: EUC,SJISモードでは0x80以上の8進,16進リテラルを禁止. * regex.c: クラス内でも数値リテラル・文字クラスが使えるようした. Wed Mar 8 17:39:05 1995 Yukihiro Matsumoto (matz@ix-02) * regex.c: \200など括弧の数以上の表現は8進リテラルと解釈する.ただ し,\1から\9までは例外. * regex.c: \9以上のリファレンスも有効にした. Tue Mar 7 14:26:01 1995 Yukihiro Matsumoto (matz@ix-02) * eval.c(public/private): スコープ制御メソッドの名称変更.静的なア クセスも出来るようにしてみたが,不採用. Mon Mar 6 19:34:32 1995 Yukihiro Matsumoto (matz@ix-02) * eval.c(inlcude): メソッド化.動的にモジュールをインクルードでき るように.さらに任意のオブジェクトにもモジュールをインクルードで きるメソッド `extend'も用意した. * parse.y: 文法からincludeを削除.メソッド化. Tue Feb 28 15:35:10 1995 Yukihiro Matsumoto (matz@ix-02) * parse.y: 配列,連想配列の最後に`,'をおけるように.
Diffstat (limited to 'regex.h')
-rw-r--r--regex.h52
1 files changed, 31 insertions, 21 deletions
diff --git a/regex.h b/regex.h
index 8481bc8..8162d79 100644
--- a/regex.h
+++ b/regex.h
@@ -38,10 +38,10 @@
/* This defines the various regexp syntaxes. */
-extern long obscure_syntax;
+extern long re_syntax_options;
-/* The following bits are used in the obscure_syntax variable to choose among
+/* The following bits are used in the re_syntax_options variable to choose among
alternative regexp syntaxes. */
/* If this bit is set, plain parentheses serve as grouping, and backslash
@@ -93,6 +93,7 @@ extern long obscure_syntax;
If set, then { and } serve as interval operators and \{ and \} are
literals. */
#define RE_NO_BK_CURLY_BRACES (1L << 8)
+#define RE_NO_BK_BRACES RE_NO_BK_CURLY_BRACES
/* If this bit is set, then character classes are supported; they are:
[:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
@@ -142,6 +143,9 @@ extern long obscure_syntax;
If it isn't, then it can. */
#define RE_NO_HYPHEN_RANGE_END (1L << 18)
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS (1L << 19)
/* Define combinations of bits for the standard possibilities. */
#define RE_SYNTAX_POSIX_AWK (RE_NO_BK_PARENS | RE_NO_BK_VBAR \
@@ -165,15 +169,25 @@ extern long obscure_syntax;
| RE_NO_HYPHEN_RANGE_END)
/* For multi-byte char support */
-#define RE_MBCTYPE_EUC (1L << 19)
-#define RE_MBCTYPE_SJIS (1L << 20)
+#define RE_MBCTYPE_EUC (1L << 20)
+#define RE_MBCTYPE_SJIS (1L << 21)
#define RE_MBCTYPE_MASK (RE_MBCTYPE_EUC | RE_MBCTYPE_SJIS)
+#ifdef EUC
+#define DEFAULT_MBCTYPE RE_MBCTYPE_EUC
+#else
+#ifdef SJIS
+#define DEFAULT_MBCTYPE RE_MBCTYPE_SJIS
+#else
+#define DEFAULT_MBCTYPE 0
+#endif
+#endif
+
#undef ismbchar
#define ismbchar(c) \
- (obscure_syntax & RE_MBCTYPE_EUC \
+ (re_syntax_options & RE_MBCTYPE_EUC \
? ((unsigned char) (c) >= 0x80) \
- : (obscure_syntax & RE_MBCTYPE_SJIS \
+ : (re_syntax_options & RE_MBCTYPE_SJIS \
? (( 0x80 <= (unsigned char) (c) \
&& (unsigned char) (c) <= 0x9f) \
|| (0xe0 <= (unsigned char) (c))) \
@@ -193,6 +207,9 @@ struct re_pattern_buffer
comparing, or zero for no translation.
The translation is applied to a pattern when it is
compiled and to data when it is matched. */
+
+
+ long re_nsub; /* Number of subexpressions found by the compiler. */
char fastmap_accurate;
/* Set to zero when a new pattern is stored,
set to one when the fastmap is updated from it. */
@@ -223,8 +240,10 @@ struct re_pattern_buffer
struct re_registers
{
- int start[RE_NREGS];
- int end[RE_NREGS];
+ unsigned allocated;
+ unsigned num_regs;
+ int *beg;
+ int *end;
};
@@ -236,14 +255,10 @@ extern char *re_compile_pattern (char *, size_t, struct re_pattern_buffer *);
extern void re_compile_fastmap (struct re_pattern_buffer *);
extern int re_search (struct re_pattern_buffer *, char*, int, int, int,
struct re_registers *);
-extern int re_search_2 (struct re_pattern_buffer *, char *, int,
- char *, int, int, int,
- struct re_registers *, int);
extern int re_match (struct re_pattern_buffer *, char *, int, int,
struct re_registers *);
-extern int re_match_2 (struct re_pattern_buffer *, char *, int,
- char *, int, int, struct re_registers *, int);
extern long re_set_syntax (long syntax);
+extern void re_copy_registers (struct re_registers*, struct re_registers*);
#ifndef RUBY
/* 4.2 bsd compatibility. */
@@ -256,15 +271,10 @@ extern int re_exec (char *);
extern char *re_compile_pattern ();
/* Is this really advertised? */
extern void re_compile_fastmap ();
-extern int re_search (), re_search_2 ();
-extern int re_match (), re_match_2 ();
+extern int re_search ();
+extern int re_match ();
extern long re_set_syntax();
-
-#ifndef RUBY
-/* 4.2 bsd compatibility. */
-extern char *re_comp ();
-extern int re_exec ();
-#endif
+extern void re_copy_registers ();
#endif /* __STDC__ */