Skip to content

Commit

Permalink
⬆️
Browse files Browse the repository at this point in the history
  • Loading branch information
kobezzza committed Nov 24, 2017
1 parent c96961d commit b61820b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Released under the MIT license
* https://github.com/MonicBuilder/Monic/blob/master/LICENSE
*
* Date: Thu, 23 Nov 2017 16:05:19 GMT
* Date: Fri, 24 Nov 2017 13:37:22 GMT
*/

'use strict';
Expand Down
28 changes: 22 additions & 6 deletions dist/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Released under the MIT license
* https://github.com/MonicBuilder/Monic/blob/master/LICENSE
*
* Date: Thu, 23 Nov 2017 16:05:19 GMT
* Date: Fri, 24 Nov 2017 13:37:22 GMT
*/

'use strict';
Expand Down Expand Up @@ -208,7 +208,10 @@ class FileStructure {
lte: true,
has: true,
call: true,
like: true
callRight: true,
like: true,
instanceof: true,
typeof: true
};

if (!validIf[this.currentBlock.type]) {
Expand Down Expand Up @@ -388,13 +391,11 @@ class FileStructure {
break;

case 'eq':
// eslint-disable-next-line
res = flagVal == blockVal;
res = flagVal === blockVal;
break;

case 'ne':
// eslint-disable-next-line
res = flagVal != blockVal;
res = flagVal !== blockVal;
break;

case 'gt':
Expand Down Expand Up @@ -438,6 +439,21 @@ class FileStructure {
}

break;

case 'callRight':
if (typeof blockVal === 'function') {
res = blockVal({ flag: flag, value: flagVal, flags: flags, labels: labels });
}

break;

case 'typeof':
res = typeof flagVal === String(blockVal);
break;

case 'instanceof':
res = flagVal instanceof blockVal;
break;
}

if (block.unless) {
Expand Down
3 changes: 1 addition & 2 deletions dist/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Released under the MIT license
* https://github.com/MonicBuilder/Monic/blob/master/LICENSE
*
* Date: Thu, 23 Nov 2017 16:05:19 GMT
* Date: Fri, 24 Nov 2017 13:37:22 GMT
*/

'use strict';
Expand Down Expand Up @@ -437,7 +437,6 @@ class Parser {
el = $C(el).reduce(function (map, el) {
return map[el] = true, map;
}, {});

struct.addWithout((yield _this6.parseFile(struct.getRelativePathOf(includeFileName))).fileStructure, el);
});

Expand Down

0 comments on commit b61820b

Please sign in to comment.