Browse Source

fcl-passrc: external names can be char

git-svn-id: trunk@35842 -
Mattias Gaertner 8 years ago
parent
commit
4f11e61033
1 changed files with 10 additions and 3 deletions
  1. 10 3
      packages/fcl-passrc/src/pparser.pp

+ 10 - 3
packages/fcl-passrc/src/pparser.pp

@@ -887,7 +887,12 @@ end;
 procedure TPasParser.CheckToken(tk: TToken);
 procedure TPasParser.CheckToken(tk: TToken);
 begin
 begin
   if (CurToken<>tk) then
   if (CurToken<>tk) then
+    begin
+    {$IFDEF VerbosePasParser}
+    writeln('TPasParser.ParseExcTokenError String="',CurTokenString,'" Text="',CurTokenText,'" CurToken=',CurToken,' tk=',tk);
+    {$ENDIF}
     ParseExcTokenError(TokenInfos[tk]);
     ParseExcTokenError(TokenInfos[tk]);
+    end;
 end;
 end;
 
 
 
 
@@ -3119,7 +3124,7 @@ begin
   if not CurTokenIsIdentifier('name') then
   if not CurTokenIsIdentifier('name') then
     ParseExcSyntaxError;
     ParseExcSyntaxError;
   NextToken;
   NextToken;
-  if not (CurToken in [tkString,tkIdentifier]) then
+  if not (CurToken in [tkChar,tkString,tkIdentifier]) then
     ParseExcTokenError(TokenInfos[tkString]);
     ParseExcTokenError(TokenInfos[tkString]);
   Result := Result + ' ' + CurTokenText;
   Result := Result + ' ' + CurTokenText;
   ExportName:=DoParseExpression(Parent);
   ExportName:=DoParseExpression(Parent);
@@ -3511,7 +3516,7 @@ begin
         if ((CurToken=tkIdentifier) and (Tok='NAME')) then
         if ((CurToken=tkIdentifier) and (Tok='NAME')) then
           begin
           begin
           NextToken;
           NextToken;
-          if not (CurToken in [tkString,tkIdentifier]) then
+          if not (CurToken in [tkChar,tkString,tkIdentifier]) then
             ParseExcTokenError(TokenInfos[tkString]);
             ParseExcTokenError(TokenInfos[tkString]);
           E:=DoParseExpression(Parent);
           E:=DoParseExpression(Parent);
           if Assigned(P) then
           if Assigned(P) then
@@ -5267,7 +5272,9 @@ begin
     ExpectIdentifier;
     ExpectIdentifier;
     If Not CurTokenIsIdentifier('Name')  then
     If Not CurTokenIsIdentifier('Name')  then
       ParseExc(nParserExpectedExternalClassName,SParserExpectedExternalClassName);
       ParseExc(nParserExpectedExternalClassName,SParserExpectedExternalClassName);
-    ExpectToken(tkString);
+    NextToken;
+    if not (CurToken in [tkChar,tkString]) then
+      CheckToken(tkString);
     AExternalName:=CurTokenString;
     AExternalName:=CurTokenString;
     NextToken;
     NextToken;
     end
     end