From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] scopes in kencc From: "Russ Cox" Date: Thu, 26 Apr 2007 22:04:46 -0400 In-Reply-To: <7871fcf50704261812o6379c087xdfa8b74e6fa4adf2@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20070427020447.C49F71E8C48@holo.morphisms.net> Topicbox-Message-UUID: 5007e4f2-ead2-11e9-9d60-3106f5b1d025 > where is it determined that LNAME is returned when *t is scanned > rather than LTYPE (the way it is returned in the declaration of foo)? grep shows that /sys/src/cmd/cc/lex.c is relevant, since it contains s = lookup(); if(s->macro) { ... } yylval.sym = s; if(s->class == CTYPEDEF || s->class == CTYPESTR) return LTYPE; return s->lexical; for the relevant bit of lexing. you could trace back and see how s->class gets set. russ