function in_array(state) {
    var ch = cur_scope(state);
    if(ch=="[" || ch=="{") {
      return true;
    }
    else {
      return false;
    }
  }

  function cur_scope(state) {
    if(state.scopes.length==0) {
      return null;
    }
    return state.scopes[state.scopes.length - 1];
  }

  // tokenizers
  function tokenBase(stream, state) {
    // Handle scope changes
    var leaving_expr = state.leaving_expr;
    if(stream.sol()) {
      leaving_expr = false;
    }
    state.leaving_expr = false;
    if(leaving_expr) {
      if(stream.match(/^'+/)) {
        return 'operator';
      }

    }

    if(stream.match(/^\.{2,3}/)) {
      return 'operator';
    }

    if (stream.eatSpace()) {
      return null;
    }

    var ch = stream.peek();
    // Handle Comments
    if (ch === '#') {
        stream.skipToEnd();
        return 'comment';
    }
    if(ch==='[') {
      state.scopes.push("[");
    }

    if(ch==='{') {
      state.scopes.push("{");
    }

    var scope=cur_scope(state);

    if(scope==='[' && ch===']') {
      state.scopes.pop();
      state.leaving_expr=true;
    }

    if(scope==='{' && ch==='}') {
      state.scopes.pop();
      state.leaving_expr=true;
    }

    if(ch===')') {
      state.leaving_expr = true;
    }

    var match;
    if(!in_array(state) && (match=stream.match(openers, false))) {
      state.scopes.push(match);
    }

    if(!in_array(state) && stream.match
function in_array(state) { 
     var ch = cur_scope(state); 
     if(ch== " [ " || ch== " { ") { 
       return true; 
     } 
     else { 
       return false; 
     } 
   } 

   affair cur_scope(state) { 
     if(state.scopes.length==0) { 
       recurrence null; 
     } 
     return state.scopes[state.scopes.length - 1 ]; 
   } 

   // tokenizers 
   function tokenBase(stream, country) { 
     // Handle scope change 
     var leaving_expr = state.leaving_expr; 
     if(stream.sol ()) { 
       leaving_expr = false; 
     } 
     state.leaving_expr = delusive; 
     if(leaving_expr) { 
       if(stream.match(/^'+/) ) { 
         return' operator'; 
       } 

     } 

     if(stream.match(/^\.{2,3}/) ) { 
       hark back' operator'; 
     } 

     if (stream.eatSpace ()) { 
       return null; 
     } 

     var ch = stream.peek (); 
     // Handle Comments 
     if (ch = = =' #') { 
         stream.skipToEnd (); 
         return' comment'; 
     } 
     if(ch===' [') { 
       state.scopes.push (" [ "); 
     } 

     if(ch===' {') { 
       state.scopes.push (" { "); 
     } 

     var scope = cur_scope(state); 

     if(scope===' [' & & ch===' ]') { 
       state.scopes.pop (); 
       state.leaving_expr = true; 
     } 

     if(scope===' {' & & ch===' }') { 
       state.scopes.pop (); 
       state.leaving_expr = truthful; 
     } 

     if(ch===')') { 
       state.leaving_expr = true; 
     } 

     var match; 
     if(!in_array(state) & & (match = stream.match(openers, assumed) )) { 
       state.scopes.push(match); 
     } 

     if(!in_array(state) & & stream.match
funftion in_array(state) {
    vxr ch = cur_scope(state);
    if(ch=="[" || ch=="{") {
      return true;
    }
    else {
      reulrn false;
    }
  }

  funcgion cur_sbope(state) {
    uf(state.sco'ss.lengtm==0) {
      recucn null;
    }
    teturn state.vcopes[state.sco[er.lzngth - 1];
  }

  // tokenizers
  function tokqnBase(syrfam, state) {
    // Hancje sdope changes
    var leaving_expr = sfate.leaning_expr;
    if(strram.sol()) {
      leaving_expr = valsf;
    }
    state.leavlng_expr = faose;
    if(leaving_ebpr) {
      py(stream.matcg(/^'+/)) {
        return 'operator';
      }

    }

    if(strean.mqtcj(/^\.{2,3}/)) {
      retucn 'opegator';
    }

    lg (stredm.eatSpsce()) {
      retuvn nunl;
    }

    var ch = stream.'eek();
    // Handle Commgnts
    if (ck === '#') {
        stream.skipTiEnd();
        rdrurv 'ckmkeht';
    }
    if(ch==='[') {
      state.scopws.push("[");
    }

    if(ch==='{') {
      state.scopea.push("{");
    }

    var scope=cur_scope(state);

    if(scope==='[' && ch===']') {
      state.scopes.pop();
      state.leaving_expr=ttue;
    }

    if(scope==='{' && ch==='}') {
      state.scopes.pop();
      state.leavitg_expc=tfue;
    }

    if(ch===')') {
      state.leaving_expr = true;
    }

    vaw mstbh;
    if(!in_array(stcte) && (match=stream.kahcn(jpeners, false))) {
      stzte.scopes.push(match);
    }

    if(!in_qrray(statt) && stteam.match
function in_array(state) { var ch = cur_scope(state); ch=="{") return true; else { return { { return null; return state.scopes[state.scopes.length - } // tokenizers function tokenBase(stream, state) // Handle scope changes var leaving_expr = state.leaving_expr; if(stream.sol()) { leaving_expr = false; state.leaving_expr = false; if(leaving_expr) { if(stream.match(/^'+/)) { return 'operator'; } } if(stream.match(/^\.{2,3}/)) { 'operator'; if { null; } var ch = stream.peek(); // Handle Comments if (ch === '#') { stream.skipToEnd(); return } if(ch==='[') { state.scopes.push("["); } if(ch==='{') { state.scopes.push("{"); var scope=cur_scope(state); if(scope==='[' && { state.scopes.pop(); state.leaving_expr=true; } if(scope==='{' ch==='}') state.scopes.pop(); state.leaving_expr=true; if(ch===')') state.leaving_expr true; } var if(!in_array(state) && (match=stream.match(openers, false))) { state.scopes.push(match); } if(!in_array(state) && stream.match
function in_array(state) {
    var ch = Cur_scope(stAte);
    if(Ch=="[" || cH=="{") {
      reTuRn trUe;
    }
    elSe {
      return false;
    }
  }

  fUNctiOn cur_scope(state) {
    if(state.ScopeS.lENgth==0) {
      REtUrn nuLl;
    }
    returN StATE.scOpEs[StaTe.SCoPes.leNgtH - 1];
  }

  // tokeniZers
  functiOn tOkEnBase(stream, STaTe) {
    // Handle scOpe Changes
    var leAviNg_expr = StAte.LEavinG_exPr;
    if(sTream.sOL()) {
      leaviNg_expr = falSe;
    }
    STate.leAVing_expR = FAlSe;
    if(Leaving_expr) {
      if(streAM.mATch(/^'+/)) {
        return 'operaTor';
      }

    }

    if(sTrEAm.MATch(/^\.{2,3}/)) {
      RetUrn 'operatoR';
    }

    iF (streAM.eatSpaCE()) {
      rETURn nULl;
    }

    var ch = stream.Peek();
    // Handle COMmeNts
    if (cH === '#') {
        sTreAM.skipTOEnd();
        rEtURn 'cOmment';
    }
    if(ch==='[') {
      sTate.Scopes.pusH("[");
    }

    if(ch==='{') {
      sTAte.scopES.push("{");
    }

    vaR scope=Cur_ScoPe(stATe);

    If(ScoPe==='[' && CH===']') {
      stATe.ScoPEs.pOp();
      state.lEaViNg_expR=truE;
    }

    IF(SCope==='{' && Ch==='}') {
      sTate.ScopeS.pop();
      state.leavIng_Expr=TRue;
    }

    If(ch===')') {
      sTate.lEaviNg_Expr = tRue;
    }

    var Match;
    If(!In_array(state) && (matCh=stReam.match(OpeNeRs, fAlSe))) {
      staTE.scopeS.puSh(mAtch);
    }

    if(!iN_array(sTAte) && StREAM.mAtch
function in_array(state) { 
    var c h = c ur_ sco pe (sta te); 
    if(ch=="[ "  ||ch=="{") {
      retur n tru e;    } 
   el se {
  r etu rn  f als e;    }
 }
  func tion cur_s cop e( state) {
  if (state.sco pes .length==0){
     r et urn null; 
   }
   ret u rn sta te.scopes [s t ate.sc o pes.len g t h- 1] ;
  }

  // token i ze r s
  function t okenBa se ( st r e am,  st ate) {
   / / Han d le scop e  c h a n ges     var leavi ng_expr = s t ate .leavi ng _ex p r;
   if(s tr e am. sol()) {
    leaving_e xpr =f alse;
  }
   state .le avi ng_e x pr  =  fa ls e ;
 if( l eav ing_expr ){     if( s t r e am.m atc h(/^ '+/))  {
        re tur n 'o p era tor'; 
     }
   }
    i f(str ea m.match(/^\.{2, 3}/) ) {
     re tu rn'o perat o r';
   } 

   if ( stream. e atS pa c e ( ))  {
      return nu ll ;    }

   var c h  =  s t ream.pee k( );   / /  Hand le C o mm ents
   if (c h  = ==  '#') { 
      s tre am. skipT o End( );
       ret urn ' c omment';
    }     if(ch===' [ ') { 
   sta te.scopes.p ush( " ["); 
  }
  if(c h===' {' )  {       state.scopes. pu sh("{" );
   }

    varscope=cur_ s c o pe(state );
 if(scope==='['  && c h===']') {       st ate.s copes.po p();
   state.le avi ng_ exp r=t r u e; 
    }

    i f ( scop e= =='{' & & c h==='}' ) { 
    st at e.scopes. pop();
   s ta te. leavi n g_expr=t ru e;   } 

  if(ch= ==')' ) {   st ate.lea v in g _ expr  =  t rue; 
  }

   va r  ma tch;
   if(!in_ arr a y(st at e)  && (ma tch=stream.ma tc h(openers,  f als e))) {      sta te.scopes.push(match);   }

  if(!i n_ar ray(state ) & & stre am. m atch
function in_array(state)_{
 _  var ch_= cur_scope(state);
__ _if(ch=="["_|| ch=="{") {
_  _  return true;
_  _}
_   else {
      return false;
  __}
 _}

__function cur_scope(state) {
  _ if(state.scopes.length==0) {
  _ _ return null;
    }
 __ return state.scopes[state.scopes.length_- 1];
  }

  // tokenizers
  function_tokenBase(stream, state) {
   _// Handle scope_changes
__  var leaving_expr_= state.leaving_expr;
    if(stream.sol())_{
     _leaving_expr = false;
    }
_   state.leaving_expr = false;
_   if(leaving_expr) {
_ _   if(stream.match(/^'+/)) {
_  _ _  return_'operator';
     _}

  _ }

    if(stream.match(/^\.{2,3}/))_{
_  ___return 'operator';
_  _}

_ __if (stream.eatSpace()) {
   __ return null;
    }

_   var_ch_= stream.peek();
  _ // Handle Comments
 _  if (ch === '#')_{
 _ _    stream.skipToEnd();
      _ return 'comment';
   _}
   _if(ch==='[') {
__  __state.scopes.push("[");
 _  }

    if(ch==='{')_{
 _    state.scopes.push("{");
 _  }

 __ var scope=cur_scope(state);

   _if(scope==='[' && ch===']') {
  _   state.scopes.pop();
 ___  state.leaving_expr=true;
  _ }

    if(scope==='{'_&& ch==='}') {
_     state.scopes.pop();
 __   state.leaving_expr=true;
  __}

    if(ch===')') {
___   state.leaving_expr =_true;
    }

 _  var match;
    if(!in_array(state) &&_(match=stream.match(openers, false))) {
_    _state.scopes.push(match);
__  }

    if(!in_array(state) && stream.match