This commit is contained in:
Aleksey Chichenkov 2019-01-29 12:00:02 +03:00
parent e56a8a7d9a
commit 41ef9f77ab
2 changed files with 24 additions and 3 deletions

View File

@ -10,11 +10,23 @@ npm install
You need create your config.js from config.template
```bash
npm main --c=<your_config>.js --t=<web|node>
node main.js --c=<your_config>.js --t=<web|node>
```
default config -> config.js
## Test
Also you can test your parser
```bash
node test.js --c=<your_config>.js
```
## Also
You can use <&&REPLACER{<file_path>}&&> syntax for include your code here
```bash
```
## Special Directives
See lemon.html for additional documentation.
@ -44,4 +56,4 @@ See lemon.html for additional documentation.
- %token_class - **NOT SUPPORTED**
## Original project
See https://github.com/sormy/lemon-js.
See https://github.com/sormy/lemon-js

11
test.js
View File

@ -5,7 +5,16 @@
var fs = require("fs");
var exec = require('child_process').exec;
exec("node main.js -o=config.js -t=node", function(err, stdout, stderr) {
var cfg_path = "config.js";
var config;
if(args["c"] !== undefined) {
config = require("./" + args["c"]);
cfg_path = args["c"];
} else {
config = require("./config.js");
}
exec("node main.js -o=" + cfg_path + " -t=node", function(err, stdout, stderr) {
err && console.log("ERROR: ", err);
err && process.exit(1);