UNPKG

ut-tools

Version:

Build and Release management automation package.

3 lines (2 loc) 703 B
var index=function(){"use strict";return{name:"ternary",init(e){e.hooks.add("after-expression",(function(t){if(t.node&&this.code===e.QUMARK_CODE){this.index++;const o=t.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),t.node={type:"ConditionalExpression",test:o,consequent:r,alternate:i},o.operator&&e.binary_ops[o.operator]<=.9){let r=o;for(;r.right.operator&&e.binary_ops[r.right.operator]<=.9;)r=r.right;t.node.test=r.right,r.right=t.node,t.node=o}}else this.throwError("Expected :")}}))}}}(); //# sourceMappingURL=index.iife.min.js.map