Skip to content

TheMaverickProgrammer/js_yes_parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YES Script

YES - Your Extensible Script .

YES is a meta scriptlet standard whose elements and meaning are determined by YOU the programmer. They can be extended further with attributes which allow YOUR end-users to make their additions to YOUR elements.

Getting Started

The js API provides a parser which reads an entire file's contents by string. You do not need to split the contents. The parser will do that for you.

YesParser.fromBuffer will return {elements: [], errors: []}

See element.mjs for the API for Element.

Each error take the form {line: Integer, type: String} to report to users.

import { parser, Literal } from './../lib.mjs' import { readFileSync } from 'fs' const buffer = readFileSync('./example/example.mesh', 'utf-8') // Treat content between curly-braces as string literals // for custom parsing later. const literals = [ new Literal('{', '}') ] const results = parser.fromBuffer(buffer, literals)

Example

See the example to learn how to access element data from an example mesh file format which uses the YES scriplet spec.

npm run example

Tests

Node tests are supplied to ensure the parser is spec-compliant and prevent regressions in future updates.

You can run these tests with:

node --test

License

This project is licensed under the Common Development and Distribution License (CDDL).

About

Your Extensible Script bindings for javascript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published