Browse Source

* better error message in case of parser error

git-svn-id: trunk@7272 -
florian 18 years ago
parent
commit
0e429065e8
1 changed files with 13 additions and 6 deletions
  1. 13 6
      utils/fpdoc/makeskel.pp

+ 13 - 6
utils/fpdoc/makeskel.pp

@@ -59,7 +59,7 @@ var
   DisableProtected,
   DisableProtected,
   DisablePrivate,
   DisablePrivate,
   DisableFunctionResults: Boolean;
   DisableFunctionResults: Boolean;
- 
+
   EmitClassSeparator: Boolean;
   EmitClassSeparator: Boolean;
   PackageName, OutputName: String;
   PackageName, OutputName: String;
   f: Text;
   f: Text;
@@ -87,14 +87,14 @@ function TSkelEngine.CreateElement(AClass: TPTreeElement; const AName: String;
         If (PT<>Nil) and ((PT is TPasProcedure) or (PT is TPasProcedure))   then
         If (PT<>Nil) and ((PT is TPasProcedure) or (PT is TPasProcedure))   then
           PP:=PT.Parent
           PP:=PT.Parent
         else
         else
-          PP:=Nil;  
+          PP:=Nil;
         If (PP<>Nil) and (PP is TPasClassType) then
         If (PP<>Nil) and (PP is TPasClassType) then
           begin
           begin
           ParentVisible:=((not DisablePrivate or (PT.Visibility<>visPrivate)) and
           ParentVisible:=((not DisablePrivate or (PT.Visibility<>visPrivate)) and
                          (not DisableProtected or (PT.Visibility<>visProtected)));
                          (not DisableProtected or (PT.Visibility<>visProtected)));
           end;
           end;
-        end;  
-      end;         
+        end;
+      end;
     Result:=Assigned(AParent) and (Length(AName) > 0) and
     Result:=Assigned(AParent) and (Length(AName) > 0) and
             (ParentVisible and (not DisableArguments or (APasElement.ClassType <> TPasArgument))) and
             (ParentVisible and (not DisableArguments or (APasElement.ClassType <> TPasArgument))) and
             (ParentVisible and (not DisableFunctionResults or (APasElement.ClassType <> TPasResultElement))) and
             (ParentVisible and (not DisableFunctionResults or (APasElement.ClassType <> TPasResultElement))) and
@@ -380,13 +380,20 @@ begin
          WriteLn(f, '</module> <!-- ', Module.Name, ' -->');
          WriteLn(f, '</module> <!-- ', Module.Name, ' -->');
          WriteLn(f, '');
          WriteLn(f, '');
        except
        except
-        on e:EFileNotFoundError do
+         on e:EFileNotFoundError do
            begin
            begin
              Writeln(StdErr,' file ', e.message, ' not found');
              Writeln(StdErr,' file ', e.message, ' not found');
              close(f);
              close(f);
              Halt(1);
              Halt(1);
            end;
            end;
-         end;
+         on e:EParserError do
+           begin
+             Writeln(StdErr,'', e.filename,'(',e.row,',',e.column,') Fatal: ',e.message);
+             close(f);
+             Halt(1);
+           end;
+       end;
+
       finally
       finally
         Engine.Free;
         Engine.Free;
        end;
        end;