sptc 0.0.28 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/engine/interpreter-macro.js +10 -2
- package/package.json +1 -1
|
@@ -61,8 +61,9 @@ function execute(ctx, ast) {
|
|
|
61
61
|
ctx.include_files=ctx.include_files || {}
|
|
62
62
|
if(!p.once || !ctx.include_files[filename]) {
|
|
63
63
|
const nctx=Object.assign({}, ctx, {filename})
|
|
64
|
-
|
|
64
|
+
nctx.parentCtx=ctx
|
|
65
65
|
ctx.include_files[filename]=true
|
|
66
|
+
ret+=executeMacroContext(nctx)
|
|
66
67
|
}
|
|
67
68
|
}else{
|
|
68
69
|
throw new Error('unsupported node: '+JSON.stringify(p))
|
|
@@ -73,7 +74,14 @@ function execute(ctx, ast) {
|
|
|
73
74
|
|
|
74
75
|
function executeMacroContext(ctx, ast) {
|
|
75
76
|
const {filename}=ctx
|
|
76
|
-
|
|
77
|
+
try{
|
|
78
|
+
return execute(ctx, ast || compileSptcMacroFile(filename))
|
|
79
|
+
}catch(e) {
|
|
80
|
+
if(ctx.parentCtx) {
|
|
81
|
+
console.log("Error in compile:", ctx.parentCtx.filename)
|
|
82
|
+
}
|
|
83
|
+
throw e
|
|
84
|
+
}
|
|
77
85
|
}
|
|
78
86
|
|
|
79
87
|
module.exports={
|