From 29590c7965c59fdb6278b3451d03bcd623a727d0 Mon Sep 17 00:00:00 2001 From: Peter Dell Date: Sun, 23 Feb 2025 16:07:20 +0100 Subject: [PATCH 1/2] Turn variant records into regular records Variant records are not really required and cannot be translated into Java/Javascript --- src/Common.pas | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Common.pas b/src/Common.pas index c18f6d6a4..15673fb24 100644 --- a/src/Common.pas +++ b/src/Common.pas @@ -409,16 +409,16 @@ TType = record TToken = record UnitIndex, Column: Smallint; Line: Integer; - case Kind: Byte of - IDENTTOK: - (Name: ^TString); - INTNUMBERTOK: - (Value: Int64); - FRACNUMBERTOK: - (FracValue: Single); - STRINGLITERALTOK: - (StrAddress: Word; - StrLength: Word); + Kind: Byte; + // For IDENTTOK: + Name: ^TString; + // For INTNUMBERTOK: + Value: Int64; + // For FRACNUMBERTOK: + FracValue: Single; + // For STRINGLITERALTOK: + StrAddress: Word; + StrLength: Word; end; TIdentifier = record @@ -448,9 +448,9 @@ TIdentifier = record isInitialized, Section: Boolean; - case Kind: Byte of - PROCEDURETOK, FUNCTIONTOK: - (NumParams: Word; + Kind: Byte; + // For PROCEDURETOK, FUNCTIONTOK: + NumParams: Word; Param: TParamList; ProcAsBlock: Integer; ObjectIndex: Integer; @@ -469,11 +469,11 @@ TIdentifier = record isKeep, isVolatile, isStriped, - IsNotDead: Boolean;); + IsNotDead: Boolean; - VARIABLE, USERTYPE: - (NumAllocElements, NumAllocElements_: Cardinal; - AllocElementType: Byte); + // For VARIABLE, USERTYPE: + NumAllocElements, NumAllocElements_: Cardinal; + AllocElementType: Byte; end; From b71c9c700679cb1f70ca2fb5a14633dd589db646 Mon Sep 17 00:00:00 2001 From: Peter Dell Date: Sun, 23 Feb 2025 16:11:53 +0100 Subject: [PATCH 2/2] Replace Name: ^TString with Name:TString The reference is not used as reference but always as value throughout the whole code. Value assignment make memory management easier for the compiler and allow targets which do not support references to elementary types, e.g. Javascript --- src/Common.pas | 8 +- src/Diagnostic.pas | 2 +- src/Messages.pas | 2 +- src/Parser.pas | 64 +++---- src/Scanner.pas | 10 +- src/include/compile_string.inc | 2 +- src/include/for_in_ident.inc | 2 +- src/mp.pas | 308 ++++++++++++++++----------------- 8 files changed, 196 insertions(+), 202 deletions(-) diff --git a/src/Common.pas b/src/Common.pas index 15673fb24..ec22c2406 100644 --- a/src/Common.pas +++ b/src/Common.pas @@ -411,7 +411,7 @@ TToken = record Line: Integer; Kind: Byte; // For IDENTTOK: - Name: ^TString; + Name: TString; // For INTNUMBERTOK: Value: Int64; // For FRACNUMBERTOK: @@ -905,12 +905,8 @@ function Min(a,b: integer): integer; procedure FreeTokens; -var i: Integer; begin - for i := 1 to NumTok do - if (Tok[i].Kind = IDENTTOK) and (Tok[i].Name <> nil) then Dispose(Tok[i].Name); - SetLength(Tok, 0); SetLength(IFTmpPosStack, 0); SetLength(UnitPath, 0); @@ -963,7 +959,7 @@ function ErrTokenFound(ErrTokenIndex: Integer): string; procedure CheckOperator(ErrTokenIndex: Integer; op: Byte; DataType: Byte; RightType: Byte = 0); begin -//writeln(tok[ErrTokenIndex].Name^,',', op,',',DataType); +//writeln(tok[ErrTokenIndex].Name,',', op,',',DataType); if {(not (DataType in (OrdinalTypes + [REALTOK, POINTERTOK]))) or} ((DataType in RealTypes) and diff --git a/src/Diagnostic.pas b/src/Diagnostic.pas index 1f6d770e5..87ac6130c 100644 --- a/src/Diagnostic.pas +++ b/src/Diagnostic.pas @@ -39,7 +39,7 @@ procedure Diagnostics; else if Tok[i].Kind = FRACNUMBERTOK then WriteLn(DiagFile, ' = ', Tok[i].FracValue: 8: 4) else if Tok[i].Kind = IDENTTOK then - WriteLn(DiagFile, ' = ', Tok[i].Name^) + WriteLn(DiagFile, ' = ', Tok[i].Name) else if Tok[i].Kind = CHARLITERALTOK then WriteLn(DiagFile, ' = ', Chr(Tok[i].Value)) else if Tok[i].Kind = STRINGLITERALTOK then diff --git a/src/Messages.pas b/src/Messages.pas index 2a7a496d9..573da75bc 100644 --- a/src/Messages.pas +++ b/src/Messages.pas @@ -79,7 +79,7 @@ function ErrorMessage(ErrTokenIndex: Integer; err: ErrorCode; IdentIndex: Intege UnknownIdentifier: if IdentIndex > 0 then Result := 'Identifier not found ''' + Ident[IdentIndex].Alias + '''' else - Result := 'Identifier not found ''' + Tok[ErrTokenIndex].Name^ + ''''; + Result := 'Identifier not found ''' + Tok[ErrTokenIndex].Name + ''''; IncompatibleTypeOf: Result := 'Incompatible type of ' + Ident[IdentIndex].Name; IncompatibleEnum: if DstType < 0 then diff --git a/src/Parser.pas b/src/Parser.pas index cf72846d8..c5bda927a 100644 --- a/src/Parser.pas +++ b/src/Parser.pas @@ -483,7 +483,7 @@ function GetSizeof(i: integer; ValType: byte): Int64; var IdentIndex: integer; begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); case ValType of @@ -618,7 +618,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B end; if ConstValType in Pointers then begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if Ident[IdentIndex].AllocElementType in [RECORDTOK, OBJECTTOK] then ConstVal := Ident[IdentIndex].NumAllocElements_ - 1 @@ -647,7 +647,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B if Tok[i + 2].Kind = IDENTTOK then begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -955,7 +955,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B IDENTTOK: begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if IdentIndex > 0 then @@ -971,13 +971,13 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B iError(i, TypeMismatch); - if (Ident[GetIdent(Tok[i].Name^)].DataType in RealTypes) and (ConstValType in RealTypes) then begin + if (Ident[GetIdent(Tok[i].Name)].DataType in RealTypes) and (ConstValType in RealTypes) then begin // ok end else - if Ident[GetIdent(Tok[i].Name^)].DataType in Pointers then - Error(j, 'Illegal type conversion: "'+InfoAboutToken(ConstValType)+'" to "'+Tok[i].Name^+'"'); + if Ident[GetIdent(Tok[i].Name)].DataType in Pointers then + Error(j, 'Illegal type conversion: "'+InfoAboutToken(ConstValType)+'" to "'+Tok[i].Name+'"'); - ConstValType := Ident[GetIdent(Tok[i].Name^)].DataType; + ConstValType := Ident[GetIdent(Tok[i].Name)].DataType; CheckTok(j + 1, CPARTOK); @@ -1058,7 +1058,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B if Tok[i + 1].Kind <> IDENTTOK then iError(i + 1, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); if IdentIndex > 0 then begin @@ -1268,7 +1268,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B CheckTok(i + 1, OPARTOK); - if (Tok[i + 2].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i + 2].Name^)].Kind = FUNCTIONTOK) then + if (Tok[i + 2].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i + 2].Name)].Kind = FUNCTIONTOK) then isError := TRUE else j := CompileConstExpression(i + 2, ConstVal, ConstValType); @@ -1279,7 +1279,7 @@ function CompileConstFactor(i: Integer; out ConstVal: Int64; out ConstValType: B if (ConstValType in Pointers) and (Tok[i + 2].Kind = IDENTTOK) and (Tok[i + 3].Kind <> OBRACKETTOK) then begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if (Ident[IdentIndex].DataType in Pointers) and ( (Ident[IdentIndex].NumAllocElements > 0) and (Ident[IdentIndex].AllocElementType <> RECORDTOK) ) then if ((Ident[IdentIndex].AllocElementType <> UNTYPETOK) and (Ident[IdentIndex].NumAllocElements in [0,1])) or (Ident[IdentIndex].DataType = STRINGPOINTERTOK) then begin @@ -1843,11 +1843,11 @@ function DeclareFunction(i: integer; out ProcVarIndex: cardinal): integer; begin for x := 1 to NumVarOfSameType do - if VarOfSameType[x].Name = Tok[i + 1].Name^ then - Error(i + 1, 'Identifier ' + Tok[i + 1].Name^ + ' is already defined'); + if VarOfSameType[x].Name = Tok[i + 1].Name then + Error(i + 1, 'Identifier ' + Tok[i + 1].Name + ' is already defined'); Inc(NumVarOfSameType); - VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name^; + VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name; end; i := i + 2; @@ -1957,12 +1957,12 @@ function DefineFunction(i, ForwardIdentIndex: integer; out isForward, isInt, isI if Tok[i].Kind in [PROCEDURETOK, CONSTRUCTORTOK, DESTRUCTORTOK] then begin - DefineIdent(i + 1, Tok[i + 1].Name^, Tok[i].Kind, 0, 0, 0, 0); + DefineIdent(i + 1, Tok[i + 1].Name, Tok[i].Kind, 0, 0, 0, 0); IsNestedFunction := FALSE; end else begin - DefineIdent(i + 1, Tok[i + 1].Name^, FUNCTIONTOK, 0, 0, 0, 0); + DefineIdent(i + 1, Tok[i + 1].Name, FUNCTIONTOK, 0, 0, 0, 0); IsNestedFunction := TRUE; end; @@ -1998,11 +1998,11 @@ function DefineFunction(i, ForwardIdentIndex: integer; out isForward, isInt, isI begin for x := 1 to NumVarOfSameType do - if VarOfSameType[x].Name = Tok[i + 1].Name^ then - Error(i + 1, 'Identifier ' + Tok[i + 1].Name^ + ' is already defined'); + if VarOfSameType[x].Name = Tok[i + 1].Name then + Error(i + 1, 'Identifier ' + Tok[i + 1].Name + ' is already defined'); Inc(NumVarOfSameType); - VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name^; + VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name; end; i := i + 2; @@ -2180,7 +2180,7 @@ function DefineFunction(i, ForwardIdentIndex: integer; out isForward, isInt, isI if Tok[i + 1].Kind = IDENTTOK then begin - Ident[NumIdent].Alias := Tok[i + 1].Name^; + Ident[NumIdent].Alias := Tok[i + 1].Name; if Tok[i + 2].Kind = STRINGLITERALTOK then begin Ident[NumIdent].Libraries := i + 2; @@ -2364,7 +2364,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi end else if Tok[i + 1].Kind = IDENTTOK then begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); if IdentIndex = 0 then begin @@ -2430,7 +2430,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi if Tok[i].Kind = OPARTOK then begin // enumerated - Name := Tok[i-2].Name^; + Name := Tok[i-2].Name; inc(NumTypes); RecType := NumTypes; @@ -2452,7 +2452,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi CheckTok(i, IDENTTOK); Inc(NumFieldsInList); - FieldInListName[NumFieldsInList].Name := Tok[i].Name^; + FieldInListName[NumFieldsInList].Name := Tok[i].Name; inc(i); @@ -2578,7 +2578,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi if Tok[i].Kind = OBJECTTOK then // Object begin - Name := Tok[i-2].Name^; + Name := Tok[i-2].Name; inc(NumTypes); RecType := NumTypes; @@ -2607,7 +2607,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi Ident[NumIdent].IsUnresolvedForward := TRUE; Ident[NumIdent].ObjectIndex := RecType; - Ident[NumIdent].Name := Name + '.' + Tok[k + 1].Name^; + Ident[NumIdent].Name := Name + '.' + Tok[k + 1].Name; CheckTok(i, SEMICOLONTOK); @@ -2630,7 +2630,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi CheckTok(i, IDENTTOK); Inc(NumFieldsInList); - FieldInListName[NumFieldsInList].Name := Tok[i].Name^; + FieldInListName[NumFieldsInList].Name := Tok[i].Name; inc(i); @@ -2697,7 +2697,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi Ident[NumIdent].IsUnresolvedForward := TRUE; Ident[NumIdent].ObjectIndex := RecType; - Ident[NumIdent].Name := Name + '.' + Tok[k + 1].Name^; + Ident[NumIdent].Name := Name + '.' + Tok[k + 1].Name; CheckTok(i, SEMICOLONTOK); @@ -2729,7 +2729,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi if (Tok[i].Kind = RECORDTOK) or ((Tok[i].Kind = PACKEDTOK) and (Tok[i+1].Kind = RECORDTOK)) then // Record begin - Name := Tok[i-2].Name^; + Name := Tok[i-2].Name; if Tok[i].Kind = PACKEDTOK then inc(i); @@ -2751,7 +2751,7 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi CheckTok(i, IDENTTOK); Inc(NumFieldsInList); - FieldInListName[NumFieldsInList].Name := Tok[i].Name^; + FieldInListName[NumFieldsInList].Name := Tok[i].Name; inc(i); @@ -3042,15 +3042,15 @@ function CompileType(i: Integer; out DataType: Byte; out NumAllocElements: cardi // USERTYPE // ----------------------------------------------------------------------------- - if (Tok[i].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i].Name^)].Kind = USERTYPE) then + if (Tok[i].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i].Name)].Kind = USERTYPE) then begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if IdentIndex = 0 then iError(i, UnknownIdentifier); if Ident[IdentIndex].Kind <> USERTYPE then - Error(i, 'Type expected but ' + Tok[i].Name^ + ' found'); + Error(i, 'Type expected but ' + Tok[i].Name + ' found'); DataType := Ident[IdentIndex].DataType; NumAllocElements := Ident[IdentIndex].NumAllocElements or (Ident[IdentIndex].NumAllocElements_ shl 16); diff --git a/src/Scanner.pas b/src/Scanner.pas index c6efc2a2e..21b7922e4 100644 --- a/src/Scanner.pas +++ b/src/Scanner.pas @@ -441,12 +441,12 @@ procedure TokenizeProgram(UsesOn: Boolean = true); CheckTok(i, IDENTTOK); - nam := FindFile(Tok[i].Name^ + '.pas', 'unit'); + nam := FindFile(Tok[i].Name + '.pas', 'unit'); end; - s:=AnsiUpperCase(Tok[i].Name^); + s:=AnsiUpperCase(Tok[i].Name); for j := 2 to NumUnits do // kasujemy wczesniejsze odwolania @@ -1498,8 +1498,7 @@ procedure TokenizeProgram(UsesOn: Boolean = true); end else begin // Identifier found Tok[NumTok].Kind := IDENTTOK; - New(Tok[NumTok].Name); - Tok[NumTok].Name^ := Text; + Tok[NumTok].Name := Text; end; end; @@ -2199,8 +2198,7 @@ procedure TokenizeMacro(a: string; Line, Spaces: integer); end else begin // Identifier found Tok[NumTok].Kind := IDENTTOK; - New(Tok[NumTok].Name); - Tok[NumTok].Name^ := Text; + Tok[NumTok].Name := Text; end; end; diff --git a/src/include/compile_string.inc b/src/include/compile_string.inc index bdd37eb76..8e5aa2e01 100644 --- a/src/include/compile_string.inc +++ b/src/include/compile_string.inc @@ -190,7 +190,7 @@ if Tok[i+3].Kind = DEREFERENCETOK then begin - asm65(#9'mwy ' + GetLocalName(GetIdent(Tok[i + 2].Name^)) + ' :bp2'); + asm65(#9'mwy ' + GetLocalName(GetIdent(Tok[i + 2].Name)) + ' :bp2'); asm65(#9'ldy #$00'); asm65(#9'lda (:bp2),y'); asm65(#9'sta @move.src'); diff --git a/src/include/for_in_ident.inc b/src/include/for_in_ident.inc index c7851ac30..397541d59 100644 --- a/src/include/for_in_ident.inc +++ b/src/include/for_in_ident.inc @@ -6,7 +6,7 @@ if Tok[j].Kind <> IDENTTOK then iError(j, IdentifierExpected); - IdentTemp := GetIdent(Tok[j].Name^); + IdentTemp := GetIdent(Tok[j].Name); ActualParamType := Ident[IdentTemp].DataType; VarType := Ident[IdentTemp].AllocElementType; diff --git a/src/mp.pas b/src/mp.pas index 40368d26f..6c4009b1f 100644 --- a/src/mp.pas +++ b/src/mp.pas @@ -6197,7 +6197,7 @@ function CompileAddress(i: integer; out ValType, AllocElementType: Byte; VarPass iError(i + 1, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); if IdentIndex > 0 then @@ -6336,14 +6336,14 @@ function CompileAddress(i: integer; out ValType, AllocElementType: Byte; VarPass // DEREFERENCE := true; CheckTok(i + 4, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 4].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 4].Name); if IdentTemp < 0 then - Error(i + 4, 'identifier idents no member '''+Tok[i + 4].Name^+''''); + Error(i + 4, 'identifier idents no member '''+Tok[i + 4].Name+''''); AllocElementType := IdentTemp shr 16; - IdentTemp:=GetIdent(svar + '.' + string(Tok[i + 4].Name^) ); + IdentTemp:=GetIdent(svar + '.' + string(Tok[i + 4].Name) ); if IdentTemp = 0 then iError(i + 4, UnknownIdentifier); @@ -6499,7 +6499,7 @@ function NumActualParameters(i: integer; IdentIndex: integer; out NumActualParam if (ActualParamType in [POINTERTOK, STRINGPOINTERTOK]) and (Tok[i].Kind = IDENTTOK) then begin - IdentTemp := GetIdent(Tok[i].Name^); + IdentTemp := GetIdent(Tok[i].Name); if (Tok[i - 1].Kind = ADDRESSTOK) and (not (Ident[IdentTemp].DataType in [RECORDTOK, OBJECTTOK])) then @@ -6523,7 +6523,7 @@ function NumActualParameters(i: integer; IdentIndex: integer; out NumActualParam if Tok[i].Kind = IDENTTOK then begin - IdentTemp := GetIdent(Tok[i].Name^); + IdentTemp := GetIdent(Tok[i].Name); AllocElementType := Ident[IdentTemp].AllocElementType; NumAllocElements := Ident[IdentTemp].NumAllocElements; @@ -6791,7 +6791,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn if Tok[i].Kind = IDENTTOK then - IdentTemp := GetIdent(Tok[i].Name^) + IdentTemp := GetIdent(Tok[i].Name) else IdentTemp := 0; @@ -6801,7 +6801,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn if Ident[IdentTemp].Kind = FUNCTIONTOK then iError(i, CantAdrConstantExp); // VARPASSING function not possible -// writeln(' - ',Tok[i].Name^,',',ActualParamType,',',AllocElementType, ',', Ident[IdentTemp].NumAllocElements ); +// writeln(' - ',Tok[i].Name,',',ActualParamType,',',AllocElementType, ',', Ident[IdentTemp].NumAllocElements ); // writeln(Ident[IdentTemp].Kind,',',Ident[IdentTemp].DataType,',',Ident[IdentIndex].Param[NumActualParams].DataType); if Ident[IdentTemp].DataType in Pointers then @@ -6914,14 +6914,14 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn if (Tok[i].Kind = IDENTTOK) and (ActualParamType in [RECORDTOK, OBJECTTOK]) and not (Ident[IdentIndex].Param[NumActualParams].DataType in Pointers) then - if Ident[GetIdent(Tok[i].Name^)].isNestedFunction then begin + if Ident[GetIdent(Tok[i].Name)].isNestedFunction then begin - if Ident[GetIdent(Tok[i].Name^)].NestedFunctionNumAllocElements <> Ident[IdentIndex].Param[NumActualParams].NumAllocElements then - iError(i, IncompatibleTypeOf, GetIdent(Tok[i].Name^)); + if Ident[GetIdent(Tok[i].Name)].NestedFunctionNumAllocElements <> Ident[IdentIndex].Param[NumActualParams].NumAllocElements then + iError(i, IncompatibleTypeOf, GetIdent(Tok[i].Name)); end else - if Ident[GetIdent(Tok[i].Name^)].NumAllocElements <> Ident[IdentIndex].Param[NumActualParams].NumAllocElements then - iError(i, IncompatibleTypeOf, GetIdent(Tok[i].Name^)); + if Ident[GetIdent(Tok[i].Name)].NumAllocElements <> Ident[IdentIndex].Param[NumActualParams].NumAllocElements then + iError(i, IncompatibleTypeOf, GetIdent(Tok[i].Name)); if ((ActualParamType in [RECORDTOK, OBJECTTOK]) and (Ident[IdentIndex].Param[NumActualParams].DataType in Pointers)) or @@ -6931,7 +6931,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn begin if (ActualParamType = POINTERTOK) and (Tok[i].Kind = IDENTTOK) then begin - IdentTemp := GetIdent(Tok[i].Name^); + IdentTemp := GetIdent(Tok[i].Name); if (Tok[i - 1].Kind = ADDRESSTOK) then AllocElementType := UNTYPETOK @@ -6955,7 +6955,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn else begin if (ActualParamType = POINTERTOK) and (Tok[i].Kind = IDENTTOK) then begin - IdentTemp := GetIdent(Tok[i].Name^); + IdentTemp := GetIdent(Tok[i].Name); if (Tok[i - 1].Kind = ADDRESSTOK) then AllocElementType := UNTYPETOK @@ -6978,7 +6978,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn end else if (Ident[IdentIndex].Param[NumActualParams].DataType in [POINTERTOK, STRINGPOINTERTOK]) and (Tok[i].Kind = IDENTTOK) then begin - IdentTemp := GetIdent(Tok[i].Name^); + IdentTemp := GetIdent(Tok[i].Name); // writeln('1 > ',Ident[IdentTemp].name,',', Ident[IdentTemp].DataType,',',Ident[IdentTemp].AllocElementType,',',Ident[IdentTemp].NumAllocElements,' | ',Ident[IdentIndex].Param[NumActualParams].DataType,',',Ident[IdentIndex].Param[NumActualParams].NumAllocElements ); @@ -7297,7 +7297,7 @@ procedure CompileActualParameters(var i: integer; IdentIndex: integer; ProcVarIn if Tok[old_i].Kind <> IDENTTOK then iError(old_i, IdentifierExpected) else - IdentTemp := GetIdent(copy(Tok[old_i].Name^, 1, pos('.', Tok[old_i].Name^)-1 )); + IdentTemp := GetIdent(copy(Tok[old_i].Name, 1, pos('.', Tok[old_i].Name)-1 )); asm65(#9'lda ' + GetLocalName(IdentTemp)); asm65(#9'ldy ' + GetLocalName(IdentTemp) + '+1'); @@ -7479,7 +7479,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy if ValType = ENUMTYPE then begin if Tok[j].Kind = IDENTTOK then - IdentIndex := GetIdent(Tok[j].Name^) + IdentIndex := GetIdent(Tok[j].Name) else iError(i, TypeMismatch); @@ -7496,7 +7496,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy end else begin } if ValType in Pointers then begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if Ident[IdentIndex].AllocElementType in [RECORDTOK, OBJECTTOK] then Value := Ident[IdentIndex].NumAllocElements_ - 1 @@ -7548,7 +7548,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy if ValType = ENUMTYPE then begin if Tok[j].Kind = IDENTTOK then - IdentIndex := GetIdent(Tok[j].Name^) + IdentIndex := GetIdent(Tok[j].Name) else iError(i, TypeMismatch); @@ -7659,7 +7659,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy if Tok[i + 2].Kind = IDENTTOK then begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -7687,12 +7687,12 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy CheckTok(i + 2, DOTTOK); CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); -// ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name^)].AllocElementType; +// ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name)].AllocElementType; if (IdentTemp shr 16) = CHARTOK then begin @@ -8377,7 +8377,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy i := CompileExpression(i + 1, SelectorType); if Tok[i].Kind = IDENTTOK then - EnumName := GetEnumName(GetIdent(Tok[i].Name^)); + EnumName := GetEnumName(GetIdent(Tok[i].Name)); if DataSize[SelectorType]<>1 then @@ -8404,8 +8404,8 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy GetCommonType(i, ConstValType, SelectorType); if (Tok[i].Kind = IDENTTOK) then - if ((EnumName = '') and (GetEnumName(GetIdent(Tok[i].Name^)) <> '')) or - ((EnumName <> '') and (GetEnumName(GetIdent(Tok[i].Name^)) <> EnumName)) then + if ((EnumName = '') and (GetEnumName(GetIdent(Tok[i].Name)) <> '')) or + ((EnumName <> '') and (GetEnumName(GetIdent(Tok[i].Name)) <> EnumName)) then Error(i, 'Constant and CASE types do not match'); if Tok[i + 1].Kind = RANGETOK then // Range check @@ -8496,7 +8496,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy IDENTTOK: begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if IdentIndex > 0 then if (Ident[IdentIndex].Kind = USERTYPE) and (Tok[i + 1].Kind = OPARTOK) then begin @@ -8630,7 +8630,7 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy if Tok[j].Kind <> IDENTTOK then iError(j, VariableExpected); - svar := GetLocalName(GetIdent(Tok[j].Name^)); + svar := GetLocalName(GetIdent(Tok[j].Name)); asm65(#9'lda ' + svar); asm65(#9'sta :TMP+1'); @@ -8667,10 +8667,10 @@ function CompileFactor(i: Integer; out isZero: Boolean; out ValType: Byte; VarTy if Tok[j+2].Kind = DOTTOK then begin // (pointer).field := CheckTok(j + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[j + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[j + 3].Name); if IdentTemp < 0 then - Error(j + 3, 'identifier idents no member '''+Tok[j + 3].Name^+''''); + Error(j + 3, 'identifier idents no member '''+Tok[j + 3].Name+''''); ValType := IdentTemp shr 16; @@ -8854,13 +8854,13 @@ // === record^. if (Tok[i + 2].Kind = DOTTOK) then begin -// writeln(Ident[IdentIndex].Name,',',Tok[i + 3].Name^,' | ',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements); +// writeln(Ident[IdentIndex].Name,',',Tok[i + 3].Name,' | ',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements); CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); ValType := IdentTemp shr 16; @@ -8871,9 +8871,9 @@ // === record^. inc(i); - ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name^)].AllocElementType; + ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name)].AllocElementType; - i := CompileArrayIndex(i, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name^)); + i := CompileArrayIndex(i, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name)); Push(Ident[IdentIndex].Value, ASPOINTERTORECORDARRAYORIGIN, DataSize[ValType], IdentIndex, IdentTemp and $ffff); @@ -8929,10 +8929,10 @@ // === record^. CheckTok(i + 1, CBRACKETTOK); CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); ValType := IdentTemp shr 16; @@ -8943,28 +8943,28 @@ // === record^. inc(i); - ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name^)].AllocElementType; + ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name)].AllocElementType; IndirectionLevel := ASPOINTERTORECORDARRAYORIGIN; if (Ident[IdentIndex].DataType = POINTERTOK) and (Ident[IdentIndex].AllocElementType in [RECORDTOK, OBJECTTOK]) then begin -// writeln(ValType,',',Ident[IdentIndex].Name + '||' + Tok[i].Name^,',',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].NumAllocElements_ ); +// writeln(ValType,',',Ident[IdentIndex].Name + '||' + Tok[i].Name,',',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].NumAllocElements_ ); - IdentTemp := RecordSize(IdentIndex, Tok[i].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i].Name); if IdentTemp < 0 then - Error(i, 'identifier idents no member '''+Tok[i].Name^+''''); + Error(i, 'identifier idents no member '''+Tok[i].Name+''''); - ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name^)].AllocElementType; + ValType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name)].AllocElementType; IndirectionLevel := ASARRAYORIGINOFPOINTERTORECORDARRAYORIGIN; end; - i := CompileArrayIndex(i, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name^)); + i := CompileArrayIndex(i, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i].Name)); Push(Ident[IdentIndex].Value, IndirectionLevel, DataSize[ValType], IdentIndex, IdentTemp and $ffff); @@ -9581,7 +9581,7 @@ // === record^. if (ValType in Pointers) and (Tok[i + 2].Kind = IDENTTOK) and (Tok[i + 3].Kind <> OBRACKETTOK) then begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if (Ident[IdentIndex].DataType in Pointers) and ( (Ident[IdentIndex].NumAllocElements > 0) and (Ident[IdentIndex].AllocElementType <> RECORDTOK) ) then if ((Ident[IdentIndex].AllocElementType <> UNTYPETOK) and (Ident[IdentIndex].NumAllocElements in [0,1])) or (Ident[IdentIndex].DataType = STRINGPOINTERTOK) then @@ -10157,7 +10157,7 @@ function CompileExpression(i: Integer; out ValType: Byte; VarType: Byte = INTEGE if (Tok[i].Kind = STRINGLITERALTOK) or (ValType = STRINGPOINTERTOK) then sLeft:=true else if (ValType in Pointers) and (Tok[i].Kind = IDENTTOK) then - if (Ident[GetIdent(Tok[i].Name^)].AllocElementType = CHARTOK) and (Elements(GetIdent(Tok[i].Name^)) > 0) then sLeft:=true; + if (Ident[GetIdent(Tok[i].Name)].AllocElementType = CHARTOK) and (Elements(GetIdent(Tok[i].Name)) > 0) then sLeft:=true; if Tok[i + 1].Kind = INTOK then writeln('IN'); // not yet programmed @@ -10207,7 +10207,7 @@ function CompileExpression(i: Integer; out ValType: Byte; VarType: Byte = INTEGE if (Tok[i + 2].Kind = STRINGLITERALTOK) or (RightValType = STRINGPOINTERTOK) then sRight:=true else if (RightValType in Pointers) and (Tok[i + 2].Kind = IDENTTOK) then - if (Ident[GetIdent(Tok[i + 2].Name^)].AllocElementType = CHARTOK) and (Elements(GetIdent(Tok[i + 2].Name^)) > 0) then sRight:=true; + if (Ident[GetIdent(Tok[i + 2].Name)].AllocElementType = CHARTOK) and (Elements(GetIdent(Tok[i + 2].Name)) > 0) then sRight:=true; // if (ValType in [SHORTREALTOK, REALTOK]) and (RightValType in [SHORTREALTOK, REALTOK]) then @@ -10407,7 +10407,7 @@ function CompileBlockRead(var i: integer; IdentIndex: integer; IdentBlock: integ if Tok[i + 2].Kind <> IDENTTOK then iError(i + 2, VariableExpected) else begin - idx:=GetIdent(Tok[i + 2].Name^); + idx:=GetIdent(Tok[i + 2].Name); if (Ident[idx].Kind = CONSTTOK) then begin @@ -10536,7 +10536,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if Tok[i + 2].Kind <> IDENTTOK then iError(i + 2, VariableExpected) else - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); VarType := Ident[IdentIndex].DataType; @@ -10559,7 +10559,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; IDENTTOK: begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if (IdentIndex > 0) and (Ident[IdentIndex].Kind = FUNCTIONTOK) and (BlockStackTop > 1) and (Tok[i + 1].Kind <> OPARTOK) then for j:=NumIdent downto 1 do @@ -10649,10 +10649,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; IndirectionLevel := ASPOINTERTODEREFERENCE; CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); // (pointer^).field := + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); // (pointer^).field := if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); VarType := IdentTemp shr 16; par2 := '$'+IntToHex(IdentTemp and $ffff, 2); @@ -10670,10 +10670,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if (VarType in [RECORDTOK, OBJECTTOK]) and (Tok[i + 2].Kind = DOTTOK) then begin CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); // (pointer)^.field := + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); // (pointer)^.field := if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); VarType := IdentTemp shr 16; par2 := '$'+IntToHex(IdentTemp and $ffff, 2); @@ -10690,10 +10690,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; IndirectionLevel := ASPOINTERTODEREFERENCE; CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); // (pointer).field := + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); // (pointer).field := if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); VarType := IdentTemp shr 16; par2 := '$'+IntToHex(IdentTemp and $ffff, 2); @@ -10746,10 +10746,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if (VarType in [RECORDTOK, OBJECTTOK]) and (Tok[i + 2].Kind = DOTTOK) then begin CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); if Tok[i + 4].Kind = OBRACKETTOK then begin // pp^.field[index] := @@ -10757,12 +10757,12 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if not (Ident[IdentIndex].DataType in Pointers) then iError(i + 2, IncompatibleTypeOf, IdentIndex); - VarType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name^)].AllocElementType; + VarType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name)].AllocElementType; par2 := '$' + IntToHex(IdentTemp and $ffff, 2); IndirectionLevel := ASPOINTERTORECORDARRAYORIGIN; - i := CompileArrayIndex(i + 3, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name^)); + i := CompileArrayIndex(i + 3, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name)); CheckTok(i + 1, CBRACKETTOK); @@ -10771,7 +10771,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; VarType := IdentTemp shr 16; par2 := '$' + IntToHex(IdentTemp and $ffff, 2); - if GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name^) > 0 then IdentIndex := GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name^); + if GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name) > 0 then IdentIndex := GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name); inc(i, 2); @@ -10831,19 +10831,19 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; end; -// writeln(Ident[IdentIndex].Name,',',vartype,',',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].Kind);//+ '.' + Tok[i + 3].Name^); +// writeln(Ident[IdentIndex].Name,',',vartype,',',Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].Kind);//+ '.' + Tok[i + 3].Name); if (VarType in [RECORDTOK, OBJECTTOK]) and (Tok[i + 2].Kind = DOTTOK) then begin IndirectionLevel := ASPOINTERTOARRAYRECORD; CheckTok(i + 3, IDENTTOK); - IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name^); + IdentTemp := RecordSize(IdentIndex, Tok[i + 3].Name); if IdentTemp < 0 then - Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name^+''''); + Error(i + 3, 'identifier idents no member '''+Tok[i + 3].Name+''''); -// writeln('>',Ident[IdentIndex].Name+ '||' + Tok[i + 3].Name^,',',IdentTemp shr 16,',',VarType,'||',Tok[i+4].Kind,',',ident[GetIdent(Ident[IdentIndex].Name+ '.' + Tok[i + 3].Name^)].AllocElementTYpe); +// writeln('>',Ident[IdentIndex].Name+ '||' + Tok[i + 3].Name,',',IdentTemp shr 16,',',VarType,'||',Tok[i+4].Kind,',',ident[GetIdent(Ident[IdentIndex].Name+ '.' + Tok[i + 3].Name)].AllocElementTYpe); if Tok[i + 4].Kind = OBRACKETTOK then begin // array_to_record_pointers[x].field[index] := @@ -10851,12 +10851,12 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if not (Ident[IdentIndex].DataType in Pointers) then iError(i + 2, IncompatibleTypeOf, IdentIndex); - VarType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name^)].AllocElementType; + VarType := Ident[GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name)].AllocElementType; par2 := '$' + IntToHex(IdentTemp and $ffff, 2); IndirectionLevel := ASARRAYORIGINOFPOINTERTORECORDARRAYORIGIN; - i := CompileArrayIndex(i + 3, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name^)); + i := CompileArrayIndex(i + 3, GetIdent(Ident[IdentIndex].Name + '.' + Tok[i + 3].Name)); CheckTok(i + 1, CBRACKETTOK); @@ -10865,7 +10865,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; VarType := IdentTemp shr 16; par2 := '$' + IntToHex(IdentTemp and $ffff, 2); - if GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name^) > 0 then IdentIndex := GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name^); + if GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name) > 0 then IdentIndex := GetIdent(Ident[IdentIndex].name+'.'+Tok[i + 3].Name); if VarType = STRINGPOINTERTOK then IndirectionLevel := ASPOINTERTOARRAYRECORDTOSTRING; @@ -10994,18 +10994,18 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; // if (Tok[k].Kind = IDENTTOK) then -// writeln(Ident[IdentIndex].Name,'/',Tok[k].Name^,',', VarType,':', ExpressionType,' - ', Ident[IdentIndex].DataType,':',Ident[IdentIndex].AllocElementType,':',Ident[IdentIndex].NumAllocElements,' | ',Ident[GetIdent(Tok[k].Name^)].DataType,':',Ident[GetIdent(Tok[k].Name^)].AllocElementType,':',Ident[GetIdent(Tok[k].Name^)].NumAllocElements ,' / ',IndirectionLevel) +// writeln(Ident[IdentIndex].Name,'/',Tok[k].Name,',', VarType,':', ExpressionType,' - ', Ident[IdentIndex].DataType,':',Ident[IdentIndex].AllocElementType,':',Ident[IdentIndex].NumAllocElements,' | ',Ident[GetIdent(Tok[k].Name)].DataType,':',Ident[GetIdent(Tok[k].Name)].AllocElementType,':',Ident[GetIdent(Tok[k].Name)].NumAllocElements ,' / ',IndirectionLevel) // else // writeln(Ident[IdentIndex].Name,',', VarType,',', ExpressionType,' - ', Ident[IdentIndex].DataType,':',Ident[IdentIndex].AllocElementType,':',Ident[IdentIndex].NumAllocElements,' / ',IndirectionLevel); if VarType <> ExpressionType then if (ExpressionType = POINTERTOK) and (Tok[k].Kind = IDENTTOK) then - if (Ident[GetIdent(Tok[k].Name^)].DataType = POINTERTOK) and (Ident[GetIdent(Tok[k].Name^)].AllocElementType = PROCVARTOK) then begin + if (Ident[GetIdent(Tok[k].Name)].DataType = POINTERTOK) and (Ident[GetIdent(Tok[k].Name)].AllocElementType = PROCVARTOK) then begin - IdentTemp := GetIdent('@FN' + IntToHex(Ident[GetIdent(Tok[k].Name^)].NumAllocElements_, 4) ); + IdentTemp := GetIdent('@FN' + IntToHex(Ident[GetIdent(Tok[k].Name)].NumAllocElements_, 4) ); - //CompileActualParameters(i, IdentTemp, GetIdent(Tok[k].Name^)); + //CompileActualParameters(i, IdentTemp, GetIdent(Tok[k].Name)); if Ident[IdentTemp].Kind = FUNCTIONTOK then ExpressionType := Ident[IdentTemp].DataType; @@ -11042,13 +11042,13 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if (ExpressionType in Pointers - [STRINGPOINTERTOK]) and (Tok[k].Kind = IDENTTOK) then begin - IdentTemp := GetIdent(Tok[k].Name^); + IdentTemp := GetIdent(Tok[k].Name); if (IdentTemp > 0) and (Ident[IdentTemp].Kind = FUNCTIONTOK) then IdentTemp := GetIdentResult(Ident[IdentTemp].ProcAsBlock); {if (Tok[i + 3].Kind <> OBRACKETTOK) and ((Elements(IdentTemp) <> Elements(IdentIndex)) or (Ident[IdentTemp].AllocElementType <> Ident[IdentIndex].AllocElementType)) then - iError(k, IncompatibleTypesArray, GetIdent(Tok[k].Name^), ExpressionType ) + iError(k, IncompatibleTypesArray, GetIdent(Tok[k].Name), ExpressionType ) else if (Elements(IdentTemp) > 0) and (Tok[i + 3].Kind <> OBRACKETTOK) then iError(k, IncompatibleTypesArray, IdentTemp, ExpressionType ) @@ -11082,7 +11082,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; end else if (ExpressionType in [RECORDTOK, OBJECTTOK]) then begin - IdentTemp := GetIdent(Tok[k].Name^); + IdentTemp := GetIdent(Tok[k].Name); case IndirectionLevel of ASPOINTER: @@ -11116,7 +11116,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if (VarType = ENUMTYPE) {and (Tok[k].Kind = IDENTTOK)} then begin if (Tok[k].Kind = IDENTTOK) then - IdentTemp := GetIdent(Tok[k].Name^) + IdentTemp := GetIdent(Tok[k].Name) else IdentTemp := 0; @@ -11146,7 +11146,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; end else begin if (Tok[k].Kind = IDENTTOK) then - IdentTemp := GetIdent(Tok[k].Name^) + IdentTemp := GetIdent(Tok[k].Name) else IdentTemp := 0; @@ -11198,7 +11198,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if Tok[k].Kind <> IDENTTOK then iError(k, IdentifierExpected); - IdentTemp := GetIdent(Tok[k].Name^); + IdentTemp := GetIdent(Tok[k].Name); if Ident[IdentIndex].PassMethod = Ident[IdentTemp].PassMethod then @@ -11237,7 +11237,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if (ExpressionType in [RECORDTOK, OBJECTTOK]) or ( (ExpressionType = POINTERTOK) and (Ident[IdentTemp].AllocElementType in [RECORDTOK, OBJECTTOK]) ) then begin - svar := Tok[k].Name^; + svar := Tok[k].Name; if (Ident[IdentTemp].DataType = RECORDTOK) and (Ident[IdentTemp].AllocElementType <> RECORDTOK) then Name := 'adr.' + svar @@ -11267,7 +11267,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; CheckTok(k + 2, IDENTTOK); - Name := svar + '.' + Tok[k+2].Name^; + Name := svar + '.' + Tok[k+2].Name; IdentTemp := GetIdent(Name); end; @@ -11415,14 +11415,14 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; (VarType = STRINGPOINTERTOK) and (ExpressionType in Pointers) {and (Ident[IdentIndex].AllocElementType in [RECORDTOK, OBJECTTOK])} then begin -// writeln(Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType ,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].Name,',',IndirectionLevel,',',vartype,' || ',Ident[GetIdent(Tok[k].Name^)].NumAllocElements,',',Ident[GetIdent(Tok[k].Name^)].PassMethod); +// writeln(Ident[IdentIndex].DataType,',',Ident[IdentIndex].AllocElementType ,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].Name,',',IndirectionLevel,',',vartype,' || ',Ident[GetIdent(Tok[k].Name)].NumAllocElements,',',Ident[GetIdent(Tok[k].Name)].PassMethod); // writeln(address,',',Tok[k].kind,',',Ident[IdentIndex].NumAllocElements,',',Ident[IdentIndex].AllocElementType,' / ', VarType,',',ExpressionType,',',IndirectionLevel); if (Tok[k].Kind <> ADDRESSTOK) and (IndirectionLevel in [ASPOINTERTOARRAYORIGIN, ASPOINTERTOARRAYORIGIN2]) and (Ident[IdentIndex].AllocElementType = STRINGPOINTERTOK) then begin - if (Tok[k].Kind = IDENTTOK) and (Ident[GetIdent(Tok[k].Name^)].AllocElementType <> UNTYPETOK) then IndirectionLevel := ASSTRINGPOINTERTOARRAYORIGIN; + if (Tok[k].Kind = IDENTTOK) and (Ident[GetIdent(Tok[k].Name)].AllocElementType <> UNTYPETOK) then IndirectionLevel := ASSTRINGPOINTERTOARRAYORIGIN; GenerateAssignment(IndirectionLevel, DataSize[VarType], IdentIndex); @@ -11437,19 +11437,19 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; end else -// dla PROC, FUNC -> Ident[GetIdent(Tok[k].Name^)].NumAllocElements -> oznacza liczbe parametrow takiej procedury/funkcji +// dla PROC, FUNC -> Ident[GetIdent(Tok[k].Name)].NumAllocElements -> oznacza liczbe parametrow takiej procedury/funkcji if (VarType in Pointers) and ( (ExpressionType in Pointers) and (Tok[k].Kind = IDENTTOK) ) and - ( not (Ident[IdentIndex].AllocElementType in Pointers + [RECORDTOK, OBJECTTOK]) and not (Ident[GetIdent(Tok[k].Name^)].AllocElementType in Pointers + [RECORDTOK, OBJECTTOK]) ) (* and - (({DataSize[Ident[IdentIndex].AllocElementType] *} Ident[IdentIndex].NumAllocElements > 1) and ({DataSize[Ident[GetIdent(Tok[k].Name^)].AllocElementType] *} Ident[GetIdent(Tok[k].Name^)].NumAllocElements > 1)) *) then begin + ( not (Ident[IdentIndex].AllocElementType in Pointers + [RECORDTOK, OBJECTTOK]) and not (Ident[GetIdent(Tok[k].Name)].AllocElementType in Pointers + [RECORDTOK, OBJECTTOK]) ) (* and + (({DataSize[Ident[IdentIndex].AllocElementType] *} Ident[IdentIndex].NumAllocElements > 1) and ({DataSize[Ident[GetIdent(Tok[k].Name)].AllocElementType] *} Ident[GetIdent(Tok[k].Name)].NumAllocElements > 1)) *) then begin j := Ident[IdentIndex].NumAllocElements * DataSize[Ident[IdentIndex].AllocElementType]; - IdentTemp := GetIdent(Tok[k].Name^); + IdentTemp := GetIdent(Tok[k].Name); - Name := 'adr.'+Tok[k].Name^; - svar := Tok[k].Name^; + Name := 'adr.'+Tok[k].Name; + svar := Tok[k].Name; if IdentTemp > 0 then begin @@ -11635,7 +11635,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; begin CheckTok(i + 1, IDENTTOK); - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); if IdentIndex > 0 then begin @@ -11682,9 +11682,9 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; i := CompileExpression(i + 1, SelectorType); - if (SelectorType = ENUMTOK) and (Tok[j].Kind = IDENTTOK) and (Ident[GetIdent(Tok[j].Name^)].Kind = FUNCTIONTOK) then begin + if (SelectorType = ENUMTOK) and (Tok[j].Kind = IDENTTOK) and (Ident[GetIdent(Tok[j].Name)].Kind = FUNCTIONTOK) then begin - IdentTemp:=GetIdent(Tok[j].Name^); + IdentTemp:=GetIdent(Tok[j].Name); SelectorType := Ident[GetIdentResult(Ident[IdentTemp].ProcAsBlock)].AllocElementType; @@ -11693,7 +11693,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; end else if Tok[i].Kind = IDENTTOK then - EnumName := GetEnumName(GetIdent(Tok[i].Name^)); + EnumName := GetEnumName(GetIdent(Tok[i].Name)); if SelectorType <> ENUMTYPE then @@ -11733,8 +11733,8 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; GetCommonType(i, ConstValType, SelectorType); if (Tok[i].Kind = IDENTTOK) then - if ((EnumName = '') and (GetEnumName(GetIdent(Tok[i].Name^)) <> '')) or - ((EnumName <> '') and (GetEnumName(GetIdent(Tok[i].Name^)) <> EnumName)) then + if ((EnumName = '') and (GetEnumName(GetIdent(Tok[i].Name)) <> '')) or + ((EnumName <> '') and (GetEnumName(GetIdent(Tok[i].Name)) <> EnumName)) then Error(i, 'Constant and CASE types do not match'); @@ -12079,7 +12079,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 1, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); inc(CodeSize); // !!! aby dzialaly zagniezdzone FOR @@ -12188,9 +12188,9 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; ((Tok[j].Kind = OPARTOK) and (Tok[j + 1].Kind = IDENTTOK) and (Tok[j + 2].Kind = CPARTOK) and (Tok[j + 3].Kind = DOTOK)) then begin if Tok[j].Kind = IDENTTOK then - IdentTemp := GetIdent(Tok[j].Name^) + IdentTemp := GetIdent(Tok[j].Name) else - IdentTemp := GetIdent(Tok[j + 1].Name^); + IdentTemp := GetIdent(Tok[j + 1].Name); j := CompileExpression(j, ExpressionType, Ident[IdentIndex].DataType); ExpandParam(Ident[IdentIndex].DataType, ExpressionType); @@ -12412,7 +12412,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12463,7 +12463,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12513,7 +12513,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12565,7 +12565,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12600,7 +12600,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12625,9 +12625,9 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; // asm65('; GetResourceHandle'); asm65(#9'lda MAIN.@RESOURCE.' + svar); - asm65(#9'sta ' + Tok[i + 2].Name^ + '+1'); + asm65(#9'sta ' + Tok[i + 2].Name + '+1'); inc(i, 5); @@ -12643,7 +12643,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12666,10 +12666,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; // asm65('; GetResourceHandle'); asm65(#9'lda MAIN.@RESOURCE.' + svar + '.end-MAIN.@RESOURCE.' + svar); - asm65(#9'sta ' + Tok[i + 2].Name^ + '+1'); + asm65(#9'sta ' + Tok[i + 2].Name + '+1'); inc(i, 5); @@ -12685,7 +12685,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12715,7 +12715,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12744,7 +12744,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -12777,7 +12777,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; iError(i + 2, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if (IdentIndex > 0) and (Ident[identIndex].DataType = TEXTFILETOK) then begin @@ -12790,10 +12790,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; CheckTok(i, COMMATOK); CheckTok(i + 1, IDENTTOK); - if Ident[GetIdent(Tok[i + 1].Name^)].DataType <> STRINGPOINTERTOK then + if Ident[GetIdent(Tok[i + 1].Name)].DataType <> STRINGPOINTERTOK then iError(i + 1, VariableExpected); - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); asm65(#9'@moveRECORD ' + GetLocalName(IdentIndex) ); @@ -12874,9 +12874,9 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; inc(i); - if (Tok[i + 1].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i + 1].Name^)].DataType = TEXTFILETOK) then begin + if (Tok[i + 1].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i + 1].Name)].DataType = TEXTFILETOK) then begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); inc(i); CheckTok(i + 1, COMMATOK); @@ -12887,10 +12887,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; IDENTTOK: // variable (pointer to string) begin - if Ident[GetIdent(Tok[i + 1].Name^)].DataType <> STRINGPOINTERTOK then + if Ident[GetIdent(Tok[i + 1].Name)].DataType <> STRINGPOINTERTOK then iError(i + 1, VariableExpected); - asm65(#9'mwy ' + GetLocalName(GetIdent(Tok[i + 1].Name^)) +' :bp2'); + asm65(#9'mwy ' + GetLocalName(GetIdent(Tok[i + 1].Name)) +' :bp2'); asm65(#9'ldy #$01'); asm65(#9'mva:rne (:bp2),y @buf-1,y+'); asm65(#9'lda (:bp2),y'); @@ -13084,10 +13084,10 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; else if ExpressionType in Pointers then begin if Tok[j].Kind = ADDRESSTOK then - IdentIndex := GetIdent(Tok[j + 1].Name^) + IdentIndex := GetIdent(Tok[j + 1].Name) else if Tok[j].Kind = IDENTTOK then - IdentIndex := GetIdent(Tok[j].Name^) + IdentIndex := GetIdent(Tok[j].Name) else iError(i, CantReadWrite); @@ -13234,7 +13234,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; inc(i, 2); if Tok[i].Kind = IDENTTOK then begin // first parameter - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); CheckAssignment(i, IdentIndex); @@ -13257,7 +13257,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; if ExpressionType in Pointers then begin // Alloc Element Type ExpressionType := WORDTOK; - if pos('mw? '+Tok[i].Name^, optyBP2) > 0 then optyBP2 := ''; + if pos('mw? '+Tok[i].Name, optyBP2) > 0 then optyBP2 := ''; end; end; @@ -13556,7 +13556,7 @@ function CompileStatement(i: Integer; isAsm: Boolean = false): Integer; Error(i, 'Interrupt Number in [0..4]'); CheckTok(i + 2, IDENTTOK); - IdentIndex := GetIdent(Tok[i + 2].Name^); + IdentIndex := GetIdent(Tok[i + 2].Name); if IdentIndex = 0 then iError(i + 2, UnknownIdentifier); @@ -14640,7 +14640,7 @@ procedure FormalParameterList(var i: integer; var NumParams: integer; var Param: else begin Inc(NumVarOfSameType); - VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name^; + VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name; end; i := i + 2; until Tok[i].Kind <> COMMATOK; @@ -14807,9 +14807,9 @@ procedure CheckForwardResolutions(typ: Boolean = true); if (Ident[TypeIndex].AllocElementType = FORWARDTYPE) and (Ident[TypeIndex].Block = BlockStack[BlockStackTop]) then begin - Name := Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name^)].Name; + Name := Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name)].Name; - if Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name^)].Kind = TYPETOK then + if Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name)].Kind = TYPETOK then for IdentIndex := 1 to NumIdent do if (Ident[IdentIndex].Name = Name) and @@ -14833,7 +14833,7 @@ procedure CheckForwardResolutions(typ: Boolean = true); if typ then Error(TypeIndex, 'Unresolved forward reference to type ' + Ident[TypeIndex].Name) else - Error(TypeIndex, 'Identifier not found "' + Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name^)].Name + '"'); + Error(TypeIndex, 'Identifier not found "' + Ident[GetIdent(Tok[Ident[TypeIndex].NumAllocElements].Name)].Name + '"'); end; //CheckForwardResolutions @@ -15454,8 +15454,8 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i + 1, UNITTOK); CheckTok(i + 2, IDENTTOK); - if Tok[i + 2].Name^ <> UnitName[Tok[i].UnitIndex].Name then - Error(i + 2, 'Illegal unit name: ' + Tok[i + 2].Name^); + if Tok[i + 2].Name <> UnitName[Tok[i].UnitIndex].Name then + Error(i + 2, 'Illegal unit name: ' + Tok[i + 2].Name); CheckTok(i + 3, SEMICOLONTOK); @@ -15525,7 +15525,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i , IDENTTOK); if Pass = CALLDETERMPASS then begin - IdentIndex := GetIdent(Tok[i].Name^); + IdentIndex := GetIdent(Tok[i].Name); if IdentIndex = 0 then iError(i, UnknownIdentifier); @@ -15585,7 +15585,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i + 1, IDENTTOK); - LIBRARY_NAME := Tok[i + 1].Name^; + LIBRARY_NAME := Tok[i + 1].Name; if (Tok[i + 2].Kind = COLONTOK) and (Tok[i + 3].Kind = INTNUMBERTOK) then begin @@ -15613,7 +15613,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i + 1, IDENTTOK); - PROGRAM_NAME := Tok[i + 1].Name^; + PROGRAM_NAME := Tok[i + 1].Name; inc(i); @@ -15697,11 +15697,11 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i , IDENTTOK); for j:=0 to High(UnitList)-1 do - if UnitList[j] = Tok[i].Name^ then - Error(i, 'Duplicate identifier '''+Tok[i].Name^+''''); + if UnitList[j] = Tok[i].Name then + Error(i, 'Duplicate identifier '''+Tok[i].Name+''''); j:=High(UnitList); - UnitList[j] := Tok[i].Name^; + UnitList[j] := Tok[i].Name; SetLength(UnitList, j+2); inc(i); @@ -15731,7 +15731,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; yes:=true; for j := 1 to UnitName[UnitNameIndex].Units do - if (UnitName[UnitNameIndex].Allow[j] = Tok[i].Name^) or (Tok[i].Name^ = 'SYSTEM') then yes:=false; + if (UnitName[UnitNameIndex].Allow[j] = Tok[i].Name) or (Tok[i].Name = 'SYSTEM') then yes:=false; if yes then begin @@ -15740,7 +15740,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if UnitName[UnitNameIndex].Units > MAXALLOWEDUNITS then Error(i, 'Out of resources, MAXALLOWEDUNITS'); - UnitName[UnitNameIndex].Allow[UnitName[UnitNameIndex].Units] := Tok[i].Name^; + UnitName[UnitNameIndex].Allow[UnitName[UnitNameIndex].Units] := Tok[i].Name; end; @@ -15776,7 +15776,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; CheckTok(i , IDENTTOK); - DefineIdent(i, Tok[i].Name^, LABELTYPE, 0, 0, 0, 0); + DefineIdent(i, Tok[i].Name, LABELTYPE, 0, 0, 0, 0); inc(i); @@ -15805,15 +15805,15 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if Tok[j].Kind in StringTypes then begin if Tok[j].StrLength > 255 then - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, POINTERTOK, 0, CHARTOK, ConstVal + CODEORIGIN, PCHARTOK) + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, POINTERTOK, 0, CHARTOK, ConstVal + CODEORIGIN, PCHARTOK) else - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, ConstValType, Tok[j].StrLength, CHARTOK, ConstVal + CODEORIGIN, Tok[j].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, ConstValType, Tok[j].StrLength, CHARTOK, ConstVal + CODEORIGIN, Tok[j].Kind); end else if (ConstValType in Pointers) then iError(j, IllegalExpression) else - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, ConstValType, 0, 0, ConstVal, Tok[j].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, ConstValType, 0, 0, ConstVal, Tok[j].Kind); i := j; end else @@ -15867,15 +15867,15 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; j := CompileConstExpression(j + 2, ConstVal, ConstValType); if Tok[i + 3].Kind = PCHARTOK then - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, POINTERTOK, 0, CHARTOK, ConstVal + CODEORIGIN + 1, PCHARTOK) + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, POINTERTOK, 0, CHARTOK, ConstVal + CODEORIGIN + 1, PCHARTOK) else - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, ConstValType, Tok[j].StrLength, CHARTOK, ConstVal + CODEORIGIN, Tok[j].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, ConstValType, Tok[j].StrLength, CHARTOK, ConstVal + CODEORIGIN, Tok[j].Kind); end else if NumAllocElements > 0 then begin - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, VarType, NumAllocElements, AllocElementType, NumStaticStrChars + CODEORIGIN + CODEORIGIN_BASE, IDENTTOK); + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, VarType, NumAllocElements, AllocElementType, NumStaticStrChars + CODEORIGIN + CODEORIGIN_BASE, IDENTTOK); if (Ident[NumIdent].NumAllocElements in [0,1]) and (open_array = false) then iError(i, IllegalExpression) @@ -15941,7 +15941,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; GetCommonType(i + 1, VarType, ConstValType); - DefineIdent(i + 1, Tok[i + 1].Name^, CONSTANT, VarType, 0, 0, ConstVal, Tok[j].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, CONSTANT, VarType, 0, 0, ConstVal, Tok[j].Kind); end; i := j; @@ -15973,7 +15973,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if (Tok[i + 3].Kind = ARRAYTOK) and (Tok[i + 4].Kind <> OBRACKETTOK) then begin j := CompileType(i + 5, VarType, NumAllocElements, AllocElementType); - DefineIdent(i + 1, Tok[i + 1].Name^, USERTYPE, VarType, NumAllocElements, AllocElementType, 0, Tok[i + 3].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, USERTYPE, VarType, NumAllocElements, AllocElementType, 0, Tok[i + 3].Kind); Ident[NumIdent].Pass := CALLDETERMPASS; end else begin @@ -15981,7 +15981,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if Tok[i + 3].Kind = ARRAYTOK then j := CompileType(j + 3, NestedDataType, NestedNumAllocElements, NestedAllocElementType); - DefineIdent(i + 1, Tok[i + 1].Name^, USERTYPE, VarType, NumAllocElements, AllocElementType, 0, Tok[i + 3].Kind); + DefineIdent(i + 1, Tok[i + 1].Name, USERTYPE, VarType, NumAllocElements, AllocElementType, 0, Tok[i + 3].Kind); Ident[NumIdent].Pass := CALLDETERMPASS; end; @@ -16034,7 +16034,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if NumVarOfSameType > High(VarOfSameType) then Error(i, 'Too many formal parameters'); - VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name^; + VarOfSameType[NumVarOfSameType].Name := Tok[i + 1].Name; end; i := i + 2; until Tok[i].Kind <> COMMATOK; @@ -16135,7 +16135,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if Tok[i + 1].Kind = IDENTTOK then begin - external_name := Tok[i + 1].Name^; + external_name := Tok[i + 1].Name; if Tok[i + 2].Kind = STRINGLITERALTOK then begin external_libr := i + 2; @@ -16174,10 +16174,10 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; varPassMethod := 255; - if (Tok[i+1].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i+1].Name^)].Kind = VARTOK) then begin - ConstVal := Ident[GetIdent(Tok[i+1].Name^)].Value - DATAORIGIN; + if (Tok[i+1].Kind = IDENTTOK) and (Ident[GetIdent(Tok[i+1].Name)].Kind = VARTOK) then begin + ConstVal := Ident[GetIdent(Tok[i+1].Name)].Value - DATAORIGIN; - varPassMethod := Ident[GetIdent(Tok[i+1].Name^)].PassMethod; + varPassMethod := Ident[GetIdent(Tok[i+1].Name)].PassMethod; if (ConstVal < 0) or (ConstVal > $FFFFFF) then Error(i, 'Range check error while evaluating constants ('+IntToStr(ConstVal)+' must be between 0 and '+IntToStr($FFFFFF)+')'); @@ -16204,7 +16204,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; - if IdType = IDENTTOK then IdType := Ident[GetIdent(Tok[idx].Name^)].IdType; + if IdType = IDENTTOK then IdType := Ident[GetIdent(Tok[idx].Name)].IdType; @@ -16377,7 +16377,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if Tok[i + 1].Kind <> IDENTTOK then iError(i + 1, IdentifierExpected) else begin - IdentIndex := GetIdent(Tok[i + 1].Name^); + IdentIndex := GetIdent(Tok[i + 1].Name); if IdentIndex > 0 then begin @@ -16539,7 +16539,7 @@ function CompileBlock(i: Integer; BlockIdentIndex: Integer; NumParams: Integer; if INTERFACETOK_USE then ForwardIdentIndex := 0 else - ForwardIdentIndex := GetIdent(Tok[i + 1].Name^); + ForwardIdentIndex := GetIdent(Tok[i + 1].Name); if (ForwardIdentIndex <> 0) and (Ident[ForwardIdentIndex].isOverload) then begin // !!! dla forward; overload;