-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
28 lines (23 loc) · 1.21 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
* 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.