From owner-freebsd-current Mon Apr 26 4:50:45 1999 Delivered-To: freebsd-current@freebsd.org Received: from lor.watermarkgroup.com (lor.watermarkgroup.com [207.202.73.33]) by hub.freebsd.org (Postfix) with ESMTP id 15EEB15101 for ; Mon, 26 Apr 1999 04:50:41 -0700 (PDT) (envelope-from luoqi@watermarkgroup.com) Received: (from luoqi@localhost) by lor.watermarkgroup.com (8.8.8/8.8.8) id HAA12979; Mon, 26 Apr 1999 07:49:46 -0400 (EDT) (envelope-from luoqi) Date: Mon, 26 Apr 1999 07:49:46 -0400 (EDT) From: Luoqi Chen Message-Id: <199904261149.HAA12979@lor.watermarkgroup.com> To: chris@calldei.com, peter@netplex.com.au Subject: Re: config & NO_F00F_HACK Cc: A.Leidinger@Wurzelausix.CS.Uni-SB.de, current@FreeBSD.ORG Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > On Sun, Apr 25, 1999, A.Leidinger@Wurzelausix.CS.Uni-SB.de wrote: > > > Hi, > > >=20 > > > # ident LINT > > > LINT: > > > $Id: LINT,v 1.589 1999/04/24 21:45:44 peter Exp $ > > >=20 > > > with: > > > option NO_F00F_HACK > > >=20 > > > # config WORK > > > WORK:15: unknown option "NO_F0F_HACK" > > ^^^^^^^^^^^^^ > > > > You made a typo. > > No, it is a parsing/stringification botch. It's parsed like this: > > ID: NO_F > NUMBER: 00 (octal 0) > ID: F_HACK > > Of course, an atoi of "00" and then a sprintf("%d") results in a single "0". > > I've fixed this here and will commit it shortly, but I'm a bit nervous about > the scope of the change required to prevent this information loss. :-/ I > don't know enough lex/yacc to do context-sensitive tokenization. > This should be fairly simple, please try this, Index: lang.l =================================================================== RCS file: /home/ncvs/src/usr.sbin/config/lang.l,v retrieving revision 1.19 diff -u -r1.19 lang.l --- lang.l 1999/04/24 18:59:19 1.19 +++ lang.l 1999/04/26 11:47:35 @@ -105,11 +105,14 @@ int hex __P((char *)); %} -WORD [-A-Za-z_][-A-Za-z_]* +WORD [A-Za-z_][-A-Za-z_]* +ALNUM [A-Za-z_][-A-Za-z_0-9]* +%s NONUM %% -{WORD} { +{WORD} { int i; + BEGIN(0); if ((i = kw_lookup(yytext)) == -1) { yylval.str = strdup(yytext); @@ -118,6 +121,22 @@ } tprintf("(%s) ", yytext); return i; + } +{WORD} { + int i; + + if ((i = kw_lookup(yytext)) == -1) + REJECT + if (i == CONTROLLER || i == DEVICE || i == DISK || + i == PSEUDO_DEVICE || i == AT || i == ON) + BEGIN(NONUM); + tprintf("(%s) ", yytext); + return i; + } +{ALNUM} { + yylval.str = strdup(yytext); + tprintf("id(%s) ", yytext); + return ID; } \\\"[^"]+\\\" { yytext[strlen(yytext)-2] = '"'; > Cheers, > -Peter > -lq To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message