View Issue Details

IDProjectCategoryView StatusLast Update
0037367FPCFCLpublic2020-07-16 14:29
ReporterDomingo Galmés Assigned ToMichael Van Canneyt  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformi386OSWindows 64 bits 
Product Version3.3.1 
Fixed in Version3.3.1 
Summary0037367: Exceptions parsing json string with comments and multiline comments TJSONParser in fpJson.
DescriptionException parsing the json string. WIthout the comment 2 works well.

Error message.
Invalid character at line 4 pos 0: '*'
Steps To Reproduceprocedure TTestParser.TestFirstLineLongComment;

// New case
const
  ENDLINE = #$0d#$0a;


Const
  MyJSON =
    '/* long comment'+ENDLINE+
         '''+ENDLINE+
    ' error'+ENDLINE+
    '*/'+ENDLINE+
    '{'+ENDLINE+
    ' "version":100, //coment2 without comment2 works well '+ENDLINE+
    ' "valor":200 /*comment 3'+ENDLINE+
    ' line 2'+ENDLINE+
    ' */'+ENDLINE+
    '}'+ENDLINE;

var
  J : TJSONData;

begin
  With TJSONParser.Create(MyJSON,[joComments]) do
    Try
      J:=Parse;
      J.Free;
    Finally
      Free;
    end;

end;
TagsNo tags attached.
Fixed in Revision45795
FPCOldBugId
FPCTarget3.2.2
Attached Files

Activities

Michael Van Canneyt

2020-07-16 09:44

administrator   ~0124078

Fixed, thanks for reporting !

Domingo Galmés

2020-07-16 14:29

reporter   ~0124092

Thanks for your fast resolution!

Issue History

Date Modified Username Field Change
2020-07-15 22:53 Domingo Galmés New Issue
2020-07-16 09:44 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-07-16 09:44 Michael Van Canneyt Status new => resolved
2020-07-16 09:44 Michael Van Canneyt Resolution open => fixed
2020-07-16 09:44 Michael Van Canneyt Fixed in Version => 3.3.1
2020-07-16 09:44 Michael Van Canneyt Fixed in Revision => 45795
2020-07-16 09:44 Michael Van Canneyt FPCTarget => 3.2.2
2020-07-16 09:44 Michael Van Canneyt Note Added: 0124078
2020-07-16 14:29 Domingo Galmés Status resolved => closed
2020-07-16 14:29 Domingo Galmés Note Added: 0124092