[review] JSON language implementation

muji <[email protected]> Mon, 8 Apr 2013 18:32:39 +0200
Newsgroups gmane.comp.gnu.source-highlight.general
Message-ID <CAKM-nufD3iK-bb6EDBUryvAOPsN=e_s3Q4YnkmtHYO-CJC1Fjg@mail.gmail.com>
--===============6907563072385261112==
Content-Type: multipart/alternative; boundary=f46d0435c01041404304d9dbfc0a

--f46d0435c01041404304d9dbfc0a
Content-Type: text/plain; charset=UTF-8

Hello,

Thanks for `source-highlight`, it is fast and easy to customize.

I am working on a tool that required highlighting of JSON documents printed
to a terminal so I wrote a JSON language implementation[1] and style
file[2].

It appears to function correctly but I would appreciate it if you could
review and if it is deemed good enough merge into the next release?

It handles escaped strings correctly, ie:

{
"string": "my \"quoted\" value"
}

I wanted to be able to differentiate elements at a granular level so have
introduced some JSON specific style names:

* keyquote - Quotation marks for keys
* valquote - Quotation marks for string values
* colon - The colon delimiter
* key - The string between key quotes

The number handling is taken from number.lang and can be replaced with an
include of number.lang if you wish to merge this language definition.

[1] https://github.com/freeformsystems/rlx/blob/master/highlight/json.lang
[2] https://github.com/freeformsystems/rlx/blob/master/highlight/json.style

Cheers,

-- 
mischa (aka muji).

--f46d0435c01041404304d9dbfc0a
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hello,<div><br></div><div>Thanks for `source-highlight`, i=
t is fast and easy to customize.<br><div><br></div><div>I am working on a t=
ool that required highlighting of JSON documents printed to a terminal so I=
 wrote a JSON language implementation[1] and style file[2].</div>
<div><br></div><div style>It appears to function correctly but I would appr=
eciate it if you could review and if it is deemed good enough merge into th=
e next release?</div><div style><br></div><div style>It handles escaped str=
ings correctly, ie:</div>
<div style><br></div><div style>{</div><div style>&quot;string&quot;: &quot=
;my \&quot;quoted\&quot; value&quot;</div><div style>}</div><div style><br>=
</div><div style>I wanted to be able to differentiate elements at a granula=
r level so have introduced some JSON specific style names:</div>
<div style><br></div><div style>* keyquote - Quotation marks for keys</div>=
<div style>* valquote - Quotation marks for string values</div><div style>*=
 colon - The colon delimiter</div><div style>* key - The string between key=
 quotes</div>
<div style><br></div><div style>The number handling is taken from number.la=
ng and can be replaced with an include of number.lang if you wish to merge =
this language definition.</div><div><br></div><div>[1]=C2=A0<a href=3D"http=
s://github.com/freeformsystems/rlx/blob/master/highlight/json.lang">https:/=
/github.com/freeformsystems/rlx/blob/master/highlight/json.lang</a></div>
<div>[2]=C2=A0<a href=3D"https://github.com/freeformsystems/rlx/blob/master=
/highlight/json.style">https://github.com/freeformsystems/rlx/blob/master/h=
ighlight/json.style</a></div><div><br></div><div>Cheers,<br clear=3D"all"><=
div><br>
</div>-- <br>mischa (aka muji).
</div></div></div>

--f46d0435c01041404304d9dbfc0a--


--===============6907563072385261112==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Help-source-highlight mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-source-highlight

--===============6907563072385261112==--