@makano/rew 1.2.89 → 1.2.901

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.
@@ -23,7 +23,7 @@ module.exports.Usage = class Usage {
23
23
  constructor(name, trigger, save){
24
24
  this.name = name;
25
25
  this.trigger = trigger;
26
- this.save = save;
26
+ this.save = name == '' ? false : save;
27
27
  }
28
28
 
29
29
  create(name, trigger, save = true){
@@ -139,7 +139,7 @@ function declareAlias(aliases, token) {
139
139
  straceLog('==> DECLARE', name, 'as', value);
140
140
 
141
141
  let aliasValue = value.startsWith('${')
142
- ? new Function('token', 'tokens', 'code', 'hooks', value.slice(2, -1))
142
+ ? new Function('token', 'tokens', 'code', 'hooks', 'index', 'setIndex', value.slice(2, -1))
143
143
  : value;
144
144
 
145
145
 
@@ -172,7 +172,7 @@ function declareAlias(aliases, token) {
172
172
  let nextToken = gnextToken(index, offset+1, tokens);
173
173
  const args = nextToken.token.value;
174
174
  setIndex(ti + offset);
175
- return `${nextToken2.value} = ${token.value}(${args}, ${params.trim()})`;
175
+ return `${nextToken2.value} = ${token.value} ${args && args !== '(' ? `${args},` : ''} ${params.trim()}, ${args == '(' ? args : ''}`;
176
176
  } else if(nextToken?.value == ' ' && (isDecOnly || nextToken2?.token.value == '=' || nextToken2?.token.value == ':')){
177
177
  nextToken.value = '';
178
178
  if(isDecOnly){
@@ -229,10 +229,10 @@ const includeFile = (includeContent, options) => {
229
229
  straceLog('==> INCLUDE PACKAGE', filename);
230
230
  if(existsSync(pathname)) r = _inc(pathname);
231
231
  }
232
- if(!dontInclude){
233
- return r;
232
+ if(dontInclude){
233
+ return 'intentional-nothing';
234
234
  }
235
- return "";
235
+ return r;
236
236
  }
237
237
 
238
238
  function useImp(token, options){
@@ -518,7 +518,7 @@ function compileRewStuff(content, options) {
518
518
  const includeContent = token.value.split(' ')[1].trim() || '';
519
519
  const r = includeFile(includeContent, options);
520
520
  if(r){
521
- result += r;
521
+ result += r == 'intentional-nothing' ? '' : r;
522
522
  aliases = {
523
523
  ...aliases,
524
524
  ...execOptions._syntaxAliases
@@ -540,8 +540,6 @@ const compileCivetStuff = (file, options) => {
540
540
  straceLog('OPTION_PREPARE() for CURRENTFILE as', preCompileOptions);
541
541
  const prepared = compileRewStuff(file.content, preCompileOptions);
542
542
 
543
- // console.log(prepared);
544
-
545
543
  const compileOptions = {
546
544
  ...preCompileOptions,
547
545
  bare: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makano/rew",
3
- "version": "1.2.89",
3
+ "version": "1.2.901",
4
4
  "description": "A simple coffescript runtime and app manager",
5
5
  "main": "main.js",
6
6
  "directories": {