summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-07-09 17:27:25 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-07-09 17:27:25 +0000
commit4fff5ecd99ef799c3d01672a83b997ebc85e71fb (patch)
tree94a0bc99ba7f523a40fff23bdab0c288a569c70f /main.c
parent2c9a7dd8b7e41214f1a0b0604f9f7e1b1d3b2816 (diff)
Check POSIXLY_CORRECT env variable.
Diffstat (limited to 'main.c')
-rw-r--r--main.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/main.c b/main.c
index 79aa64b..834378a 100644
--- a/main.c
+++ b/main.c
@@ -1401,6 +1401,29 @@ void readin()
if ( syntaxerror )
flexend( 1 );
+ /* If the user explicitly requested posix compatibility by specifing the
+ * posix-compat option, then we check for conflicting options. However, if
+ * the POSIXLY_CORRECT variable is set, then we quietly make flex as
+ * posix-compatible as possible. This is the recommended behavior
+ * according to the GNU Coding Standards.
+ *
+ * Note: The posix option was added to flex to provide the posix behavior
+ * of the repeat operator in regular expressions, e.g., `ab{3}'
+ */
+ if ( posix_compat )
+ {
+ /* TODO: This is where we try to make flex behave according to
+ * posiz, AND check for conflicting options. How far should we go
+ * with this? Should we disable all the neat-o flex features?
+ */
+ }
+
+ if ( getenv("POSIXLY_CORRECT") )
+ {
+ posix_compat = true;
+ /* TODO: See TODO comment above */
+ }
+
if ( backing_up_report )
{
backing_up_file = fopen( backing_name, "w" );