Browse Source

* Parser buffer are ansichars

Michaël Van Canneyt 3 months ago
parent
commit
bfefdb67c3
2 changed files with 11 additions and 11 deletions
  1. 8 8
      rtl/objpas/classes/classesh.inc
  2. 3 3
      rtl/objpas/classes/parser.inc

+ 8 - 8
rtl/objpas/classes/classesh.inc

@@ -2160,17 +2160,17 @@ type
   TParser = class(TObject)
   private
     fStream : TStream;
-    fBuf : PChar;
+    fBuf : PAnsiChar;
     fBufLen : integer;
     fPos : integer;
     fDeltaPos : integer;
-    fFloatType : Char;
+    fFloatType : AnsiChar;
     fSourceLine : integer;
-    fToken : Char;
+    fToken : AnsiChar;
     fEofReached : boolean;
     fLastTokenStr : string;
     fLastTokenWStr : widestring;
-    function GetTokenName(aTok : Char) : string;
+    function GetTokenName(aTok : AnsiChar) : string;
     procedure LoadBuffer;
     procedure CheckLoadBuffer; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
     procedure ProcessChar; {$ifdef CLASSESINLINE} inline; {$endif CLASSESINLINE}
@@ -2197,13 +2197,13 @@ type
   public
     constructor Create(Stream: TStream);
     destructor Destroy; override;
-    procedure CheckToken(T: Char);
+    procedure CheckToken(T: AnsiChar);
     procedure CheckTokenSymbol(const S: string);
     procedure Error(const Ident: string);
     procedure ErrorFmt(const Ident: string; const Args: array of const);
     procedure ErrorStr(const Message: string);
     procedure HexToBinary(Stream: TStream);
-    function NextToken: Char;
+    function NextToken: AnsiChar;
     function SourcePos: Longint;
     function TokenComponentIdent: string;
 {$ifndef FPUNONE}
@@ -2213,9 +2213,9 @@ type
     function TokenString: string;
     function TokenWideString: WideString;
     function TokenSymbolIs(const S: string): Boolean;
-    property FloatType: Char read fFloatType;
+    property FloatType: AnsiChar read fFloatType;
     property SourceLine: Integer read fSourceLine;
-    property Token: Char read fToken;
+    property Token: AnsiChar read fToken;
   end;
 
 { TThread }

+ 3 - 3
rtl/objpas/classes/parser.inc

@@ -37,7 +37,7 @@ const
     'WideString'
   );
 
-function TParser.GetTokenName(aTok: Char): string;
+function TParser.GetTokenName(aTok: AnsiChar): string;
 begin
   if ord(aTok) <= LastSpecialToken then
     Result:=TokNames[ord(aTok)]
@@ -375,7 +375,7 @@ begin
   FreeMem(fBuf);
 end;
 
-procedure TParser.CheckToken(T: Char);
+procedure TParser.CheckToken(T: AnsiChar);
 begin
   if fToken<>T then
     ErrorFmt(SParWrongTokenType,[GetTokenName(T),GetTokenName(fToken)]);
@@ -434,7 +434,7 @@ begin
   NextToken;
 end;
 
-function TParser.NextToken: Char;
+function TParser.NextToken: AnsiChar;
 
 begin
   SkipWhiteSpace;