Jelajahi Sumber

fcl-passrc: simplified

mattias 1 bulan lalu
induk
melakukan
5c24a474cc

+ 5 - 3
packages/fcl-passrc/src/pasresolver.pp

@@ -12217,7 +12217,8 @@ begin
     end;
     end;
   PopGenericParamScope(El);
   PopGenericParamScope(El);
 
 
-  if El.Name<>'' then begin
+  if El.Name<>'' then
+    begin
     if not (TopScope is TPasIdentifierScope) then
     if not (TopScope is TPasIdentifierScope) then
       RaiseInvalidScopeForElement(20190812215622,El);
       RaiseInvalidScopeForElement(20190812215622,El);
 
 
@@ -12228,7 +12229,8 @@ begin
       Scope:=TPasArrayScope(PushScope(El,ScopeClass_Array));
       Scope:=TPasArrayScope(PushScope(El,ScopeClass_Array));
       AddGenericTemplateIdentifiers(TypeParams,Scope);
       AddGenericTemplateIdentifiers(TypeParams,Scope);
       end;
       end;
-  end else if TypeParams<>nil then
+    end
+  else if TypeParams<>nil then
     RaiseNotYetImplemented(20190812215851,El); // anonymous generic array type
     RaiseNotYetImplemented(20190812215851,El); // anonymous generic array type
 end;
 end;
 
 
@@ -14629,7 +14631,7 @@ begin
         [],'array values',GetTypeDescription(ResolvedEl),El);
         [],'array values',GetTypeDescription(ResolvedEl),El);
     end
     end
   else
   else
-    SetResolverValueExpr(ResolvedEl,btArrayLit,nil,nil,TArrayValues(El),[rrfReadable]);
+    SetResolverValueExpr(ResolvedEl,btArrayLit,nil,nil,El,[rrfReadable]);
 end;
 end;
 
 
 procedure TPasResolver.ComputeRecordValues(El: TRecordValues; out
 procedure TPasResolver.ComputeRecordValues(El: TRecordValues; out

+ 1 - 1
packages/fcl-passrc/src/pparser.pp

@@ -3150,9 +3150,9 @@ begin
     else
     else
       begin
       begin
       NextToken;
       NextToken;
-      // Empty record constant: a: Record .. end = ();
       if (CurToken=tkBraceClose) then
       if (CurToken=tkBraceClose) then
         begin
         begin
+        // Empty record constant: a: Record .. end = ();
         Result:=CreateRecordValues(AParent);
         Result:=CreateRecordValues(AParent);
         NextToken;
         NextToken;
         Exit;
         Exit;