-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajon.min.js
1 lines (1 loc) · 4.17 KB
/
ajon.min.js
1
!function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){"use strict";Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var c;if(null==this)throw new TypeError('"this" is null or not defined');var d=Object(this),e=d.length>>>0;if(0===e)return-1;var f=+b||0;if(1/0===Math.abs(f)&&(f=0),f>=e)return-1;for(c=Math.max(f>=0?f:e-Math.abs(f),0);e>c;){if(c in d&&d[c]===a)return c;c++}return-1});var c={_classof:function(a){function b(a){return"number"==typeof a.length&&"function"==typeof a.splice&&!a.propertyIsEnumerable("length")}if(void 0===a)return"undefined";if(null===a)return"null";var c=typeof a;return"string"===c||"number"===c||"boolean"===c?c:"object"===c?b(a)?"array":"object":"bad"},_stringifiers:{"null":function(){return"~"},undefined:function(){return"_"},number:function(a){return"("+a.toString()+")"},"boolean":function(a){return a?"@":"!"},string:function(a){return"<"+c._quote(">",a)+">"},object:function(a,b){return"{"+c._serialise(a,b)+"}"},array:function(a,b){return"[("+a.length+"):"+c._serialise(a,b)+"]"},bad:function(){return""}},stringify:function(a,b){return c._stringifiers[c._classof(a)](a,b)},_quote:function(a,b){return b.replace(new RegExp("(["+a+"\\\\])","g"),"\\$1")},_unquote:function(a,b){return b.replace(new RegExp("\\\\(.)","g"),"$1")},_serialise:function(a,b){var d=[];for(var e in a)a.hasOwnProperty(e)&&(b&&-1!==b.indexOf(e)||d.push("<"+c._quote(">",e.toString())+">="+c.stringify(a[e],b)+";"));d.sort();var f="";for(var g in d)d.hasOwnProperty(g)&&(f+=d[g]);return f},machineProto:{tokens:"~_!@<>/=()[]{};:\\",chomp_no_escape:function(){this.yyval=this.input.substr(this.cur,1),this.yytok=-1!==this.tokens.indexOf(this.yyval)?this.yyval:"a",this.cur++},chomp:function(){this.chomp_no_escape(),"\\"===this.yytok&&(this.chomp_no_escape(),this.yytok="a")},getThisToken:function(a){return this.yytok!==a?!1:(this.chomp(),!0)},getUndefined:function(a){return this.getThisToken("_")?(a.val=void 0,!0):!1},getNull:function(a){return this.getThisToken("~")?(a.val=null,!0):!1},getTrue:function(a){return this.getThisToken("@")?(a.val=!0,!0):!1},getFalse:function(a){return this.getThisToken("!")?(a.val=!1,!0):!1},getBoolean:function(a){return this.getTrue(a)||this.getFalse(a)},getInside:function(a,b,c){if(this.yytok!==a)return!1;if(this.input.length-this.cur<1)return!1;var d;if(this.input.substr(this.cur,1)===b)d=0;else if(d=1+this.input.substr(this.cur).search(new RegExp("[^\\\\]\\"+b)),0===d)return!1;return c.val=this.input.substr(this.cur,d),this.cur+=d+1,this.chomp(),!0},getNumber:function(a){var b={};return this.getInside("(",")",b)?(a.val=parseFloat(b.val),!0):!1},getString:function(a){var b={};return this.getInside("<",">",b)?(a.val=c._unquote(">",b.val),!0):!1},getObjectDelimiter:function(a,b){return this.getThisToken(a?"{":"}")?(a&&(b.val={}),!0):!1},getArrayDelimiter:function(a,b){if(!this.getThisToken(a?"[":"]"))return!1;if(a){var c={};this.getNumber(c),b.val=new Array(c.val),this.getThisToken(":")}return!0},getBranchDelimiter:function(a,b){return this.getObjectDelimiter(a,b)||this.getArrayDelimiter(a,b)},getBranch:function(a){var b=this.cur,c=this.tok;if(!this.getBranchDelimiter(!0,a))return!1;for(var d={},e={};this.getString(d)&&this.getThisToken("=",{})&&this.getValue(e)&&this.getThisToken(";",{});)a.val[d.val]=e.val;return this.getBranchDelimiter(!1,{})?!0:(this.tok=c,this.cur=b,!1)},getValue:function(a){return this.getUndefined(a)||this.getNull(a)||this.getNumber(a)||this.getString(a)||this.getBoolean(a)||this.getBranch(a)}},init:function(a){var b=Object.create(this.machineProto);return b.input=a,b.cur=0,b.chomp(),b},parse:function(a){var b={};return c.init(a).getValue(b),b.val}};b.exports=c},{}],2:[function(a){(function(b){b.Ajon=a("./ajon")}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./ajon":1}]},{},[2]);