summaryrefslogtreecommitdiff
path: root/scan.l
diff options
context:
space:
mode:
authorWill Estes <wlestes@users.sourceforge.net>2002-06-19 13:26:43 +0000
committerWill Estes <wlestes@users.sourceforge.net>2002-06-19 13:26:43 +0000
commit5916310e885f01716646b84bd6eecdb9a7d502ae (patch)
tree9bef35b96f2dfc5792ee4b261a0bfc465029b435 /scan.l
parentd9b7016720d0406396beeac6d957c15b72651132 (diff)
address typos in NEWS; add --posix option for ERE parsing the way posix wants it; update the TODO file
Diffstat (limited to 'scan.l')
-rw-r--r--scan.l17
1 files changed, 15 insertions, 2 deletions
diff --git a/scan.l b/scan.l
index e86132f..723704c 100644
--- a/scan.l
+++ b/scan.l
@@ -246,6 +246,7 @@ LEXOPT [aceknopr]
input ACTION_IFDEF("YY_NO_INPUT", ! option_sense);
interactive interactive = option_sense;
lex-compat lex_compat = option_sense;
+ posix-compat posix_compat = option_sense;
main {
action_define( "YY_MAIN", option_sense );
/* Override yywrap */
@@ -362,7 +363,13 @@ LEXOPT [aceknopr]
^{OPTWS}"<" BEGIN(SC); return '<';
^{OPTWS}"^" return '^';
\" BEGIN(QUOTE); return '"';
- "{"/[[:digit:]] BEGIN(NUM); return '{';
+ "{"/[[:digit:]] {
+ BEGIN(NUM);
+ if ( lex_compat || posix_compat )
+ return BEGIN_REPEAT_POSIX;
+ else
+ return BEGIN_REPEAT_FLEX;
+ }
"$"/([[:blank:]]|{NL}) return '$';
{WS}"%{" {
@@ -573,7 +580,13 @@ LEXOPT [aceknopr]
}
"," return ',';
- "}" BEGIN(SECT2); return '}';
+ "}" {
+ BEGIN(SECT2);
+ if ( lex_compat || posix_compat )
+ return END_REPEAT_POSIX;
+ else
+ return END_REPEAT_FLEX;
+ }
. {
synerr( _( "bad character inside {}'s" ) );