Skip to content

wcjohnson/babylon-lightscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

32e43a0 · Jul 17, 2017
Apr 6, 2017
Feb 28, 2017
Jun 16, 2017
Nov 14, 2016
Jul 16, 2017
Jul 17, 2017
Mar 1, 2017
Oct 15, 2016
Oct 15, 2016
Oct 14, 2016
Jan 17, 2017
Oct 17, 2016
Apr 5, 2017
Jan 10, 2017
Jul 30, 2015
Feb 23, 2017
Feb 12, 2017
Jul 30, 2015
Nov 14, 2016
Apr 7, 2017
Sep 6, 2016
Jul 16, 2017
Oct 26, 2016
Apr 15, 2017

Repository files navigation

@oigroup/babylon-lightscript

NB: This is a fork of babylon-lightscript which implements language changes that are not necessarily endorsed by upstream. Generally speaking, our intent is to closely follow the upstream language -- however, there may be notable deviations which are documented below.

The parser for LightScript. To be used with @oigroup/babel-plugin-lightscript.

A minimally-invasive fork of Babylon. With the exception of a few reserved keywords, it parses JS as JS unless the "lightscript" plugin is passed.

Contributing

yarn
npm run build
npm test

New tests should go in the lightscript directory.

Deviations from LightScript proper

If Statements and Expressions

(See #2)

@oigroup/babylon-lightscript enforces consistent syntax between if statements and if expressions, so that programmers don't encounter land mines when switching between the two. In practical terms, this means:

This is now illegal syntax:

if a: {x} else b

If you use colon syntax on one clause of an if you must use it on all clauses.

This is now legal syntax:

y = if(three()) 3 else 4

Traditional JavaScript if syntax now works with if expressions (as it should, since it works for if statements).

About

⚡️ 📃 A LightScript parser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.6%
  • Makefile 0.4%