VBS、ASP代码语法加亮显示的类(5)
If charBuffer <>" " Then
If left(charBuffer, 1) = " " Then outputString = outputString & " "
' Check for a 'rem' style comment marker
If LCase(Trim(charBuffer)) = "rem" Then
outputString = outputString & CommentColor
outputString = outputString & "REM"
workString = mid( inLine, i, Len(inLine))
workString = replace(workString, "<", "&lt;")
workString = replace(workString, ">", "&gt;")
outputString = outputString & workString & "</font>"
charBuffer = ""
Exit For
End If
outputString = outputString & FindReplace(Trim(charBuffer))
If right(charBuffer, 1) = " " Then outputString = outputString & " "
charBuffer = ""
End If
Else
outputString = outputString & " "
End If
Case "("
If left(charBuffer, 1) = " " Then
outputString = outputString & " "
End If
outputString = outputString & FindReplace(Trim(charBuffer)) & "("
charBuffer = ""
Case Chr(60)
outputString = outputString & "<"
Case Chr(62)
outputString = outputString & ">"
Case Chr(34)
' catch quote chars and flip a boolean variable to denote that
' whether or not we're "inside" a quoted string
insideString = Not insideString
If insideString Then
outputString = outputString & StringColor
outputString = outputString & "&quot;"
Else
outputString = outputString & """"
outputString = outputString & "</font>"
End If
Case "'"
' Catch comments and output the rest of the line
' as a comment IF we're not inside a string.
If Not insideString Then
outputString = outputString & CommentColor
workString = mid( inLine, i, Len(inLine))
workString = replace(workString, "<", "&lt;")
workString = replace(workString, ">", "&gt;")
outputString = outputString & workString
outputString = outputString & "</font>"
Exit For
Else
outputString = outputString & "'"
End If
内容版权声明:除非注明,否则皆为本站原创文章。