Factor out JSON stripComments().
authorJez Ng <jezng@fb.com>
Fri, 15 Aug 2014 17:29:26 +0000 (10:29 -0700)
committerSara Golemon <sgolemon@fb.com>
Tue, 9 Sep 2014 21:22:22 +0000 (14:22 -0700)
commit34307dc2e322f88ed027c18ee86af274e5ae5ad3
tree285356ea2ea06693887983c3bf69cf10fdf6dce1
parent6e46d468cf2876dd59c7a4dddcb4e37abf070b7a
Factor out JSON stripComments().

Summary:
Comments are a useful extension to JSON, especially for configuration files.

Facebook: twagent would previously barf on JSON files that contained '//' in their strings, and this commit allows twagent to strip comments properly. Fixes T4686066.

Test Plan: fbconfig common/json mcrouter/lib/config tupperware/agent && fbmake runtests

Reviewed By: aravindn@fb.com

Subscribers: anarayanan, pavlo, stepan, dipanshu, alikhtarov

FB internal diff: D1493963

Tasks: 4686066
folly/json.cpp
folly/json.h
folly/test/JsonTest.cpp
folly/test/json_test_data/commented.json [new file with mode: 0644]
folly/test/json_test_data/commented.json.exp [new file with mode: 0644]