/vectors-format

Subset of EDN to store Cirru source code

Primary LanguageCoffeeScript

Cirru Vectors Format

A subset of EDN to store Cirru source code.

[
[ "a" "b" "c d" ]
[ "e" [ "f" [ "g" ] "h" ] ]
[ "i" ]
]

Usage

npm i --save cirru-vectors-format
{write, parse} = require('cirru-vectors-format')
file = '\n[["a" ["b"]] ["c"] ["d"]]\n'
result = parser.parseProgram file
expected = ok: yes, data: [['a', ['b']], ['c'], ['d']], rest: ''
data = [["a", "b", "c d"],["e", ["f", ["g"], "h"]], ["i"]]
result = write data
expected = '\n[\n[ "a" "b" "c d" ]\n[ "e" [ "f" [ "g"] "h" ] ]\n[ "i" ]\n]\n'

Test

cd test/
coffee write.coffee
coffee parse.coffee
cd real-demo-test
coffee two-way-check.coffee

License

MIT