Ignore:
Timestamp:
Jun 26, 2023, 12:08:45 PM (17 months ago)
Author:
chronos
Message:
  • Added: Var function parameters support.
  • Added: Read and ReadLn procedures support.
  • Added: Interpreter now prints into console form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/xpascal/Parsers/ParserPascal.pas

    r224 r230  
    347347  Token: TToken;
    348348  TypeRef: TType;
     349  ParamKind: TFunctionParamKind;
    349350begin
    350351  Result := True;
     352  if Tokenizer.CheckNext('var', tkKeyword) then begin
     353    Tokenizer.GetNext;
     354    ParamKind := pkVar;
     355  end;
    351356  Token := Tokenizer.GetNext;
    352357  if Token.Kind = tkIdentifier then begin
    353358    Parameter := TFunctionParameter.Create;
     359    Parameter.Kind := ParamKind;
    354360    Parameter.Name := Token.Text;
    355361    Tokenizer.Expect(':', tkSpecialSymbol);
Note: See TracChangeset for help on using the changeset viewer.