sptc 0.0.27 → 0.0.29

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.
@@ -58,11 +58,12 @@ function execute(ctx, ast) {
58
58
  ctx.defs.delete(p.def)
59
59
  }else if(p.type===O_INCLUDE) {
60
60
  const filename=path.resolve(ctx.filename+'/..', p.include)
61
+ ctx.include_files=ctx.include_files || {}
61
62
  if(!p.once || !ctx.include_files[filename]) {
62
63
  const nctx=Object.assign({}, ctx, {filename})
63
- ret+=executeMacroContext(nctx)
64
- ctx.include_files=ctx.include_files || {}
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
- return execute(ctx, ast || compileSptcMacroFile(filename))
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={
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sptc",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "description": "Simple Pretreat Toolkit CLI",
5
5
  "main": "engine/index.js",
6
6
  "engines": {