Skip to content

arescentral/procyon

Repository files navigation

Procyon

Procyon is a simple object notation. It's a little more than JSON and a lot less than YAML. For a quick introduction, see lang.pn.

Repository Structure

Language Source
C src/c
C++ src/cpp
Python src/python

Types

There are eight Procyon types:

Group Subgroup Type Description Short form
Scalar Const Null Nothing null
Boolean True/False true, false
Numeric Integer Signed, 64-bit 0, 1, -99
Float IEEE 754 double 0.0, 1e100, -inf, nan
Vector Raw Data Binary data $, $ff0000
String Unicode "", "\u270c!", "🍱"
Sequence Array Ordered list [1, true, 3.0]
Map Key-value pairs {b: false, i: 0}

In addition to short form, the four vector types have a long form:

Data String Array Map
$ 01234657
$ 89abcdef
$ 01234567
$ 89abcdef
> Soft-wrap with “>”
| Hard-wrap with “|”
> Final \n unless “!”
!
* "Bullets"
* "Use “*”"
key: "unqoted"
"\"": "quoted"

Tools

pnfmt

Procyon notation has a standard style and format. The pnfmt tool will automatically convert files to the standard style and rewrap strings for readability.

usage: pnfmt [-i | -o OUT] [IN]

options:
 -i, --in-place               format file in-place
 -o, --output=FILE            write output to path
 -h, --help                   show this help screen

pn2json

pn2json converts Procyon to JSON, with a few conversions for unsupported types and values:

Procyon JSON
inf 1e999
nan null
$0123 "0123"
usage: pn2json [options] [FILE.pn]

options:
     --traditional            format JSON traditionally (default)
     --comma-first            format JSON with comma first
 -m, --minify                 minify JSON
 -r, --root                   print root string or data instead of JSON
 -h, --help                   show this help screen

Extras

For Source
lldb misc/lldb
pygments misc/pygments
vim misc/vim