From 21f266c5df70383059d43ad6dd181286b780ef61 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Tue, 5 Apr 2022 19:47:22 -0500 Subject: [PATCH] Require use of digraphs in macro redefinitions to match the original. This is part of the general requirement that macro redefinitions be "identical" as defined in the standard. This affects code like: #define x [ #define x <: --- Scanner.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Scanner.pas b/Scanner.pas index 9a69bd8..4cf05e3 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -2650,7 +2650,12 @@ var goto 3; if tk1^.token.class = tk2^.token.class then case tk1^.token.class of - reservedWord, reservedSymbol: ; + reservedWord: ; + reservedSymbol: + if tk1^.token.isDigraph <> tk2^.token.isDigraph then + if tk1^.token.kind in [lbrackch,rbrackch,lbracech, + rbracech,poundch,poundpoundop] then + goto 3; identifier: if tk1^.token.name^ <> tk2^.token.name^ then goto 3;