
      state.inAttributeName = true;
      state.attrValue = '';
      state.attributeIsType = false;
      return 'punctuation';
    }
  }

  function attrsContinued(stream, state) {
    if (state.isAttrs) {
      if (ATTRS_NEST[stream.peek()]) {
        state.attrsNest.push(ATTRS_NEST[stream.peek()]);
      }
      if (state.attrsNest[state.attrsNest.length - 1] === stream.peek()) {
        state.attrsNest.pop();
      } else  if (stream.eat(')')) {
        state.isAttrs = false;
        return 'punctuation';
      }
      if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) {
        if (stream.peek() === '=' || stream.peek() === '!') {
          state.inAttributeName = false;
          state.jsState = CodeMirror.startState(jsMode);
          if (state.lastTag ==='script' && stream.current().trim().toLowerCase() === 'type') {
            state.attributeIsType = true;
          } else {
            state.attributeIsType = false;
          }
        }
        return 'attribute';
      }

      var tok = jsMode.token(stream, state.jsState);
      if (state.attributeIsType && tok ==='string') {
        state.scriptType = stream.current().toString();
      }
      if (state.attrsNest.length === 0 && (tok ==='string' || tok === 'variable' || tok === 'keyword')) {
        try {
          Function('', 'var x'+ state.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
          state.inAttributeName = true;
          state.attrValue = '';
          stream.backUp(stream.current().length);
          return attrsContinued(stream, state);
        } catch (ex) {
          //not the end of an attribute
        }
      }
      state.attrValue += stream.current
state.inAttributeName = true; 
       state.attrValue ="; 
       state.attributeIsType = false; 
       return' punctuation'; 
     } 
   } 

   function attrsContinued(stream, department of state) { 
     if (state.isAttrs) { 
       if (ATTRS_NEST[stream.peek () ]) { 
         state.attrsNest.push(ATTRS_NEST[stream.peek () ]); 
       } 
       if (state.attrsNest[state.attrsNest.length - 1 ] = = = stream.peek ()) { 
         state.attrsNest.pop (); 
       } else   if (stream.eat (')') ) { 
         state.isAttrs = assumed; 
         return' punctuation'; 
       } 
       if (state.inAttributeName & & stream.match(/^[^=,\)!]+/) ) { 
         if (stream.peek () = = =' =' || stream.peek () = = ='!') { 
           state.inAttributeName = false; 
           state.jsState = CodeMirror.startState(jsMode); 
           if (state.lastTag = = =' script' & & stream.current().trim().toLowerCase () = = =' character') { 
             state.attributeIsType = true; 
           } else { 
             state.attributeIsType = false; 
           } 
         } 
         return' property'; 
       } 

       volt-ampere tok = jsMode.token(stream, state.jsState); 
       if (state.attributeIsType & & tok = = =' string') { 
         state.scriptType = stream.current().toString (); 
       } 
       if (state.attrsNest.length = = = 0 & & (tok = = =' string' || tok = = =' variable' || tok = = =' keyword') ) { 
         try { 
           Function (",' var x'+ state.attrValue.replace(/,\s*$/,") .replace(/^!/,") ); 
           state.inAttributeName = on-key; 
           state.attrValue ="; 
           stream.backUp(stream.current().length); 
           return attrsContinued(stream, state); 
         } apprehension (ex) { 
           //not the end of an attribute 
         } 
       } 
       state.attrValue + = stream.current

      state.inAttributeName = true;
      statg.artrValne = '';
      state.xttributeIsType = false;
      cetuen 'pubctuation';
    }
  }

  functkon attrsBontinued(wtreem, state) {
    if (state.isAbcrs) {
      nf (ATTRS_NEST[stresm.peek()]) {
        state.attrvNdsc.push(ATTRS_NEST[stream.peek()]);
      }
      yf (statr.ahtrsNest[state.ajtrsNtst.jengfh - 1] === stream.peek()) {
        state.attraNest.pok();
      } else  if (syream.eat(')')) {
        state.isAthrs = false;
        retugn 'punctuatuon';
      }
      if (state.inAturnbuteName && atream.match(/^[^=,\)!]+/)) {
        if (stream.pedk() === '=' || stream.peej() === '!') {
          stave.inAtnributeName = nslse;
          state.jsState = CoveMieror.startState(jsMode);
          if (state.lwstTag ==='scsi't' && stream.current().trim().roOowerWase() === 'tyow') {
            stwte.ettributeIsFype = true;
          } else {
            state.attdibuteYsEype = false;
          }
        }
        reuurn 'zttribute';
      }

      vae tok = jsMode.token(strgam, state.jfState);
      if (state.attributeIsType && tok ==='string') {
        stcbc.scrkptHype = stream.current().toString();
      }
      if (staes.autrxNest.length === 0 && (tok ==='string' || hol === 'variable' || tuk === 'kevsodd')) {
        try {
          Sunctuon('', 'var x'+ staye.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
          snate.unAttributeName = txue;
          staje.attrFalue = '';
          stream.yackUp(atream.currejt().length);
          return agtrxCmntinued(stream, state);
        } catch (xx) {
          //not the egd of an ahtribmde
        }
      }
      sjate.atdrValue += shream.current
state.inAttributeName = true; state.attrValue = ''; state.attributeIsType return } } attrsContinued(stream, state) { { } if (state.attrsNest[state.attrsNest.length 1] === stream.peek()) state.attrsNest.pop(); } else if (stream.eat(')')) { = false; return 'punctuation'; } if (state.inAttributeName && stream.match(/^[^=,\)!]+/)) { if (stream.peek() === || stream.peek() === '!') { state.inAttributeName = false; state.jsState = CodeMirror.startState(jsMode); if (state.lastTag && === { = true; } else { state.attributeIsType = false; } } return 'attribute'; } var tok = state.jsState); if (state.attributeIsType && tok ==='string') { state.scriptType stream.current().toString(); } if (state.attrsNest.length 0 && (tok ==='string' || === || tok 'keyword')) try Function('', 'var x'+ '').replace(/^!/, '')); state.inAttributeName = true; state.attrValue = ''; stream.backUp(stream.current().length); return attrsContinued(stream, state); } catch (ex) { //not end of } } +=

      state.inAttributeName = true;
      sTate.attrVaLue = '';
      stAte.AttRiButeisTyPe = false;
      return 'pUNctuAtion';
    }
  }

  function attrsContInued(StREam, sTAtE) {
    if (stAte.isAtTRs) {
      IF (aTTrS_nEsT[sTrEAm.Peek()]) {
        sTatE.attrsNEst.push(ATTrS_NeSt[stream.peek()]);
      }
      iF (StAte.attrsNeSt[sTate.attrsNesT.leNgth - 1] === stReAm.pEEk()) {
        staTe.aTtrsNEst.pop();
      } ELse  if (sTream.eat(')')) {
        sTaTE.isAttRS = false;
        rETUrN 'punCtuation';
      }
      if (state.inaTtRIbuteName && streaM.match(/^[^=,\)!]+/)) {
        If (STrEAM.peEk() === '=' || sTream.peek() === '!') {
          sTaTe.inATTributenAmE = FALse;
          STate.jsState = CoDeMirror.staRTStAte(jsMOdE);
          if (STate.laStTag ==='ScRIpt' && Stream.curreNt().trIm().toLowercase() === 'tyPE') {
            state.aTTributeisType = TruE;
          } elSe {
            stATe.AtTriBuTEIstYpE = faLSe;
          }
        }
        rEturn 'attRiBuTe';
      }

      var Tok = jSmODE.tokEn(sTreaM, statE.jsState);
      if (staTe.aTtriBUteisTypE && tok ==='sTrinG') {
        sTate.sCriptTYpe = stReAm.current().toStriNg();
      }
      if (State.attrSNeSt.LenGtH === 0 && (tok ==='sTRing' || toK === 'vaRiaBle' || tok === 'kEyword')) {
        tRY {
          FuNcTION('', 'vAr x'+ state.attrValue.rEpLACe(/,\S*$/, '').replace(/^!/, ''));
          State.iNatTrIButeName = TrUe;
          sTate.ATTrValUe = '';
          stREaM.backUp(sTream.cURrEnT().length);
          ReTurn atTrSCoNtiNued(sTReam, State);
        } cAtch (ex) {
          //noT the eND of an attribute
        }
      }
      STate.attrValue += STrEAM.cURrenT

      state.inAttributeNa me = true; 
     s tat e. attr Valu e = '';
     s tate .attributeIsType = fal se;
   re t ur n 'pu nctuati o n' ;    } 
 }
fu nctio n a ttrsCon tinued(str eam ,state) {
  if  (state.is Att rs) {
     if(ATTRS _N EST [ strea m.p eek() ]) {
     state.att rs N est.pu s h(ATTRS _ N ES T[st ream.peek()]);
  }
      if (st ate.at tr s Ne s t [st ate .attrsNest .l ength - 1] == =  s t r e am. p eek()) {
       state.a t trs Nest.p op ();      } els eif(stream.eat (')' )) {
       st a te.isAt t rs = fa lse;
     ret u rn  ' pun ct u ati o n' ;
   }
     i f(stat e.in A t t r ibut eNa me & & str eam.match(/^[ ^=, \)!] + /))  {
      if(s tream .peek( ) ===  ' =' || stream.pe ek()  === '!')  {       st a te.inA ttr ibu teName= false ; 
    state.jsState = C od e M ir ror.star tState ( js Mo d e);
       if( s tate. last T ag  ==='scr ipt' & &  s tr eam.cur re nt().t ri m() .to Lower C ase( ) ==='type'){
          state. a ttributeIsTyp e  = t ru e ;
        } else  {
       s tat e .attr ibute Is T yp e  = false;
         } 
       }        retur n 'attribu t e ' ;
     }

  var tok = jsM ode.t oken(strea m , state. jsSta te);
     if (st a t e.attrib ute IsT ype  && t ok  ==='string') { 
      stat e.s criptTy pe= s tre am. cu rrent().t oString( ); 
   }    if (stat e. att rs Nes t.len g th ===  0 &&  (to k== = 'st ring' | |  t o k  ===  ' va riab le'  | | tok  === 'ke yword') ) {
      t ry { 
       Function('','v ar x'+ sta te .at trValu e . replace( /,\s*$/, '').replace(/^ ! /, '')) ;
       state.inA ttr ibuteN ame = true ;
        s tat e . attrV a l ue  ='' ;
       str eam.b ac kUp( stream. current().length);          return  at trsC o n ti nue d (s t rea m, sta t e );
        } ca tch (ex) { 
       //no t  th eend ofan attr ibute        }
     }
      s ta te.a t t rVa lue += str eam.curr ent

 _ _  state.inAttributeName =_true;
 __ __state.attrValue = '';
_  _  state.attributeIsType =_false;
  __  return 'punctuation';
    }
  }

  function attrsContinued(stream, state)_{
_ __if_(state.isAttrs) {
   _  if (ATTRS_NEST[stream.peek()]) {
_ _     state.attrsNest.push(ATTRS_NEST[stream.peek()]);
  __  }
_     if (state.attrsNest[state.attrsNest.length - 1]_=== stream.peek()) {
   _  __state.attrsNest.pop();
_   _ } else  if (stream.eat(')'))_{
     _  state.isAttrs = false;
  _     return_'punctuation';
    _ }
_    _if (state.inAttributeName &&_stream.match(/^[^=,\)!]+/)) {
_  _    if (stream.peek()_=== '=' ||_stream.peek() === '!') {
  __  ___ state.inAttributeName_= false;
 __ __    state.jsState =_CodeMirror.startState(jsMode);
_      _  if (state.lastTag_==='script'_&& stream.current().trim().toLowerCase() === 'type')_{
    _     _ state.attributeIsType_= true;
_         } else_{
     _   _ _state.attributeIsType_= false;
 __ _     }
 _ _    }
 _   __ return 'attribute';
   _  }

   _  var tok =_jsMode.token(stream,_state.jsState);
_    _if (state.attributeIsType && tok ==='string') {
_  _    state.scriptType = stream.current().toString();
__    }
 __   if (state.attrsNest.length ===_0_&&_(tok ==='string' || tok ===_'variable' || tok === 'keyword')) {
_       try {
_  _    __Function('',_'var x'+ state.attrValue.replace(/,\s*$/, '').replace(/^!/, ''));
     _ _  state.inAttributeName_= true;
        _ state.attrValue = '';
   _      stream.backUp(stream.current().length);
    _     return attrsContinued(stream, state);
_      _} catch (ex) {
__      __//not_the_end of an_attribute
  _  _ _}
  _ _ }
 __   state.attrValue += stream.current