/soyjs-compile

Google Closure Template JS Compiler written in javascript

Primary LanguageJavaScript

/*
 * The contents of this repository are subject to the Mozilla Public License
 * Version 1.1 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.mozilla.org/MPL/

 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
*/
Google Closure Template Javascript Compiler
- written in javascript

NOTE: this is very beta, it is nowhere near feature complete.  This is basically a proof of concept at this point.

Instructions:
$ npm install pegjs
$ node compile.js

How it works:
You will find a PEG (Parsing Expression Grammar) file in ./peg which is responsible for parsing the closure template
and returning a javascript data structure.  This .pegjs file can be compiled using the pegjs npm module, but for
simplicity, I've included a compiled version in ./soyparser.js.

compile.js is responsible for turning the parsed javascript data structure into javascript code.  The intention
thus far is to not re-use google's soy.js file, but that may be reconsidered later.