Parsing... (results below)
" lines = Split(script, vbCrLf) For i = LBound(lines) to UBound(lines) strLine = lines(i) strLine = LTrim(strLine) LineCount = LineCount + 1 EventCheck BlockCheck If (OpenBracketCount = CloseBracketCount) AND Len(Trim(strLine))>0 And (InStr(strLine, "event")=0 And InStr(strLine, "block")=0 And InStr(strLine, "{")=0 And InStr(strLine, "}")=0) Then DoWarning("Unreachable code not in a block: " + Left(Trim(strLine),15) + " ...") 'Else 'Response.Write (""+strLine+"o" + CStr(OpenBracketCount) + " c" + CStr(CloseBracketCount)) End If '85 If InStr(strLine, "{") > 0 Then OpenBracketCount = OpenBracketCount + 1 arrOpenBracket = Split(strLine, "{") LineBracket = LineBracket + UBound(arrOpenBracket) End If If InStr(strLine, "}") > 0 Then CloseBracketCount = CloseBracketCount + 1 arrCloseBracket = Split(strLine, "}") LineBracket = LineBracket + UBound(arrCloseBracket) End If If LineBracket > 1 Then ErrorCount = ErrorCount + 1 BlockErrorCount = BlockErrorCount + 1 sOutput = sOutput + "Line #" & CStr(LineCount) & ":" & vbTab & CStr(BlockErrorCount) & "." & vbTab & "More than 1 { or } on a single line.
" End If LineBracket = 0 If InStr(strLine, "(") > 0 Then OpenParenCount = OpenParenCount + 1 arrOpenParen = Split(strLine, "(") LineParen = LineParen + UBound(arrOpenParen) End If If InStr(strLine, ")") > 0 Then CloseParenCount = CloseParenCount + 1 arrCloseParen = Split(strLine, ")") LineParen = LineParen - UBound(arrCloseParen) End If If LineParen <> 0 Then ErrorCount = ErrorCount + 1 BlockErrorCount = BlockErrorCount + 1 If LineParen > 0 Then sOutput = sOutput + "Line #" & CStr(LineCount) & ":" & vbTab & CStr(BlockErrorCount) & "." & vbTab & "Missing " + CStr(LineParen) + " close parentheses.
" Else sOutput = sOutput + "Line #" & CStr(LineCount) & ":" & vbTab & CStr(BlockErrorCount) & "." & vbTab & "Too many (" + CStr(Abs(LineParen)) + ") close parentheses.
" End If End If LineParen = 0 'Warnings. 'ma_cexec_all If InStr(strLine, "ma_cexec_all") > 0 Then DoWarning("ma_cexec_all has been deprecated by latest Mani versions. Use es_cexec_all or ma_cexec #all instead.") End If If InStr(strLine, "eventscripts_noisy") > 0 Then DoWarning("eventscripts_noisy should rarely be referenced directly. See the corelib documentation for enabling/disabling it.") End If If InStr(strLine, chr(34)) Then arrQuotations = Split(strLine, chr(34)) QuotationMarks = QuotationMarks + UBound(arrQuotations) If QuotationMarks Mod 2 <> 0 Then ErrorCount = ErrorCount + 1 BlockErrorCount = BlockErrorCount + 1 sOutput = sOutput + "Line #" & CStr(LineCount) & ":" & vbTab & CStr(BlockErrorCount) & "." & vbTab & "Uneven amount of quotation marks.
" End If End If QuotationMarks = 0 Next CloseCurrentBlock Dim sColor if ErrorCount > 0 Then sColor = "red" Else sColor = "green" End if sOutput = sOutput + "
<----------------->" sOutput = sOutput + " Total Errors = " & CStr(ErrorCount) & "" sOutput = sOutput+ " <----------------->
This syntax checker scans for the following errors in your script addon syntax: