Changeset 236 for branches/xpascal/Parsers/ParserPascal.pas
- Timestamp:
- Jun 29, 2023, 1:47:58 AM (17 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/xpascal/Parsers/ParserPascal.pas
r235 r236 372 372 if Assigned(TypeRef) then begin 373 373 Func.ResultType := TypeRef; 374 Variable := TVariable.Create;375 Variable.Name := 'Result';376 Variable.TypeRef := TypeRef;377 Variable.Internal := True;378 Func.Block.Variables.Add(Variable);379 374 end else Error('Type ' + Token.Text + ' not found'); 380 375 end; 381 376 end; 382 377 Tokenizer.Expect(';', tkSpecialSymbol); 378 Func.InitVariables; 383 379 if ParseBlock(Block, NewBlock, Func.Block) then begin 384 380 Tokenizer.Expect(';', tkSpecialSymbol); … … 405 401 end; 406 402 Tokenizer.Expect(')', tkSpecialSymbol); 407 for I := 0 to Params.Count - 1 do begin408 Variable := TVariable.Create;409 Variable.Name := Params[I].Name;410 Variable.TypeRef := Params[I].TypeRef;411 Variable.Internal := True;412 Block.Variables.Add(Variable);413 end;414 403 Result := True; 415 404 end; … … 463 452 Proc.Params := FunctionParameters; 464 453 end; 465 466 454 Tokenizer.Expect(';', tkSpecialSymbol); 455 Proc.InitVariables; 467 456 if ParseBlock(Block, NewBlock, Proc.Block) then begin 468 457 Tokenizer.Expect(';', tkSpecialSymbol);
Note:
See TracChangeset
for help on using the changeset viewer.