From 72fc2c255f364507fbc87717cd54b9541f2f5189 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sat, 31 Jul 1999 21:41:50 +0000 Subject: The big lexer fix. svn path=/trunk/; revision=2519 --- rcfile_l.l | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'rcfile_l.l') diff --git a/rcfile_l.l b/rcfile_l.l index e5c4fba9..365c6a05 100644 --- a/rcfile_l.l +++ b/rcfile_l.l @@ -19,8 +19,19 @@ int prc_lineno = 1; %a 4000 %p 3000 +%s NAME + %% +[^=;:, \t\r\n\"\']+ { + char buf[MSGBUFSIZE]; + + escapes(yytext, buf); + yylval.sval = (char *) xstrdup(buf); + BEGIN(0); + return STRING; + } + set { return SET; } logfile { return LOGFILE; } idfile { return IDFILE; } @@ -50,8 +61,8 @@ timeout { return TIMEOUT;} envelope { return ENVELOPE; } qvirtual { return QVIRTUAL; } -user(name)? { return USERNAME; } -pass(word)? { return PASSWORD; } +user(name)? {BEGIN(NAME); return USERNAME; } +pass(word)? {BEGIN(NAME); return PASSWORD; } folder(s)? { return FOLDER; } smtp(host)? { return SMTPHOST; } smtpaddress { return SMTPADDRESS; } @@ -71,12 +82,12 @@ fetchlimit { return FETCHLIMIT; } expunge { return EXPUNGE; } properties { return PROPERTIES; } -is { return IS; } +is { BEGIN(NAME); return IS; } here { return HERE; } there { return THERE; } -to { return TO; } -= { return MAP; } -"*" { return WILDCARD; } +to { BEGIN(NAME); return TO; } += { BEGIN(NAME); return MAP; } +"*" { BEGIN(0); return WILDCARD; } nobouncemail | nouidl | -- cgit v1.2.3