Minor code simplifications in highlighting code

darcs-hash:20060530003535-ac50b-6babcc9880a018a669e123c2acdb548adb4406ce.gz
This commit is contained in:
axel 2006-05-30 10:35:35 +10:00
parent b028e41f7f
commit 6a5f11879b

View File

@ -109,69 +109,30 @@ static void highlight_param( const wchar_t * buff,
if( c == L'\\' )
{
int start_pos = in_pos;
in_pos++;
switch( buff[++in_pos] )
{
case L'~':
case L'%':
if( wcschr( L"~%", buff[in_pos] ) )
{
if( in_pos == 1 )
{
color[start_pos] = HIGHLIGHT_ESCAPE;
color[in_pos+1] = HIGHLIGHT_NORMAL;
}
break;
}
case L',':
else if( buff[in_pos]==L',' )
{
if( bracket_count )
{
color[start_pos] = HIGHLIGHT_ESCAPE;
color[in_pos+1] = HIGHLIGHT_NORMAL;
}
break;
}
case L'n':
case L'r':
case L't':
case L'b':
case L'e':
case L'*':
case L'?':
case L'$':
case L'(':
case L')':
case L'{':
case L'}':
case L'\'':
case L'"':
case L'<':
case L'>':
case L'^':
case L' ':
case L'\\':
case L'#':
else if( wcschr( L"nrtbe*?$(){}'\"<>^ \\#;|&", buff[in_pos] ) )
{
color[start_pos]=HIGHLIGHT_ESCAPE;
color[in_pos+1]=HIGHLIGHT_NORMAL;
break;
}
case L'u':
case L'U':
case L'x':
case L'X':
case L'0':
case L'1':
case L'2':
case L'3':
case L'4':
case L'5':
case L'6':
case L'7':
else if( wcschr( L"uUxX01234567", buff[in_pos] ) )
{
int i;
long long res=0;
@ -241,10 +202,8 @@ static void highlight_param( const wchar_t * buff,
color[start_pos] = HIGHLIGHT_ERROR;
color[in_pos+1] = HIGHLIGHT_NORMAL;
}
}
break;
}
}
}
else
{