[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Changes to m4/src/main.c,v
From: |
Gary V. Vaughan |
Subject: |
Changes to m4/src/main.c,v |
Date: |
Thu, 13 Jul 2006 23:35:18 +0000 |
CVSROOT: /sources/m4
Module name: m4
Changes by: Gary V. Vaughan <gary> 06/07/13 23:35:16
Index: src/main.c
===================================================================
RCS file: /sources/m4/m4/src/main.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -b -r1.66 -r1.67
--- src/main.c 10 Jul 2006 19:41:00 -0000 1.66
+++ src/main.c 13 Jul 2006 23:35:16 -0000 1.67
@@ -103,7 +103,14 @@
-E, --fatal-warnings stop execution after first warning\n\
-e, --interactive unbuffer output, ignore interrupts\n\
-P, --prefix-builtins force a `m4_' prefix to all builtins\n\
- -Q, --quiet, --silent suppress some warnings for builtins\n"),
+ -Q, --quiet, --silent suppress some warnings for builtins\n\
+ -r, --regexp-syntax=[SPEC] change the default regexp syntax\n"),
+ stdout);
+ fputs (_("\
+\n\
+SPEC is any one of:\n\
+ AWK, BASIC, BSD_M4, ED, EMACS, EXTENDED, GNU_AWK, GNU_EGREP, GNU_M4,\n\
+ GREP, POSIX_AWK, POSIX_EGREP, MINIMAL, MINIMAL_BASIC, SED.\n"),
stdout);
printf (_("\
\n\
@@ -183,6 +190,7 @@
{"nesting-limit", required_argument, NULL, 'L'},
{"prefix-builtins", no_argument, NULL, 'P'},
{"quiet", no_argument, NULL, 'Q'},
+ {"regexp-syntax", required_argument, NULL, 'r'},
{"reload-state", required_argument, NULL, 'R'},
{"silent", no_argument, NULL, 'Q'},
{"synclines", no_argument, NULL, 's'},
@@ -202,7 +210,7 @@
{ 0, 0, 0, 0 },
};
-#define OPTSTRING "B:D:EF:GH:I:L:M:N:PQR:S:T:U:bcd::el:m:o:st:"
+#define OPTSTRING "B:D:EF:GH:I:L:M:N:PQR:S:T:U:bcd::el:m:o:r:st:"
int
main (int argc, char *const *argv, char *const *envp)
@@ -271,6 +279,7 @@
case 'U':
case 't':
case 'm':
+ case 'r':
/* Arguments that cannot be handled until later are accumulated. */
new = xmalloc (sizeof *new);
@@ -432,6 +441,7 @@
{
macro_definition *next;
char *macro_value;
+ char *optarg = defines->macro;
switch (defines->code)
{
@@ -439,27 +449,37 @@
{
m4_symbol_value *value = m4_symbol_value_create ();
- macro_value = strchr (defines->macro, '=');
+ macro_value = strchr (optarg, '=');
if (macro_value == NULL)
macro_value = "";
else
*macro_value++ = '\0';
m4_set_symbol_value_text (value, xstrdup (macro_value));
- m4_symbol_pushdef (M4SYMTAB, defines->macro, value);
+ m4_symbol_pushdef (M4SYMTAB, optarg, value);
}
break;
case 'U':
- m4_symbol_delete (M4SYMTAB, defines->macro);
+ m4_symbol_delete (M4SYMTAB, optarg);
break;
case 't':
- m4_set_symbol_name_traced (M4SYMTAB, defines->macro);
+ m4_set_symbol_name_traced (M4SYMTAB, optarg);
break;
case 'm':
- m4_module_load (context, defines->macro, 0);
+ m4_module_load (context, optarg, 0);
+ break;
+
+ case 'r':
+ m4_set_regexp_syntax_opt (context,
+ m4_regexp_syntax_encode (optarg));
+ if (m4_get_regexp_syntax_opt (context) < 0)
+ {
+ M4ERROR ((EXIT_FAILURE, 0,
+ _("Bad regexp syntax option: `%s'"), optarg));
+ }
break;
default:
- Changes to m4/src/main.c,v, Gary V. Vaughan, 2006/07/10
- Changes to m4/src/main.c,v,
Gary V. Vaughan <=
- Changes to m4/src/main.c,v, Eric Blake, 2006/07/14
- Changes to m4/src/main.c,v, Eric Blake, 2006/07/22
- Changes to m4/src/main.c,v, Eric Blake, 2006/07/27
- Changes to m4/src/main.c,v, Eric Blake, 2006/07/27