Browse Source

fcl-passrc: Improves a lot the default exception message for parsing errors

git-svn-id: trunk@18217 -
sekelsenmat 14 years ago
parent
commit
4c26ef6386
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/fcl-passrc/src/pparser.pp

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

@@ -27,7 +27,7 @@ resourcestring
   SErrNoSourceGiven = 'No source file specified';
   SErrNoSourceGiven = 'No source file specified';
   SErrMultipleSourceFiles = 'Please specify only one source file';
   SErrMultipleSourceFiles = 'Please specify only one source file';
   SParserError = 'Error';
   SParserError = 'Error';
-  SParserErrorAtToken = '%s at token "%s"';
+  SParserErrorAtToken = '%s at token "%s" in file %s at line %d column %d';
   SParserUngetTokenError = 'Internal error: Cannot unget more tokens, history buffer is full';
   SParserUngetTokenError = 'Internal error: Cannot unget more tokens, history buffer is full';
   SParserExpectTokenError = 'Expected "%s"';
   SParserExpectTokenError = 'Expected "%s"';
   SParserExpectedCommaRBracket = 'Expected "," or ")"';
   SParserExpectedCommaRBracket = 'Expected "," or ")"';
@@ -240,7 +240,8 @@ end;
 
 
 procedure TPasParser.ParseExc(const Msg: String);
 procedure TPasParser.ParseExc(const Msg: String);
 begin
 begin
-  raise EParserError.Create(Format(SParserErrorAtToken, [Msg, CurTokenName]) {$ifdef addlocation}+' ('+inttostr(scanner.currow)+' '+inttostr(scanner.curcolumn)+')'{$endif},
+  raise EParserError.Create(Format(SParserErrorAtToken, [Msg, CurTokenName, Scanner.CurFilename, Scanner.CurRow, Scanner.CurColumn])
+    {$ifdef addlocation}+' ('+inttostr(scanner.currow)+' '+inttostr(scanner.curcolumn)+')'{$endif},
     Scanner.CurFilename, Scanner.CurRow, Scanner.CurColumn);
     Scanner.CurFilename, Scanner.CurRow, Scanner.CurColumn);
 end;
 end;