diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-10-13 22:56:46 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-10-13 22:56:46 +0000 |
commit | cec47d40825fbc95f9527c098fca806976e57d39 (patch) | |
tree | 2d476b13dd5c363211b0d7254e992f26b0e3f411 | |
parent | 1d2086dae4fd91eace41352c393e9fc613c0e2b1 (diff) | |
download | fetchmail-cec47d40825fbc95f9527c098fca806976e57d39.tar.gz fetchmail-cec47d40825fbc95f9527c098fca806976e57d39.tar.bz2 fetchmail-cec47d40825fbc95f9527c098fca806976e57d39.zip |
Introduce a notion of numeric token.
svn path=/trunk/; revision=327
-rw-r--r-- | rcfile_l.l | 2 | ||||
-rw-r--r-- | rcfile_y.y | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -67,6 +67,8 @@ options {/* EMPTY */} (#.*)?\\?\n { prc_lineno++; } /* newline is ignored */ +[0-9]+ { yylval.number = atoi(yytext); return NUMBER; } + \"[^\"]*\" { yytext[strlen(yytext)-1] = '\0'; yylval.sval = (char *) strdup(yytext+1); @@ -32,6 +32,7 @@ static int prc_errflag; %union { int proto; int flag; + int number; char *sval; } @@ -39,6 +40,7 @@ static int prc_errflag; %token USERNAME PASSWORD FOLDER SMTPHOST MDA IS HERE THERE %token <proto> PROTO %token <sval> STRING +%token <number> NUMBER %token <flag> KEEP FLUSH FETCHALL REWRITE PORT SKIP /* these are actually used by the lexer */ @@ -74,11 +76,11 @@ serv_option : PROTOCOL PROTO {current.protocol = $2;} current.authenticate = A_KERBEROS; current.port = KPOP_PORT; } - | PORT STRING {current.port = atoi($2);} + | PORT NUMBER {current.port = $2;} | SKIP {current.skip = ($1==FLAG_TRUE);} | AUTHENTICATE PASSWORD {current.authenticate = A_PASSWORD;} | AUTHENTICATE KERBEROS {current.authenticate = A_KERBEROS;} - | TIMEOUT STRING {current.timeout = atoi($2);} + | TIMEOUT NUMBER {current.timeout = $2;} ; /* the first and only the first user spec may omit the USERNAME part */ |