Browse Source

* Fix bug #37592, improved error message readability

git-svn-id: trunk@46753 -
michael 4 years ago
parent
commit
3722c820c9
1 changed files with 3 additions and 2 deletions
  1. 3 2
      packages/fcl-json/src/jsonreader.pp

+ 3 - 2
packages/fcl-json/src/jsonreader.pp

@@ -175,9 +175,10 @@ Resourcestring
   SErrExpectedColon   = 'Expected colon (:), got token "%s".';
   //SErrEmptyElement = 'Empty element encountered.';
   SErrExpectedElementName    = 'Expected element name, got token "%s"';
-  SExpectedCommaorBraceClose = 'Expected , or ], got token "%s".';
+  SExpectedCommaorBraceClose = 'Expected comma (,) or square bracket (]), got token "%s".';
   SErrInvalidNumber          = 'Number is not an integer or real number: %s';
   SErrNoScanner = 'No scanner. No source specified ?';
+  SErrorAt = 'Error at line %d, Pos %d: ';
   
 { TBaseJSONReader }
 
@@ -408,7 +409,7 @@ Var
 
 begin
   S:=Format(Msg,[CurrentTokenString]);
-  S:=Format('Error at line %d, Pos %d:',[FScanner.CurRow,FSCanner.CurColumn])+S;
+  S:=Format(SErrorAt,[FScanner.CurRow,FSCanner.CurColumn])+S;
   Raise EJSONParser.Create(S);
 end;