Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site encore.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!teddy!panda!talcott!encore!ptw From: ptw@encore.UUCP (P. Tucker Withington) Newsgroups: net.bugs Subject: lex right context bug ({name}*/&) Message-ID: <133@encore.UUCP> Date: Mon, 7-Jan-85 18:08:27 EST Article-I.D.: encore.133 Posted: Mon Jan 7 18:08:27 1985 Date-Received: Wed, 9-Jan-85 04:51:40 EST Organization: Encore Computer Corp., Wellesley Hills, MA Lines: 20 Index: lex 4.1 8/11/83 (BSD); 1.4 ? (Sys. V) The following fragment appears to raise a bug in lex. When the *-ed expression matches 0 characters (e.g., & is the first input), yytext comes back as "&" rather than "". I am able to work around with a judicious REJECT, but I don't think I should have to. Any opinions or ideas? Am I missing something? name [0-9A-Za-z.\-] %% {name}*/& { if(yytext[0] == '&') printf("Bug!\n"); } o.o --tucker ~