The thing about C needing newlines at the end of files keeps coming up. I am officially old, so I remember using parser generators that had the same limitation as the original AT&T C compiler, which couldn't handle token streams that ended in a token, but I can't remember if it was a lex or yacc limitation (I think it was lex, and lex would not parse the last token correctly). But I can't find a single reference to support this. So either I'm really old and my memory is failing, or the web is now 100% slop.

Can anyone remember the details of the lex / yacc limitation?

0

If you have a fediverse account, you can quote this note from your own instance. Search https://infosec.exchange/users/david_chisnall/statuses/116040164278449209 on your instance and quote it. (Note that quoting is not supported in Mastodon.)