@tearflake/sexpression

1.0.7 • Public • Published

sexpression v1.0.7

S-expression is a formal language for representing data and code. Sexpression project is an implementation of S-expression language parser.

project specifics

This package contains a version of S-expression parser written in Javascript. Beside ordinary S-expression support, it features peculiar style comments and indent sensitive multi-line strings. Shortly, we expose all of its main features by the following example:

///
this is a
multi-line
comment
///

(
    atom
    
    (
        /this is a comment/
        this is a list
        (
            /one more comment/ one more list /also a comment/
        )
    )
    
    "this is a unicode string \u2717 \u2714"
    
    (more atoms)
    
    """
    this is a
    multi-line
    string
    """
)

resources

javascript API access

Sexpression may bring its functionality through javascript API, both in Node.js and browser.

To access the API from Node.js, install it by: npm i @tearflake/sexpression, and include the following line in your code:

const Sexpression = require('@tearflake/sexpression');

To access the API from browser, clone this repository from GitHub: git clone https://github.com/tearflake/sexpression, and include the following line in your code:

<script src="./src/sexpression.js"></script>

Below, in both cases, use the package as:

var arrOutput = Sexpression.parse('(a b c)');
console.log(JSON.stringify(arrOutput, null, 4));

Dependents (0)

Package Sidebar

Install

npm i @tearflake/sexpression

Weekly Downloads

59

Version

1.0.7

License

MIT

Unpacked Size

50.6 kB

Total Files

9

Last publish

Collaborators

  • tearflake