[gn] Updating args --list to emit json

Updates the gn args --list command with an additional --json flag, which
emits the same information as the normal --list command but in json
format.

Intended to be used to generate structured documentation for GN build
arguments. The --markdown output is nice, but we want to do more
processing than that to get it into good shape to integrate with our docs.

Also updates the GetContextForValue function to get the file and the
line number separately, rather than as one string, and updates the
callsites with the new parameters.

Change-Id: Id1240c37f835a18a12a6e4f5be58b9f8c7a663d1
Reviewed-on: https://chromium-review.googlesource.com/978423
Commit-Queue: Julie Hockett <juliehockett@google.com>
Reviewed-by: Roland McGrath <mcgrathr@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#547759}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8ca5c09bb15f1584155c9e295ff0725be5990d9a
1 file changed
tree: 5055ac867553bb32a19a8c393eb36d8042eaf808
  1. tools/