[erlang-questions] erlang parser for javascript literals

Joe Armstrong <>
Mon Oct 8 12:06:54 CEST 2012


Does anybody have an Erlang parser for Javascript literals?

I have some JSON terms - I have to write them like this:

{"id"     : 123,
 "author" : "",
 "title"  : "Some title",
 "type"   : "html",
 "vsns":[{"vsn":1,
	  "time":"201200908113012",
	  "content":"<h1>This is html</h1>\n<pre>a\nb</pre>"}]
}

But I'd prefer to write them with far fewer quotes and with embedded
line feeds like this:

{id     : 123,
 author : "",
 title  : "Some title",
 type   : html,
 vsns:[{vsn:1,
	  time:"201200908113012",
	  content:"<h1>This is html</h1>
<pre>a
b
</pre>"}]
}

Or do any of the erlang JSON parsers handle non quoted names in object literals?


/Joe



More information about the erlang-questions mailing list