fix test
This commit is contained in:
parent
c87b2ccde9
commit
62bf16fdcd
@ -22,9 +22,9 @@ node test.js --c=<your_config>.js
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Also
|
## Also
|
||||||
You can use this syntax for include your code here.
|
You can use this syntax for include your *.y file.
|
||||||
```bash
|
```bash
|
||||||
<&&REPLACER{<file_path>}&&>
|
<&&REPLACER{<file_path>}&&>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Special Directives
|
## Special Directives
|
||||||
|
21
main.js
21
main.js
@ -31,15 +31,20 @@ var temp_fn_out = "temp_" + "file_name" + ".out";
|
|||||||
var update_parser_y = function () {
|
var update_parser_y = function () {
|
||||||
var source_parser_y = fs.readFileSync(parser_path + fn_y, "utf8");
|
var source_parser_y = fs.readFileSync(parser_path + fn_y, "utf8");
|
||||||
|
|
||||||
var result = /&&.*?REPLACER\{(.*?)\}&&/gm.exec(source_parser_y);
|
source_parser_y = source_parser_y.replace(/&&.*?REPLACER\{(.*?)\}&&/gm, function (match, file_path, offset, string) {
|
||||||
if(result) {
|
return fs.readFileSync(file_path, "utf8");
|
||||||
var file_path = result[1];
|
});
|
||||||
var process_code = fs.readFileSync(file_path, "utf8");
|
|
||||||
|
|
||||||
source_parser_y = source_parser_y.replace(/&&.*?REPLACER\{(.*?)\}&&/gm, process_code);
|
fs.writeFileSync(parser_path + temp_fn_y, source_parser_y);
|
||||||
|
// var result = /&&.*?REPLACER\{(.*?)\}&&/gm.exec(source_parser_y);
|
||||||
fs.writeFileSync(parser_path + temp_fn_y, source_parser_y);
|
// if(result) {
|
||||||
}
|
// var file_path = result[1];
|
||||||
|
// var process_code = fs.readFileSync(file_path, "utf8");
|
||||||
|
//
|
||||||
|
// source_parser_y = source_parser_y.replace(/&&.*?REPLACER\{(.*?)\}&&/gm, process_code);
|
||||||
|
//
|
||||||
|
// fs.writeFileSync(parser_path + temp_fn_y, source_parser_y);
|
||||||
|
// }
|
||||||
};
|
};
|
||||||
|
|
||||||
var post_process_parser = function () {
|
var post_process_parser = function () {
|
||||||
|
Loading…
Reference in New Issue
Block a user