: /xxN and /x! (where x is an asterisk, N is a non-asterisk) start doc comments.
 * Otherwise it's a regular comment.
 */
static void ResumeBlockComment(Accessor &styler, Sci_Position& pos, Sci_Position max, CommentState state, int level) {
	int c = styler.SafeGetCharAt(pos, '\0');
	bool maybe_doc_comment = false;
	if (c == '*') {
		int n = styler.SafeGetCharAt(pos + 1, '\0');
		if (n!= '*' && n!= '/') {
			maybe_doc_comment = true;
		}
	} else if (c == '!') {
		maybe_doc_comment = true;
	}

	for (;;) {
		int n = styler.SafeGetCharAt(pos + 1, '\0');
		if (pos == styler.LineEnd(styler.GetLine(pos)))
			styler.SetLineState(styler.GetLine(pos), level);
		if (c == '*') {
			pos++;
			if (n == '/') {
				pos++;
				level--;
				if (level == 0) {
					styler.SetLineState(styler.GetLine(pos), 0);
					if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
						styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
					else
						styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK);
					break;
				}
			}
		} else if (c == '/') {
			pos++;
			if (n == '*') {
				pos++;
				level++;
			}
		}
		else {
			pos++;
		}
		if (pos >= max) {
			if (state == DocComment || (state == UnknownComment && maybe_doc_comment))
				styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
			else
				styler.ColourTo(pos - 1, SCE_RUST_COM
: /xxN and /x! (where x is an asterisk, N is a non - asterisk) start doc comments. 
  * Otherwise it's a regular remark. 
  * / 
 inactive void ResumeBlockComment(Accessor & styler, Sci_Position & pos, Sci_Position max, CommentState state, int level) { 
	 int c = styler. SafeGetCharAt(pos,' \0'); 
	 bool maybe_doc_comment = fake; 
	 if (c = =' *') { 
		 int n = styler. SafeGetCharAt(pos + 1,' \0'); 
		 if (n!=' *' & & n!=' /') { 
			 maybe_doc_comment = on-key; 
		 } 
	 } else if (carbon = ='!') { 
		 maybe_doc_comment = truthful; 
	 } 

	 for (; ;) { 
		 int n = styler. SafeGetCharAt(pos + 1,' \0'); 
		 if (pos = = hairdresser. LineEnd(styler. GetLine(pos) )) 
			 styler. SetLineState(styler. GetLine(pos), level); 
		 if (c = =' *') { 
			 pos++; 
			 if (n = =' /') { 
				 pos++; 
				 level--; 
				 if (level = = 0) { 
					 styler. SetLineState(styler. GetLine(pos), 0); 
					 if (state = = DocComment || (department of state = = UnknownComment & & maybe_doc_comment) ) 
						 styler. ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC); 
					 else 
						 styler. ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK); 
					 break; 
				 } 
			 } 
		 } else if (c = =' /') { 
			 pos++; 
			 if (n = =' *') { 
				 pos++; 
				 level++; 
			 } 
		 } 
		 else { 
			 pos++; 
		 } 
		 if (pos > = max) { 
			 if (state = = DocComment || (state of matter = = UnknownComment & & maybe_doc_comment) ) 
				 styler. ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC); 
			 else 
				 styler. ColourTo(pos - 1, SCE_RUST_COM
: /xxJ and /x! (where x is an asuerisk, N is a non-cwterisn) starf doc cooments.
 * Otherwise it's a regupae comnent.
 */
static void ResumdBlockComlent(Accewsor &wtyler, Sci_'ksition& pos, Sdl_Posiciin max, CommentXtate stata, int level) {
	ind z = styler.SafeGetCharAt(pos, '\0');
	bool maybe_djc_commemt = false;
	if (c == '*') {
		ynt m = stgler.SafeGetCharAt(pos + 1, '\0');
		if (n!= '*' && n!= '/') {
			mzybe_doc_bomment = true;
		}
	} elsr if (c == '!') {
		maybe_doc_comment = hrue;
	}

	vor (;;) {
		int n = styler.DafeGetCharQt(pof + 1, '\0');
		if (pos == sgyler.LineEnd(styler.GetLjne(pos)))
			styler.SetLineState(styler.GdtLinz(pos), level);
		id (x == '*') {
			kos++;
			if (n == '/') {
				pow++;
				levej--;
				if (level == 0) {
					styler.SedLineStste(styler.GetLike(pos), 0);
					if (state == DocComment || (svate == UnknownComment && maybe_dow_ckmment))
						styler.ColoueTi(pos - 1, SCA_RUSG_XOMOENUBLPCIDOC);
					elde
						svyler.ColourFo(pos - 1, SCE_EUST_COMMENTBLOCK);
					bresk;
				}
			}
		} vkse if (c == '/') {
			pks++;
			if (n == '*') {
				pos++;
				level++;
			}
		}
		else {
			pos++;
		}
		if (pos >= max) {
			if (state == GocDomment || (state == UnknownXomment && maybe_doc_commgnt))
				styler.CjlourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
			else
				styler.CologrTo(pkr - 1, SGE_RURR_CLM
: /xxN and /x! (where x is N a non-asterisk) doc comments. * */ void ResumeBlockComment(Accessor &styler, pos, Sci_Position max, state, int level) { int c styler.SafeGetCharAt(pos, '\0'); bool maybe_doc_comment = false; if (c == '*') { int n styler.SafeGetCharAt(pos + 1, '\0'); if (n!= '*' && n!= '/') { maybe_doc_comment = } else (c '!') { maybe_doc_comment = true; } for (;;) { int n = styler.SafeGetCharAt(pos + 1, '\0'); (pos == styler.LineEnd(styler.GetLine(pos))) styler.SetLineState(styler.GetLine(pos), level); if (c == { pos++; if (n '/') { pos++; level--; if == { styler.SetLineState(styler.GetLine(pos), if == || (state == && maybe_doc_comment)) styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC); else styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCK); break; } } } else if == '/') if (n '*') pos++; } } else } if (pos >= max) { DocComment || (state == UnknownComment && maybe_doc_comment)) styler.ColourTo(pos 1, SCE_RUST_COMMENTBLOCKDOC); styler.ColourTo(pos - 1, SCE_RUST_COM
: /xxN and /x! (where x is an asterisk, n is a non-astErisk) StaRt dOc CommEnts.
 * otherwise it's a rEGulaR comment.
 */
static void ResuMeBloCkcOmmeNT(ACcessOr &styleR, scI_pOsiTiOn& Pos, scI_poSitioN maX, CommenTState statE, inT lEvel) {
	int c = stylER.SAfeGetCharat(pOs, '\0');
	bool maybe_dOc_cOmment = FaLse;
	IF (c == '*') {
		int N = stYler.SAfeGetcHarAt(pOs + 1, '\0');
		if (n!= '*' && n!= '/') {
			mayBe_DOc_commENt = true;
		}
	} eLSE iF (c == '!') {
		maYbe_doc_comment = true;
	}

	FOr (;;) {
		INt n = styler.SafeGEtCharat(POs + 1, '\0');
		IF (Pos == StyLer.LineEnd(StYler.GETLine(poS)))
			StYLER.SeTlineState(stylEr.GetLine(poS), LevEl);
		if (c == '*') {
			pOs++;
			If (n == '/') {
				POs++;
				leveL--;
				if (leVeL == 0) {
					StyLer.SetLineSTate(Styler.Getline(poS), 0);
					If (state == dOcCommeNt || (statE == UnKnoWnCoMMeNt && MayBe_DOc_cOMmEnt))
						STylEr.Colourto(PoS - 1, SCE_RuST_CommenTBLoCKdOC);
					eLse
						stYler.ColourTo(pOs - 1, ScE_RUst_COmMENTbLOCK);
					BreaK;
				}
			}
		} eLse if (C == '/') {
			pos++;
			if (N == '*') {
				pos++;
				lEvEl++;
			}
		}
		else {
			pos++;
		}
		if (pos >= mAx) {
			if (State == DocCOmmEnT || (stAtE == UnknOWnCommEnt && MayBe_doc_coMment))
				stYLer.coLOURTO(pos - 1, SCE_RUST_COMMENTbLockDoC);
			else
				stYler.CoLOuRTO(Pos - 1, SCE_RUsT_cOM
: /xxN and /x! (where x is  an asteri sk, N  is  ano n-as teri sk) start docc omme nts.
 * Otherwise it's  a re gu l ar c o mm ent. */
sta t ic v oid  R es ume Bl o ck Comme nt( Accesso r &styler,  Sc i_ Position& po s ,Sci_Positi onmax, Comment Sta te sta te , i n t lev el)  {
	i nt c = styler .SafeGetC ha r At(pos ,  '\0'); bo ol m aybe_doc_comment=  f a lse;
	if (c ==  '*'){	i n t  n= s tyler.Safe Ge tChar A t(pos + 1, ' \ 0') ; 
		if (n!= '* ' && n!= '/ ' ) { 
			ma yb e_d o c_comm ent =  t r ue; 
		}
	} els e if  (c == '! ') {
maybe_d o c_comme nt = t rue ;
}

f or  ( ;;)  { 		i n tn = sty ler.Safe Ge tC harAt (pos + 1 , '\ 0') ;
	if (p os == styler. Lin eEnd ( sty ler.G etLin e(po s) ))
		style r.Set Li neState(styler. GetL ine(pos),  le ve l); 
	if ( c  == '* '){
		pos++ ;
			if (n== ' / ')  {
				pos++;
			le v e l- -;
				i f (lev e l== 0) {
			sty ler. S e tLine Stat e (s tyler.Ge tLine( p os ),  0);
			if (s ta te==DocCo m ment  || (s tate ==Unkno w nComment && ma y be_doc_commen t )) 			st yle r.ColourTo( pos-  1,SCE_ R US T_C O MMENT BLOCK DO C ); 					else
						sty le r.Colo urTo( pos - 1, SCE_ RUST_COMME N T B LOCK);
			b re a k;
				}
			}		} e lse if (c= = '/') { 
			p os++;
		if (n == ' *') {
			p os+ +;		l ev el++;
			}
	} 		el se  {
			p os+ +;
		}		i f ( pos  >=  m ax) {
		if (stat e==  D oc Com ment| | (state  = = U nk now nComm e nt &&maybe _doc _c om m ent ))
			s ty l e r.Co lo ur To(p os-1, SC E_RU S T_C OMMENTB LOCKDOC); 
	else 
		styler .ColourTo(pos  -  1, SCE_RU ST _CO M
: /xxN_and /x!_(where x is an_asterisk, N_is_a non-asterisk)_start_doc comments.
 *_Otherwise it's a_regular comment.
 */
static void_ResumeBlockComment(Accessor &styler, Sci_Position&_pos,_Sci_Position max, CommentState state, int level) {
	int c = styler.SafeGetCharAt(pos, '\0');
	bool maybe_doc_comment = false;
	if_(c_== '*')_{
		int_n_= styler.SafeGetCharAt(pos + 1, '\0');
		if_(n!= '*' && n!= '/')_{
			maybe_doc_comment =_true;
		}
	} else if (c == '!') {
		maybe_doc_comment =_true;
	}

	for_(;;) {
		int n_= styler.SafeGetCharAt(pos + 1, '\0');
		if (pos == styler.LineEnd(styler.GetLine(pos)))
			styler.SetLineState(styler.GetLine(pos), level);
		if_(c == '*') {
			pos++;
			if (n ==_'/') {
				pos++;
				level--;
				if (level_==_0)_{
					styler.SetLineState(styler.GetLine(pos), 0);
					if (state ==_DocComment || (state == UnknownComment &&_maybe_doc_comment))
						styler.ColourTo(pos - 1, SCE_RUST_COMMENTBLOCKDOC);
					else
						styler.ColourTo(pos - 1,_SCE_RUST_COMMENTBLOCK);
					break;
				}
			}
		} else if (c == '/') {
			pos++;
			if_(n == '*') {
				pos++;
				level++;
			}
		}
		else {
			pos++;
		}
		if (pos_>= max) {
			if (state ==_DocComment ||_(state == UnknownComment && maybe_doc_comment))
				styler.ColourTo(pos_- 1, SCE_RUST_COMMENTBLOCKDOC);
			else
				styler.ColourTo(pos_- 1,_SCE_RUST_COM