@port-labs/jq-node-bindings 0.0.1

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.
Files changed (131) hide show
  1. package/.editorconfig +5 -0
  2. package/.jshintignore +1 -0
  3. package/.jshintrc +23 -0
  4. package/binding.gyp +56 -0
  5. package/configure +26 -0
  6. package/deps/jq/.gitattributes +2 -0
  7. package/deps/jq/.travis.yml +53 -0
  8. package/deps/jq/AUTHORS +73 -0
  9. package/deps/jq/COPYING +70 -0
  10. package/deps/jq/ChangeLog +1349 -0
  11. package/deps/jq/Makefile.am +198 -0
  12. package/deps/jq/NEWS +88 -0
  13. package/deps/jq/README.md +64 -0
  14. package/deps/jq/builtin.c +1684 -0
  15. package/deps/jq/builtin.h +10 -0
  16. package/deps/jq/bytecode.c +161 -0
  17. package/deps/jq/bytecode.h +92 -0
  18. package/deps/jq/compile-ios.sh +102 -0
  19. package/deps/jq/compile.c +1210 -0
  20. package/deps/jq/compile.h +101 -0
  21. package/deps/jq/config/m4/check-math-func.m4 +4 -0
  22. package/deps/jq/config/m4/find-func-no-libs.m4 +8 -0
  23. package/deps/jq/config/m4/find-func-no-libs2.m4 +62 -0
  24. package/deps/jq/config/m4/find-func.m4 +9 -0
  25. package/deps/jq/config/m4/misc.m4 +3 -0
  26. package/deps/jq/configure.ac +221 -0
  27. package/deps/jq/docs/Gemfile +7 -0
  28. package/deps/jq/docs/Gemfile.lock +63 -0
  29. package/deps/jq/docs/README.md +25 -0
  30. package/deps/jq/docs/Rakefile +145 -0
  31. package/deps/jq/docs/content/1.tutorial/default.yml +327 -0
  32. package/deps/jq/docs/content/2.download/default.yml +117 -0
  33. package/deps/jq/docs/content/3.manual/manual.yml +2878 -0
  34. package/deps/jq/docs/content/3.manual/v1.3/manual.yml +1270 -0
  35. package/deps/jq/docs/content/3.manual/v1.4/manual.yml +1672 -0
  36. package/deps/jq/docs/content/index/index.yml +51 -0
  37. package/deps/jq/docs/default_manpage.md +22 -0
  38. package/deps/jq/docs/public/.htaccess +28 -0
  39. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.css +1058 -0
  40. package/deps/jq/docs/public/bootstrap/css/bootstrap-responsive.min.css +9 -0
  41. package/deps/jq/docs/public/bootstrap/css/bootstrap.css +5224 -0
  42. package/deps/jq/docs/public/bootstrap/css/bootstrap.min.css +9 -0
  43. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings-white.png +0 -0
  44. package/deps/jq/docs/public/bootstrap/img/glyphicons-halflings.png +0 -0
  45. package/deps/jq/docs/public/bootstrap/js/bootstrap.js +2027 -0
  46. package/deps/jq/docs/public/bootstrap/js/bootstrap.min.js +6 -0
  47. package/deps/jq/docs/public/css/base.scss +99 -0
  48. package/deps/jq/docs/public/jq.png +0 -0
  49. package/deps/jq/docs/public/robots.txt +2 -0
  50. package/deps/jq/docs/site.yml +18 -0
  51. package/deps/jq/docs/templates/default.liquid +34 -0
  52. package/deps/jq/docs/templates/index.liquid +60 -0
  53. package/deps/jq/docs/templates/manual.liquid +122 -0
  54. package/deps/jq/docs/templates/shared/_footer.liquid +5 -0
  55. package/deps/jq/docs/templates/shared/_head.liquid +12 -0
  56. package/deps/jq/docs/templates/shared/_header.liquid +26 -0
  57. package/deps/jq/exec_stack.h +112 -0
  58. package/deps/jq/execute.c +1155 -0
  59. package/deps/jq/inject_errors.c +112 -0
  60. package/deps/jq/jq.1.default +39 -0
  61. package/deps/jq/jq.1.prebuilt +3075 -0
  62. package/deps/jq/jq.h +60 -0
  63. package/deps/jq/jq.spec +70 -0
  64. package/deps/jq/jq_parser.h +9 -0
  65. package/deps/jq/jq_test.c +346 -0
  66. package/deps/jq/jv.c +1333 -0
  67. package/deps/jq/jv.h +240 -0
  68. package/deps/jq/jv_alloc.c +179 -0
  69. package/deps/jq/jv_alloc.h +27 -0
  70. package/deps/jq/jv_aux.c +619 -0
  71. package/deps/jq/jv_dtoa.c +4275 -0
  72. package/deps/jq/jv_dtoa.h +22 -0
  73. package/deps/jq/jv_file.c +49 -0
  74. package/deps/jq/jv_parse.c +852 -0
  75. package/deps/jq/jv_print.c +348 -0
  76. package/deps/jq/jv_unicode.c +96 -0
  77. package/deps/jq/jv_unicode.h +11 -0
  78. package/deps/jq/jv_utf8_tables.h +37 -0
  79. package/deps/jq/lexer.c +2442 -0
  80. package/deps/jq/lexer.h +362 -0
  81. package/deps/jq/lexer.l +184 -0
  82. package/deps/jq/libm.h +160 -0
  83. package/deps/jq/linker.c +393 -0
  84. package/deps/jq/linker.h +7 -0
  85. package/deps/jq/locfile.c +91 -0
  86. package/deps/jq/locfile.h +29 -0
  87. package/deps/jq/m4/ax_compare_version.m4 +177 -0
  88. package/deps/jq/m4/ax_prog_bison_version.m4 +68 -0
  89. package/deps/jq/main.c +566 -0
  90. package/deps/jq/opcode_list.h +44 -0
  91. package/deps/jq/parser.c +3914 -0
  92. package/deps/jq/parser.h +193 -0
  93. package/deps/jq/parser.y +923 -0
  94. package/deps/jq/scripts/crosscompile +42 -0
  95. package/deps/jq/scripts/gen_utf8_tables.py +32 -0
  96. package/deps/jq/scripts/version +5 -0
  97. package/deps/jq/setup.sh +33 -0
  98. package/deps/jq/tests/jq.test +1235 -0
  99. package/deps/jq/tests/jqtest +5 -0
  100. package/deps/jq/tests/mantest +7 -0
  101. package/deps/jq/tests/modules/.jq +5 -0
  102. package/deps/jq/tests/modules/a.jq +2 -0
  103. package/deps/jq/tests/modules/b/b.jq +2 -0
  104. package/deps/jq/tests/modules/c/c.jq +16 -0
  105. package/deps/jq/tests/modules/c/d.jq +1 -0
  106. package/deps/jq/tests/modules/data.json +4 -0
  107. package/deps/jq/tests/modules/lib/jq/e/e.jq +1 -0
  108. package/deps/jq/tests/modules/lib/jq/f.jq +1 -0
  109. package/deps/jq/tests/modules/syntaxerror/syntaxerror.jq +1 -0
  110. package/deps/jq/tests/modules/test_bind_order.jq +4 -0
  111. package/deps/jq/tests/modules/test_bind_order0.jq +1 -0
  112. package/deps/jq/tests/modules/test_bind_order1.jq +2 -0
  113. package/deps/jq/tests/modules/test_bind_order2.jq +2 -0
  114. package/deps/jq/tests/onig.supp +21 -0
  115. package/deps/jq/tests/onig.test +85 -0
  116. package/deps/jq/tests/onigtest +5 -0
  117. package/deps/jq/tests/setup +36 -0
  118. package/deps/jq/tests/shtest +205 -0
  119. package/deps/jq/tests/torture/input0.json +7 -0
  120. package/deps/jq/util.c +462 -0
  121. package/deps/jq/util.h +64 -0
  122. package/deps/jq.gyp +35 -0
  123. package/index.d.ts +3 -0
  124. package/jest.config.js +10 -0
  125. package/lib/index.js +14 -0
  126. package/package.json +48 -0
  127. package/reports/jest-port-api.xml +35 -0
  128. package/src/binding.cc +177 -0
  129. package/src/binding.h +13 -0
  130. package/test/santiy.test.js +122 -0
  131. package/util/configure.js +27 -0
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Bootstrap.js by @fat & @mdo
3
+ * Copyright 2012 Twitter, Inc.
4
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
5
+ */
6
+ !function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){i(e(t)).removeClass("open")}function i(t){var n=t.attr("data-target"),r;return n||(n=t.attr("href"),n=n&&/#/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,"")),r=e(n),r.length||(r=t.parent()),r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||(s.toggleClass("open"),n.focus()),!1},keydown:function(t){var n,r,s,o,u,a;if(!/(38|40|27)/.test(t.keyCode))return;n=e(this),t.preventDefault(),t.stopPropagation();if(n.is(".disabled, :disabled"))return;o=i(n),u=o.hasClass("open");if(!u||u&&t.keyCode==27)return n.click();r=e("[role=menu] li:not(.divider) a",o);if(!r.length)return;a=r.index(r.filter(":focus")),t.keyCode==38&&a>0&&a--,t.keyCode==40&&a<r.length-1&&a++,~a||(a=0),r.eq(a).focus()}},e.fn.dropdown=function(t){return this.each(function(){var r=e(this),i=r.data("dropdown");i||r.data("dropdown",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.dropdown.Constructor=n,e(function(){e("html").on("click.dropdown.data-api touchstart.dropdown.data-api",r),e("body").on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",t,n.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",t+", [role=menu]",n.prototype.keydown)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=n,this.$element=e(t).delegate('[data-dismiss="modal"]',"click.dismiss.modal",e.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};t.prototype={constructor:t,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var t=this,n=e.Event("show");this.$element.trigger(n);if(this.isShown||n.isDefaultPrevented())return;e("body").addClass("modal-open"),this.isShown=!0,this.escape(),this.backdrop(function(){var n=e.support.transition&&t.$element.hasClass("fade");t.$element.parent().length||t.$element.appendTo(document.body),t.$element.show(),n&&t.$element[0].offsetWidth,t.$element.addClass("in").attr("aria-hidden",!1).focus(),t.enforceFocus(),n?t.$element.one(e.support.transition.end,function(){t.$element.trigger("shown")}):t.$element.trigger("shown")})},hide:function(t){t&&t.preventDefault();var n=this;t=e.Event("hide"),this.$element.trigger(t);if(!this.isShown||t.isDefaultPrevented())return;this.isShown=!1,e("body").removeClass("modal-open"),this.escape(),e(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),e.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var t=this;e(document).on("focusin.modal",function(e){t.$element[0]!==e.target&&!t.$element.has(e.target).length&&t.$element.focus()})},escape:function(){var e=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(t){t.which==27&&e.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var t=this,n=setTimeout(function(){t.$element.off(e.support.transition.end),t.hideModal()},500);this.$element.one(e.support.transition.end,function(){clearTimeout(n),t.hideModal()})},hideModal:function(e){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(t){var n=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var i=e.support.transition&&r;this.$backdrop=e('<div class="modal-backdrop '+r+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var t=e(this),n=t.data("target")||t.attr("href"),r=/^#\w/.test(n)&&e(n);return r&&r.length&&[[r.position().top,n]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}},e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=e(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length<this.options.minLength?this.shown?this.hide():this:(n=e.isFunction(this.source)?this.source(this.query,e.proxy(this.process,this)):this.source,n?this.process(n):this)},process:function(t){var n=this;return t=e.grep(t,function(e){return n.matcher(e)}),t=this.sorter(t),t.length?this.render(t.slice(0,this.options.items)).show():this.shown?this.hide():this},matcher:function(e){return~e.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(e){var t=[],n=[],r=[],i;while(i=e.shift())i.toLowerCase().indexOf(this.query.toLowerCase())?~i.indexOf(this.query)?n.push(i):r.push(i):t.push(i);return t.concat(n,r)},highlighter:function(e){var t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return e.replace(new RegExp("("+t+")","ig"),function(e,t){return"<strong>"+t+"</strong>"})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),(e.browser.chrome||e.browser.webkit||e.browser.msie)&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this))},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=!~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(e){var t=this;setTimeout(function(){t.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")}},e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>',minLength:1},e.fn.typeahead.Constructor=t,e(function(){e("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery);
@@ -0,0 +1,99 @@
1
+ @charset "utf-8";
2
+ body {
3
+ padding-top: 60px;
4
+ }
5
+
6
+ footer {
7
+ background-color: #F5F5F5;
8
+ padding: 40px 0;
9
+ height: 100px;
10
+ margin-top: 40px;
11
+ color: #999999;
12
+ }
13
+
14
+ section {
15
+ padding-top: 30px;
16
+ }
17
+
18
+ .manual-example {
19
+ border-top: 1px solid #E5E5E5;
20
+ }
21
+
22
+ .manual-example td {
23
+ white-space: pre-wrap;
24
+ font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
25
+ }
26
+
27
+ .manual-example td.jqprogram {
28
+ font-weight: bold;
29
+ }
30
+
31
+ .manual-example th {
32
+ text-align: right;
33
+ padding-right: 10px;
34
+ }
35
+
36
+ .tutorial-example {
37
+ position: relative;
38
+ margin-bottom: 10px;
39
+ }
40
+
41
+ .tutorial-example pre {
42
+ margin-bottom: 0px;
43
+ }
44
+
45
+ .tutorial-example a {
46
+ position: absolute;
47
+ top: 0px;
48
+ right: 0px;
49
+ padding: 15px 8px;
50
+ color: #777777;
51
+ font-weight: bold;
52
+ line-height: 10px;
53
+ font-size: 12px;
54
+ border-left: 1px solid #DDDDDD;
55
+ bottom: 0;
56
+ display: block;
57
+ }
58
+
59
+
60
+
61
+ #blurb {
62
+ padding-top: 40px;
63
+ padding-right: 50px;
64
+ }
65
+
66
+ #blurb p {
67
+ font-size: 20pt;
68
+ }
69
+
70
+ #blurb .btn-group {
71
+ margin-top: 20px;
72
+ }
73
+
74
+ #multiblurb {
75
+ line-height: 1.7;
76
+ text-align: center;
77
+ font-size: 12pt;
78
+ }
79
+
80
+ #multiblurb code {
81
+ border: 0;
82
+ font-size: 12pt;
83
+ }
84
+
85
+ h3 code {
86
+ border: 0;
87
+ font-size: 20px;
88
+ }
89
+
90
+ footer {
91
+ text-align: center;
92
+ }
93
+
94
+ #news {
95
+ font-size: 12pt;
96
+ .date {
97
+ font-style: italic;
98
+ }
99
+ }
Binary file
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Allow: /
@@ -0,0 +1,18 @@
1
+ # The key value pairs found below are available within the templates.
2
+
3
+ :url: http://stedolan.github.io/jq
4
+
5
+ # This line is modified by the Makefile. To change the version number,
6
+ # edit the Autoconf version number at the top of configure.ac
7
+ jq_version: "1.4-2-g15c4a7f-dirty"
8
+
9
+ root: '/jq'
10
+ footer: |
11
+
12
+ This website is made with [Bonsai](http://www.tinytree.info) and
13
+ [Twitter Bootstrap](http://twitter.github.com/bootstrap/), themed
14
+ with [Bootswatch](http://bootswatch.com).
15
+
16
+ jq is licensed under the MIT license (code) and the
17
+ [CC-BY-3.0](http://creativecommons.org/licenses/by/3.0/) license
18
+ (docs).
@@ -0,0 +1,34 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}">
5
+ {% include "shared/header" %}
6
+
7
+ <div class="container">
8
+
9
+ <div class="row">
10
+ <h1>{{headline}}</h1>
11
+ {% for item in body %}
12
+ {% if item.text %}
13
+ {{ item.text | replace: '$JQ_VERSION', jq_version | markdownify }}
14
+ {% endif %}
15
+
16
+ {% if item.command %}
17
+
18
+
19
+ {% capture resultID %}{{ "result" | unique}}{% endcapture %}
20
+ <div class="tutorial-example">
21
+ <div class="accordion-heading">
22
+ <pre>{{item.command}}</pre>
23
+ <a data-toggle="collapse" href="#{{resultID}}">Show result</a>
24
+ </div>
25
+ <div id="{{resultID}}" class="accordion-body collapse"><pre>{{item.result}}</pre></div>
26
+ </div>
27
+ {% endif %}
28
+ {% endfor %}
29
+ </div>
30
+ </div>
31
+ {% include "shared/footer" %}
32
+
33
+ </body>
34
+ </html>
@@ -0,0 +1,60 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}">
5
+ {% include "shared/header" %}
6
+
7
+ <div class="container">
8
+ <div class="row">
9
+ <div class="hero-unit">
10
+ <img src="{{root}}/jq.png" style="width: 400px; height: 220px; float: left; margin-right: 60px">
11
+ <div id="blurb">
12
+ {{blurb | markdownify}}
13
+
14
+ <div class="btn-group" style="float:right">
15
+ <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
16
+ Download jq-{{jq_version}}
17
+ <span class="caret"></span>
18
+ </a>
19
+ <ul class="dropdown-menu">
20
+ <li><a href="{{root}}/download/linux64/jq">Linux (64-bit)</a></li>
21
+ <li><a href="{{root}}/download/osx64/jq">OS X (64-bit)</a></li>
22
+ <li><a href="{{root}}/download/solaris11-64/jq">Solaris (64-bit)</a></li>
23
+ <li><a href="{{root}}/download/win64/jq.exe">Windows (64-bit)</a></li>
24
+ <li><a href="{{root}}/download/">Other platforms, older versions, and source</a></li>
25
+ </ul>
26
+ </div>
27
+
28
+ <div class="btn-group" style="float:right">
29
+ <a class="btn btn-primary" href="https://jqplay.org">
30
+ Try online at jqplay.org!
31
+ </a>
32
+ </div>
33
+
34
+ </div>
35
+ <div style="clear:both;"></div>
36
+ </div>
37
+ </div>
38
+
39
+ <div class="row" id="multiblurb">
40
+ <div class="span4">{{body1 | markdownify}}</div>
41
+ <div class="span4">{{body2 | markdownify}}</div>
42
+ <div class="span4">{{body3 | markdownify}}</div>
43
+ </div>
44
+ <div class="row" style="text-align:center; margin-top: 30px">
45
+ {{tail | markdownify}}
46
+ </div>
47
+ <div class="row">
48
+ <h2>News</h2>
49
+ <div id="news">
50
+ <ul>
51
+ {% for item in news %}
52
+ <li><span class="date">{{ item.date | date: '%m %B %Y' }}</span>{{item.body | markdownify}}</li>
53
+ {% endfor %}
54
+ </ul>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ {% include "shared/footer" %}
59
+ </body>
60
+ </html>
@@ -0,0 +1,122 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ {% include "shared/head" %}
4
+ <body id="{{slug}}" data-spy="scroll" data-target="#navcolumn" data-offset="100">
5
+ {% include "shared/header" %}
6
+ <div class="container">
7
+ <div class="row">
8
+ <div class="span3" id="navcolumn">
9
+ <div class="affix">
10
+ <h4>Contents</h4>
11
+ <ul class="nav nav-pills nav-stacked">
12
+ {% for section in sections %}
13
+ <li {% if forloop.first %} class="active" {% endif %}>
14
+ <a href="#{{section.title | sanitize}}">{{section.title}}</a>
15
+ </li>
16
+ {% endfor %}
17
+ </ul>
18
+ <form class="form-search">
19
+ <script type="text/javascript">
20
+ var section_map = {
21
+ {% for section in sections %}
22
+ {% for entry in section.entries %}
23
+ {{entry.title | json}} : {{entry.title | sanitize | json}},
24
+ {% endfor %}
25
+ {{section.title | json}} : {{section.title | sanitize | json}}
26
+ {% unless forloop.last %},{% endunless %}
27
+ {% endfor %}
28
+ };
29
+ var section_names = $.map(section_map, function(v,k){return k});
30
+ $(function(){
31
+ $('#searchbox').typeahead({source: section_names})
32
+ $('#searchbox').change(function() {
33
+ if ($(this).val() in section_map) {
34
+ location.hash = '#' + section_map[$(this).val()];
35
+ }
36
+ });
37
+ });
38
+ // add "Run" button to execute examples on jqplay.org
39
+ $(function() {
40
+ $.each($('table.manual-example'), function(index, value) {
41
+ $value = $(value)
42
+ var j = $value.find('tr:nth-child(2) td:first').text();
43
+ var q = $value.find('.jqprogram').text().replace(/^jq /, '').replace(/^'(.+)'$/, '$1');
44
+ var url = 'https://jqplay.org/jq?q=' + encodeURIComponent(q) +'&j=' + encodeURIComponent(j)
45
+ var $last_tr = $value.find('tr:last');
46
+ $last_tr.after('<tr><th><a href="' + url + '" class="btn btn-primary btn-small">Run</a></th><th></th></tr><tr><th></th><th></th></tr>');
47
+ });
48
+ });
49
+ </script>
50
+ <input type="text"
51
+ class="input-medium search-query"
52
+ placeholder="Search"
53
+ autocomplete="off"
54
+ id="searchbox">
55
+ </form>
56
+ </div>
57
+ </div>
58
+ <div class="span9">
59
+ <h1>{{headline}}</h1>
60
+ {{ history | markdownify }}
61
+ {{ body | markdownify }}
62
+ {% for section in sections %}
63
+ <section id="{{section.title | sanitize}}">
64
+ <h2>{{section.title}}</h2>
65
+ {{section.body | markdownify}}
66
+ {% for entry in section.entries %}
67
+ <section id="{{entry.title | sanitize}}">
68
+ <h3>
69
+ {{entry.title | markdownify}}
70
+ {% if entry.subtitle %}<small>{{entry.subtitle}}</small>{% endif %}
71
+ </h3>
72
+ {{entry.body | markdownify}}
73
+
74
+ {% if entry.examples %}
75
+ <div>
76
+ {% capture exampleID %}{{ "" | unique }}{% endcapture %}
77
+ <a data-toggle="collapse" href="#example{{exampleID}}">
78
+ <i class="icon-chevron-right"></i>
79
+ {% if entry.examples[1] %}Examples{%else%}Example{%endif%}
80
+ </a>
81
+ <div id="example{{exampleID}}" class="collapse">
82
+
83
+ {% for example in entry.examples %}
84
+ <table class="manual-example">
85
+ <tr><th></th><td class="jqprogram">jq '{{example.program | escape}}'</td></tr>
86
+ <tr><th>Input</th><td>{{example.input | escape}}</td></tr>
87
+ {% unless example.output[0] %}
88
+ <tr>
89
+ <th>Output</th>
90
+ <td><i>none</i></td>
91
+ </tr>
92
+ {% endunless %}
93
+ {% for output in example.output %}
94
+ <tr>
95
+ {% if forloop.index == 1 %}
96
+ <th>Output</th>
97
+ {% else %}
98
+ <th></th>
99
+ {% endif %}
100
+ <td>{{output | escape}}</td>
101
+ </tr>
102
+ {% endfor %}
103
+
104
+ </table>
105
+ {% endfor %}
106
+ </div>
107
+ </div>
108
+ {% endif %}
109
+ </section>
110
+ {% endfor %}
111
+ </section>
112
+ {% endfor %}
113
+ </div>
114
+ </div>
115
+
116
+
117
+ </div>
118
+ {% include "shared/footer" %}
119
+ </body>
120
+
121
+
122
+ </html>
@@ -0,0 +1,5 @@
1
+ <footer>
2
+ <div class="container">
3
+ {{ footer | markdownify }}
4
+ </div>
5
+ </footer>
@@ -0,0 +1,12 @@
1
+ <head>
2
+ <meta charset=UTF-8>
3
+ <title>{{headline}}</title>
4
+ <link rel="stylesheet" href="{{root}}/bootstrap/css/bootstrap.css" type="text/css">
5
+ <link rel="stylesheet" href="{{root}}/css/base.css" type="text/css">
6
+ <!--[if IE]>
7
+ <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
8
+ <![endif]-->
9
+ <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
10
+ <script src="{{root}}/bootstrap/js/bootstrap.js"></script>
11
+
12
+ </head>
@@ -0,0 +1,26 @@
1
+
2
+ <div class="navbar navbar-inverse navbar-fixed-top">
3
+ <div class="navbar-inner">
4
+ <div class="container">
5
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
6
+ <span class="icon-bar"></span>
7
+ <span class="icon-bar"></span>
8
+ <span class="icon-bar"></span>
9
+ </button>
10
+ <a class="brand" href="{{root}}/">jq</a>
11
+ <div class="nav-collapse collapse">
12
+ <ul class="nav">
13
+ {% for item in navigation %}
14
+ <li {% if item.permalink == permalink %} class="active" {% endif %}>
15
+ <a href="{{root}}{{item.permalink}}">{{item.name}}</a>
16
+ </li>
17
+ {% endfor %}
18
+ <li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>
19
+ <li><a href="https://github.com/stedolan/jq">Source</a></li>
20
+ <li><a href="https://jqplay.org">Try online!</a></li>
21
+ <li><a href="https://raw.githubusercontent.com/stedolan/jq/master/NEWS">News</a></li>
22
+ </ul>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </div>
@@ -0,0 +1,112 @@
1
+ #ifndef EXEC_STACK_H
2
+ #define EXEC_STACK_H
3
+ #include <stddef.h>
4
+ #include <stdint.h>
5
+ #include <stdlib.h>
6
+ #include <string.h>
7
+ #include "jv_alloc.h"
8
+
9
+ /*
10
+ * The stack is a directed forest of variably sized blocks. Each block has a
11
+ * "next" block which is at a higher memory address, or 0 if the block has no
12
+ * "next" block. More than one block may have no "next" block. A block may be
13
+ * the "next" block of more than one other block. Pushed blocks are added at
14
+ * the low-address end of the stack.
15
+ *
16
+ * Stack pointers are negative integers that are offsets relative to "mem_end",
17
+ * the end of the allocated region. The stack "bound" is the stack pointer of
18
+ * the last block that would be able to fit in the currently allocated region.
19
+ * The stack "limit" is the stack pointer of the last block currently in the
20
+ * stack. The stack pointer of the "next" block is stored directly below each
21
+ * block.
22
+ *
23
+ * <- mem_end = 0x100
24
+ * 0xF8 +------------+
25
+ * 0xF0 | |
26
+ * 0xE8 +------------+ <- stack_ptr1 = -0x18
27
+ * 0xE0 next = 0
28
+ * 0xD8 +------------+
29
+ * 0xD0 | |
30
+ * 0xC8 | |
31
+ * 0xC0 +------------+ <- stack_ptr2 = limit = -0x40
32
+ * 0xB8 next = -0x18
33
+ * 0xB0
34
+ * 0xA8 <- bound = -0x58
35
+ * 0xA0
36
+ */
37
+
38
+ struct determine_alignment {
39
+ char x;
40
+ union { int i; double d; uint64_t u64; size_t sz; void* ptr; } u;
41
+ };
42
+ enum {ALIGNMENT = offsetof(struct determine_alignment, u)};
43
+
44
+ static size_t align_round_up(size_t sz) {
45
+ return ((sz + (ALIGNMENT - 1)) / ALIGNMENT) * ALIGNMENT;
46
+ }
47
+
48
+ typedef int stack_ptr;
49
+
50
+ struct stack {
51
+ char* mem_end; // one-past-the-end of allocated region
52
+ stack_ptr bound;
53
+ stack_ptr limit; // 0 - stack is empty
54
+ };
55
+
56
+ static void stack_init(struct stack* s) {
57
+ s->mem_end = 0;
58
+ s->bound = ALIGNMENT;
59
+ s->limit = 0;
60
+ }
61
+
62
+ static void stack_reset(struct stack* s) {
63
+ assert(s->limit == 0 && "stack freed while not empty");
64
+ char* mem_start = s->mem_end - ( -s->bound + ALIGNMENT);
65
+ free(mem_start);
66
+ stack_init(s);
67
+ }
68
+
69
+ static int stack_pop_will_free(struct stack* s, stack_ptr p) {
70
+ return p == s->limit;
71
+ }
72
+
73
+ static void* stack_block(struct stack* s, stack_ptr p) {
74
+ return (void*)(s->mem_end + p);
75
+ }
76
+
77
+ static stack_ptr* stack_block_next(struct stack* s, stack_ptr p) {
78
+ return &((stack_ptr*)stack_block(s, p))[-1];
79
+ }
80
+
81
+ static void stack_reallocate(struct stack* s, size_t sz) {
82
+ int old_mem_length = -(s->bound) + ALIGNMENT;
83
+ char* old_mem_start = s->mem_end - old_mem_length;
84
+
85
+ int new_mem_length = align_round_up((old_mem_length + sz + 256) * 2);
86
+ char* new_mem_start = jv_mem_realloc(old_mem_start, new_mem_length);
87
+ memmove(new_mem_start + (new_mem_length - old_mem_length),
88
+ new_mem_start, old_mem_length);
89
+ s->mem_end = new_mem_start + new_mem_length;
90
+ s->bound = -(new_mem_length - ALIGNMENT);
91
+ }
92
+
93
+ static stack_ptr stack_push_block(struct stack* s, stack_ptr p, size_t sz) {
94
+ int alloc_sz = align_round_up(sz) + ALIGNMENT;
95
+ stack_ptr r = s->limit - alloc_sz;
96
+ if (r < s->bound) {
97
+ stack_reallocate(s, alloc_sz);
98
+ }
99
+ s->limit = r;
100
+ *stack_block_next(s, r) = p;
101
+ return r;
102
+ }
103
+
104
+ static stack_ptr stack_pop_block(struct stack* s, stack_ptr p, size_t sz) {
105
+ stack_ptr r = *stack_block_next(s, p);
106
+ if (p == s->limit) {
107
+ int alloc_sz = align_round_up(sz) + ALIGNMENT;
108
+ s->limit += alloc_sz;
109
+ }
110
+ return r;
111
+ }
112
+ #endif