Skip to content

kabiroberai/objs-transpiler

master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

objs-transpiler

The syntax transpiler for the ObjectiveScript programming language.

Usage

Setup

Include ob.js in your environment. This might, for example, entail using <script src>, require(), or -[JSContext evaluateScript:].

API

OBJSTranspiler.transpile(source: string, minify: boolean = false): { code: string; map: string; }

Parameters:

  • source: The input source code written in ObjectiveScript
  • minify: A flag which determines whether to minify the output

Returns:

  • code: The generated JavaScript code, compatible with the ObjectiveScript runtime
  • map: A source map representing the entire transformation
OBJSTranspiler.tokenize(source: string): Iterable<acorn.Token>

Parameters:

  • source: The input source code written in ObjectiveScript

Returns: An Iterable of tokens

Development

Start by running npm install to set up the dependencies.

Iteration

Run npm run driver to see the output of transpiling test/app.objs without having to compile the full ob.js file.

Note: At present, the minify parameter cannot be used during iteration because that involves building uglify.js which is an artifact created while performing a full build.

Full Build

Use npm run build to perform a full build. The output will be the ob.js file at the root level of the repository.

Tests

Execute npm test to run the test suite.

Note: Test coverage is currently low, so the results are not a very strong indicator of regressions.

Cleaning

Execute npm run clean.

About

The ObjectiveScript programming language syntax transpiler.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published