This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: String constant concatenation in c-lex.c


Zack Weinberg wrote:-

> As Joseph suggested last week: this patch does C's string constant
> concatenation inside lex_string, instead of separately in
> combine_strings.  This allows some minor simplifications elsewhere
> in the compiler.

Yes.  I first mentioned this on the lists sometime between the
charconst parsing unification and when I was dinking around on the
parsers.  I'd originally intended to do this after the charconst
stuff, but the parsers looked more interesting and I got sidetracked.
And then again to a specs replacement.  And now the target stuff :-)

I'm glad you managed to use the lookahead thang in cpplib.  I think
I've remembered why I was unhappy about it - something in cpplib
doesn't use it properly, maybe in handle_directive ().  I think it's
possible for the grab / release strict nesting requirement to not be
observed.  I'll come back to this later - I think it can only happen
on invalid input anyway, so it's not a showstopper.

I think we're still doing to much string copying, but maybe its
unavoidable.  If we move to a proper multibyte implementation (I think
we agreed that UTF8 was to be our execution character set), it should
be possible to simplify the lexer since lookback will become possible
again, at least in the restricted cases we need it, and most multibyte
character translation would then move into the guts of cpplib and out
of c-lex.c.

When your patch goes in, could you update cpplib.html (and the top
line or two which are in the future tense and should now be in the
present tense)?

Also, could you add some kind of test to the testsuite for the ObjC
behaviour?

Thanks,

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]