Browse Source

* slightly improved error reporting for test_parser.

git-svn-id: trunk@15777 -
marco 15 years ago
parent
commit
7c42df69db
1 changed files with 9 additions and 2 deletions
  1. 9 2
      packages/fcl-passrc/examples/test_parser.pp

+ 9 - 2
packages/fcl-passrc/examples/test_parser.pp

@@ -51,8 +51,15 @@ begin
       cmdl:=cmdl+' '+paramstr(i);
       cmdl:=cmdl+' '+paramstr(i);
   E := TSimpleEngine.Create;
   E := TSimpleEngine.Create;
   try
   try
-    M := ParseSource(E, cmdl , 'linux', 'i386');
-
+    try
+      M := ParseSource(E, cmdl , 'linux', 'i386');
+    except
+      on excep:EParserError do
+        begin
+          writeln(excep.message,' line:',excep.row,' column:',excep.column,' file:',excep.filename); 
+          raise;
+       end;  
+      end;      
     { Cool, we successfully parsed the unit.
     { Cool, we successfully parsed the unit.
       Now output some info about it. }
       Now output some info about it. }
     Decls := M.InterfaceSection.Declarations;
     Decls := M.InterfaceSection.Declarations;