David Kastrup wrote:
Incidentally, I noticed that quite a few variables were renamed in LuaTeX as compared to the upstream tex.web (underscores added or removed).
I did that, I did it absolutely on purpose, it helped me catch a few bugs that went unnoticed *because of* tangle's underscore removal, and I do not care at all about the size of diff files.
Stupid question: would some of the following have helped? In particular the -strict option sounds helpful.
No, that would be even worse. ;-) The problem was not identifier conflicts, but I wanted to get rid of automatic renaming of variables. By default, tangle removes underscores (web2c adds a 'z' prefix to a number of variables). Quite a bit of luatex is being written in C (and will become noweb source eventually), and has to interface with lua and the pascal web source at the same time. It was annoying and confusing that, for instance, the web identifier |input_ln| as seen in the pascal web source (a web2c library function) really is defined as |inputln|, without the underscore. Similarly, the pascal array |font_ec| was translated automatically into |fontec|. I now run (lua)tangle with --underline, so that all _ characters are kept, thereby keeping a much closer connection between the pascal web and the generated C code. But it also meant that I had to go through the web and change the web2c and pdftex library function identifiers back to how they should have been coded in the first place: not using underscores at all. Overall, I succeeded fairly well. There are about a dozen identifiers left that I am not happy about, and I have let those slip because I did not want to change the web2c library and tools. For example, fixwrites.c depends on pascal's |write_ln| being renamed to |writeln|. Best wishes, Taco