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