ProgClub.js
ProgClub.js is the ProgClub JavaScript pretty printer. That's the software that formats your JavaScript code according to the ProgClub standard JavaScript format. For other projects see projects.
Status
Under way. Not released yet, there's stuff TODO.
Motivation
Why this software? Because we wanted a pretty-printer for dealing with (normalizing) the syntax used by the JsPHP upstream developers. By normalizing the code we wanted to import we could fix issues with the syntax we didn't like (they don't use semicolons!) and also make sure whitespace changes were irrelevant.
Administration
Contributors
Members who have contributed to this project. Newest on top.
All contributors have agreed to the terms of the Contributor License Agreement. This excludes any upstream contributors who tend to have different administrative frameworks.
Upstream contributors:
Copyright
Copyright 2016, Contributors.
License
Licensed under the MIT license.
Components
Libraries, tools, services or media from third parties used under license:
- ANTLR4 (the tool and the JavaScript target)
- require.js
Resources
Downloads
No downloads at this time.
Source code
The repository can be browsed online:
https://www.progclub.org/pcrepo/progclub.js/branches/0.1
The latest stable released version of the code is available from:
https://www.progclub.org/svn/pcrepo/progclub.js/tags/latest/0.1
Or if you want the latest version for development purposes:
https://www.progclub.org/svn/pcrepo/progclub.js/branches/0.1
Links
Specifications
Functional specification
The functional specification describes what the project does.
The software processes an input JavaScript file and outputs that file in the ProgClub standard JavaScript format. It can be run on the command-line (in Node.js) or in a web browser.
Technical specification
The technical specification describes how the project works.
The project uses an ANTLR4 compiler compiler to generate an ECMAScript (Standard ECMA-262 5.1 Edition from June 2011) lexer/parser which we use in a custom processor (written in JavaScript) which formats output.
Notes
Notes for implementers
If you are interested in incorporating this software into your project, here's what you need to know:
Copy and paste your way to victory!
Notes for developers
If you're looking to set up a development environment for this project here's what you need to know:
Generating the lexer/parser
To generate the lexer/parser you need to use the ANTLR4 tool, which is a Java application. You only need to do this if you've modified the ECMAScript grammar. Run the build-parser.sh script to update the lexer/parser components:
$ ./build-parser.sh
Testing the pretty printer
To test the pretty printer on the command-line (you need a recent version of Node.js installed) use the run.sh script:
$ ./run.sh
TODO: explain how to run in a browser. Or on Windows.
Tasks
TODO
Things to do, in rough order of priority:
- Get dumb (single policy) pretty printing done
- Get smart (context aware) pretty printing done
Done
Stuff that's done. Latest stuff on top.