WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.15k stars 783 forks source link

Case insensitive languages : case-insensitive outside quotes & rems, case-sensitive within #2372

Open meteorquake opened 3 weeks ago

meteorquake commented 3 weeks ago

In languages like VBA the code needs to have optionally available comparison that is case-sensitive within quotes, but case-insensitive outside quotes, and case sensitive for Rems ('). The quote marks are " .... " however it doesn't matter if ' ... ' is also applied for quotes as that doesn't exist except for Rem, and then it can be counted terminated when the line end is reached. This is because the VBA can bulk update everything outside quotes and rems to a different capitalisation, for example in one module or proc you might have a variable sItS and in another you type sIts and it will bulk change the sItS in the unrelated procedure, and various other circumstances. When you then do a compare with code that should be the same but has undergone this transformation, Winmerge will throw up lots of differences. So the comparison outside quote marks needs to be insensitive. Similarly languages like SQL, an option so you can have case sensitive just within quotes which are " ... " and ' ... ' and for REM statements ( e.g. -- ) - back ticks being insensitive. SQL is less of an issue, however I dare say people's SQL can get prettified by manual processes or prittifiers, that might change select to Select or SELECT. Basically, this situation should apply to any case insensitive language. Perhaps it could be called "Case semi-sensitivity"...