/* content from:
 * https://github.com/marijnh/CodeMirror/raw/master/js/parsejavascript.js
 * closure compiled 2011-05-17 */
var JSParser=Editor.Parser=function(){function C(h,n,o,b,e,t){this.indented=h;this.column=n;this.type=o;if(b!=null)this.align=b;this.prev=e;this.info=t}function M(h){return function(n){var o=n&&n.charAt(0),b=h.type,e=o==b;return b=="vardef"?h.indented+4:b=="form"&&o=="{"?h.indented:b=="stat"||b=="form"?h.indented+indentUnit:h.info=="switch"&&!e?h.indented+(/^(?:case|default)\b/.test(n)?indentUnit:2*indentUnit):h.align?h.column-(e?1:0):h.indented+(e?0:indentUnit)}}var D={atom:!0,number:!0,variable:!0,
string:!0,regexp:!0},E=!1;return{make:function(h,n){function o(a){for(var b=a.length-1;b>=0;b--)p.push(a[b])}function b(){o(arguments);u=!0}function e(){o(arguments);u=!1}function t(){l={prev:l,vars:{"this":!0,arguments:!0}}}function F(){l=l.prev}function x(a){l&&(q="js-variabledef",l.vars[a]=!0)}function g(a,b){var c=function(){j=new C(r,s,a,null,j,b)};c.lex=!0;return c}function c(){if(j.type==")")r=j.indented;j=j.prev}function i(a){return function(f){f==a?b():a==";"?e():b(arguments.callee)}}function G(){return e(m,
G)}function H(){return e(d,H)}function m(a){a=="var"?b(g("vardef"),y,i(";"),c):a=="keyword a"?b(g("form"),d,m,c):a=="keyword b"?b(g("form"),m,c):a=="{"?b(g("}"),z,c):a==";"?b():a=="function"?b(A):a=="for"?b(g("form"),i("("),g(")"),N,i(")"),c,m,c):a=="variable"?b(g("stat"),O):a=="switch"?b(g("form"),d,g("}","switch"),i("{"),z,c,c):a=="case"?b(d,i(":")):a=="default"?b(i(":")):a=="catch"?b(g("form"),t,i("("),I,i(")"),m,c,F):e(g("stat"),d,i(";"),c)}function d(a){D.hasOwnProperty(a)?b(k):a=="function"?
b(A):a=="keyword c"?b(d):a=="("?b(g(")"),d,i(")"),c,k):a=="operator"?b(d):a=="["?b(g("]"),v(d,"]"),c,k):a=="{"?b(g("}"),v(P,"}"),c,k):b()}function k(a,f){a=="operator"&&/\+\+|--/.test(f)?b(k):a=="operator"?b(d):a==";"?e():a=="("?b(g(")"),v(d,")"),c,k):a=="."?b(Q,k):a=="["&&b(g("]"),d,i("]"),c,k)}function O(a){a==":"?b(c,m):e(k,i(";"),c)}function Q(a){a=="variable"&&(q="js-property",b())}function P(a){a=="variable"&&(q="js-property");D.hasOwnProperty(a)&&b(i(":"),d)}function v(a,f){function c(d){d==
","?b(a,c):d==f?b():b(i(f))}return function(d){d==f?b():e(a,c)}}function z(a){a=="}"?b():e(m,z)}function y(a,f){a=="variable"?(x(f),b(J)):b()}function J(a,f){f=="="?b(d,J):a==","&&b(y)}function N(a){a=="var"?b(y,w):a==";"?e(w):a=="variable"?b(R):e(w)}function R(a,f){f=="in"?b(d):b(k,w)}function w(a,f){a==";"?b(K):f=="in"?b(d):b(d,i(";"),K)}function K(a){a==")"?e():b(d)}function A(a,f){a=="variable"?(x(f),b(A)):a=="("&&b(g(")"),t,v(I,")"),c,m,F)}function I(a,f){a=="variable"&&(x(f),b())}var B=tokenizeJavaScript(h),
p=[E?H:G],l=null,j=new C((n||0)-indentUnit,0,"block",!1),s=0,r=0,u,q,L={next:function(){for(;p[p.length-1].lex;)p.pop()();var a=B.next();if(a.type=="whitespace"&&s==0)r=a.value.length;s+=a.value.length;if(a.content=="\n"){r=s=0;if(!("align"in j))j.align=!1;a.indentation=M(j)}if(a.type=="whitespace"||a.type=="comment")return a;if(!("align"in j))j.align=!0;for(;;)if(u=q=!1,p.pop()(a.type,a.content),u){if(q)a.style=q;else{var b;if(b=a.type=="variable")a:{for(b=l;b;){if(b.vars[a.content]){b=!0;break a}b=
b.prev}b=!1}if(b)a.style="js-localvariable"}return a}},copy:function(){var a=l,b=j,c=p.concat([]),d=B.state;return function(e){l=a;j=b;p=c.concat([]);s=r=0;B=tokenizeJavaScript(e,d);return L}}};c.lex=!0;return L},electricChars:"{}:",configure:function(h){if(h.json!=null)E=h.json}}}();