From 29be774b38c7cdf41758092ecdfa27b591063f1d Mon Sep 17 00:00:00 2001 From: Partouf Date: Thu, 8 Oct 2026 18:14:28 +0200 Subject: [PATCH] Test asm statement separators with CharInSet TPasSyntaxTreeBuilder.AsmStatement decides whether to put a space between the parts of an asm statement with `c in [...]` on a Char. Since Delphi 2009 Char is a WideChar, so both tests draw W1050 (WideChar reduced to byte char in set expressions). Every character in the two sets is ASCII, so CharInSet gives the same answer and the warning goes away. FPC's SysUtils has CharInSet as well. Co-Authored-By: Claude Opus 5.5 --- Source/DelphiAST.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/DelphiAST.pas b/Source/DelphiAST.pas index 0b79f42..5cb3b4e 100644 --- a/Source/DelphiAST.pas +++ b/Source/DelphiAST.pas @@ -588,7 +588,7 @@ procedure TPasSyntaxTreeBuilder.AsmStatement; Previous:= ' '; for Child in Node.ChildNodes do begin //Store the whole statement as well as the parts. - if (ValuedChild.Value[1] in [',', '+', '*', ']', ')', ' ','-',':']) or (Previous in ['(','[',',','+','*','-','@']) then Optional:= ''; + if CharInSet(ValuedChild.Value[1], [',', '+', '*', ']', ')', ' ','-',':']) or CharInSet(Previous,['(','[',',','+','*','-','@']) then Optional:= ''; Previous:= ValuedChild.Value[1]; ValuedNode.Value:= ValuedNode.Value + Optional + ValuedChild.Value; Optional:= ' ';