On 10/16/2013 04:40 PM, Sergio Durigan Junior wrote: > I had a brief chat with Keith, who updated me on this. According to > him, there are many more places that need to be updated. He's already > talking to Pierre about this, so probably my patch is not > complete/correct. Thus, feel free to drop it if it is the case. Yeah, my apologies. I *thought* I had a pascal compiler installed, but I didn't. [Maybe I was thinking of Fortran?] In any case, my previous patch to pascal_lex does some really nasty things, like assigning to lexptr/stoken from an alloca'd block. Boo! This patch fixes the regressions by doing what I should have done the first time around: it changes pascal_lex to really take const input. There are two little sections of code, though, which violate const-ness of the input, and I've removed those, since they don't seem necessary. [This is the two loops that deal with changing the case of `tokstart' -- which can easily be removed because we already have a temporary buffer that is used for this.] I could not think of any reasons why pascal_lex would need to change the input. The only thing that came to mind was completion, and the behavior for that is, as far as I can tell, identical to how 7.0, 7.3, 7.4, 7.5, and 7.6 behave. [both case-sensitive 'on' and 'off'] [Perhaps Pierre knows? It was added here: commit 458d424149528912ee72f6b9b9a2afd578a17715 Author: Pierre Muller Date: Fri Nov 9 09:46:40 2001 +0000 2001-11-06 Pierre Muller * p-exp.y (yylex): Only change case of expression if symbol is found. Also check for GPC standard name form. ] In any case, IMO parsers should not be changing their input. If this turns out to be necessary, we should extend the API to support it. Comments? Keith ChangeLog 2013-10-17 Keith Seitz * p-exp.y (uptok): Make first parameter const. (yylex): Make `tokstart' and `tokptr' const. Don't copy the lexer input to a temporary buffer. Make `p' const. Remove const workaround ofr parse_escape. Create a temporary buffer for a convenience variable instead of doing in-place modification of the input. If a match is found with a different case from the input, do not change the input at all. Use `tmp' to construct the resultant stoken instead of `tokstart'.