ide/src/wombat/gui/text/SchemeDocument.java
private void applyHighlighting(String content, int line) throws BadLocationException {
        int startOffset = rootElement.getElement(line).getStartOffset();
        int endOffset = rootElement.getElement(line).getEndOffset() - 1;

        int lineLength = endOffset - startOffset;
        int contentLength = content.length();

        if (endOffset >= contentLength)
            endOffset = contentLength - 1;

        //  check for multi line comments
        //  (always set the comment attribute for the entire line)

        if (endingMultiLineComment(content, startOffset, endOffset)
                || isMultiLineComment()
                || startingMultiLineComment(content, startOffset, endOffset)) {
        	if (attributes.containsKey("comment"))
        		doc.setCharacterAttributes(startOffset, endOffset - startOffset + 1, attributes.get("comment"), true);
            return;
        }

        //  set default attributes for the line
        if (attributes.containsKey("default"))
        	doc.setCharacterAttributes(startOffset, lineLength, attributes.get("default"), true);

        //  check for single line comment

        int index = content.indexOf(';', startOffset);

        if ((index > -1) && (index < endOffset)) {
        	if (attributes.containsKey("comment"))
        		doc.setCharacterAttributes(index, endOffset - index + 1, attributes.get("comment"), true);
            endOffset = index - 1;
        }

        //  check for tokens

        checkForTokens(content, startOffset, endOffset);
    }
/*
    *  Parse the line to determine the appropriate highlighting
    */
Parse the line to determine the appropriate highlighting
Parse the line to determine the appropriate highlighting
private void applyHighlighting(String content, int line) throws BadLocationException {
        int startOffset = rootElement.getElement(line).getStartOffset();
        int endOffset = rootElement.getElement(line).getEndOffset() - 1;
        int lineLength = endOffset - startOffset;
        int contentLength = content.length();
        if (endOffset >= contentLength)
            endOffset = contentLength - 1;
        if (endingMultiLineComment(content, startOffset, endOffset)
                || isMultiLineComment()
                || startingMultiLineComment(content, startOffset, endOffset)) {
        	if (attributes.containsKey("comment"))
        		doc.setCharacterAttributes(startOffset, endOffset - startOffset + 1, attributes.get("comment"), true);
            return;
        }
        if (attributes.containsKey("default"))
        	doc.setCharacterAttributes(startOffset, lineLength, attributes.get("default"), true);
        int index = content.indexOf(';', startOffset);
        if ((index > -1) && (index < endOffset)) {
        	if (attributes.containsKey("comment"))
        		doc.setCharacterAttributes(index, endOffset - index + 1, attributes.get("comment"), true);
            endOffset = index - 1;
        }
        checkForTokens(content, startOffset, endOffset);
    }
private void applyHighlighting ( String content , int line ) throws BadLocationException { int startOffset = rootElement . getElement ( line ) . getStartOffset ( ) ; int endOffset = rootElement . getElement ( line ) . getEndOffset ( ) - 1 ; int lineLength = endOffset - startOffset ; int contentLength = content . length ( ) ; if ( endOffset >= contentLength ) endOffset = contentLength - 1 ; if ( endingMultiLineComment ( content , startOffset , endOffset ) || isMultiLineComment ( ) || startingMultiLineComment ( content , startOffset , endOffset ) ) { if ( attributes . containsKey ( "comment" ) ) doc . setCharacterAttributes ( startOffset , endOffset - startOffset + 1 , attributes . get ( "comment" ) , true ) ; return ; } if ( attributes . containsKey ( "default" ) ) doc . setCharacterAttributes ( startOffset , lineLength , attributes . get ( "default" ) , true ) ; int index = content . indexOf ( ';' , startOffset ) ; if ( ( index > - 1 ) && ( index < endOffset ) ) { if ( attributes . containsKey ( "comment" ) ) doc . setCharacterAttributes ( index , endOffset - index + 1 , attributes . get ( "comment" ) , true ) ; endOffset = index - 1 ; } checkForTokens ( content , startOffset , endOffset ) ; }
Parse the line to determine the appropriate highlighting
Parse the line to determine the appropriate highlighting
//  check for multi line comments //  (always set the comment attribute for the entire line) //  set default attributes for the line //  check for single line comment //  check for tokens