From c2f89ac5e7eabb474e3cf08ae3c3cb0598ef6f23 Mon Sep 17 00:00:00 2001 From: Kyle Johnson Date: Fri, 1 May 2020 12:13:14 -0500 Subject: [PATCH] Changing the for-in loop variable expectation Changing from QualifiedIdentifier to Variable allows the for-in loop to have this syntax: for TSomeType(VarName) in Collection do So then the VarName can be of a different type than the Collection item type and be typecast to match the item type. The above syntax compiles in Delphi. --- Source/SimpleParser/SimpleParser.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/SimpleParser/SimpleParser.pas b/Source/SimpleParser/SimpleParser.pas index 52fc99dd..79ceb865 100644 --- a/Source/SimpleParser/SimpleParser.pas +++ b/Source/SimpleParser/SimpleParser.pas @@ -2203,7 +2203,7 @@ procedure TmwSimplePasPar.ForStatement; InlineVarDeclaration; end else - QualifiedIdentifier; + Variable; if Lexer.TokenID = ptAssign then begin