Examples of CFCommentItem


Examples of org.cfeclipse.cfml.parser.docitems.CFCommentItem

            if (CFCommentDepth == 0) {
                CFCommentEndOffset = start;
                commentLength = CFCommentEndOffset - CFCommentStartOffset;

                try {
                    comment = new CFCommentItem(doc.getLineOfOffset(CFCommentStartOffset),CFCommentStartOffset,CFCommentEndOffset,doc.get(CFCommentStartOffset,commentLength));
                    CFCommentList.add(comment);
                    //System.out.println("CFML comment added to list " + comment.getContents());
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
       
        //Checking for opening CFSCRIPT tag (<cfscript)
        if (CFScriptDepth == 0
                && CFCommentDepth == 0
                && "<cfscript".equalsIgnoreCase(group)) {
            // Looks like we've found the start of a CFSCRIPT block
           

            //System.out.println("Found a CFSCRIPT start tag at " + start);
           
            CFScriptDepth++;
           
        }
       
        //Checking for closing CFSCRIPT tag (</cfscript)
        if (CFScriptDepth == 1
                && CFCommentDepth == 0
                && "</cfscript".equalsIgnoreCase(group)) {
            // Looks like we've found the end of a CFSCRIPT block
           

            //System.out.println("Found a CFSCRIPT end tag at " + start);
           
            CFScriptDepth--;
           
        }
       
        //Checking for opening CFQUERY tag (<cfquery)
        if (CFQueryDepth == 0
                && CFCommentDepth == 0
                && group.length() > 7
                && "<cfquery".equalsIgnoreCase(group.substring(0,8))) {
            // We use substring here because the regular expression uses a space class (\s)
            // to distinguish cfquery from cfqueryparam
           
            // Looks like we've found the start of a CFQUERY block
           

            //System.out.println("Found a CFQUERY start tag at " + start);
           
            CFQueryDepth++;
           
        }
       
        //Checking for closing CFQUERY tag (</cfquery)
        if (CFQueryDepth == 1
                && CFCommentDepth == 0
                && "</cfquery".equalsIgnoreCase(group)) {
            // Looks like we've found the end of a CFQUERY block
           

            //System.out.println("Found a CFQUERY end tag at " + start);
           
            CFQueryDepth--;
           
        }
       
        //Checking for opening CFQUERY tag (<cfquery)
        if (CFQueryDepth == 0
                && CFCommentDepth == 0
                && "<cfquery".equalsIgnoreCase(group)) {
            // Looks like we've found the start of a CFQUERY block
           

            //System.out.println("Found a CFQUERY start tag at " + start);
           
            CFQueryDepth++;
           
        }
       
        //Checking for closing CFQUERY tag (</cfquery)
        if (CFQueryDepth == 1
                && CFCommentDepth == 0
                && "</cfquery".equalsIgnoreCase(group)) {
            // Looks like we've found the end of a CFQUERY block
           

            //System.out.println("Found a CFQUERY end tag at " + start);
           
            CFQueryDepth--;
           
        }
       
       
       
       
        // Checking for opening CFSCRIPT or SQL comment (/*)
        if ((CFScriptDepth == 1 || CFQueryDepth == 1)
                && "/*".equalsIgnoreCase(group)
                && start > lineCommentEnd){
            // Looks like we've found the start of a CFSCRIPT or SQL comment
            if (CFCommentDepth == 0) {
                CFCommentStartOffset = end;
                //System.out.println("Found a CFSCRIPT or SQL block comment at " + start);
            }
            CFCommentDepth++;
        }
       
       
        // Check for closing CFSCRIPT or SQL comment (*/)
        if ((CFScriptDepth == 1 || CFQueryDepth == 1)
                && "*/".equalsIgnoreCase(group)
                && start > lineCommentEnd) {
            // Looks like we've found the end of a CFSCRIPT or SQL comment
            CFCommentDepth--;
            if (CFCommentDepth == 0) {
                CFCommentEndOffset = start;
                commentLength = CFCommentEndOffset - CFCommentStartOffset;

                try {
                    comment = new CFCommentItem(doc.getLineOfOffset(CFCommentStartOffset),CFCommentStartOffset,CFCommentEndOffset,doc.get(CFCommentStartOffset,commentLength));
                    CFCommentList.add(comment);
                    //System.out.println("CFSCRIPT or SQL comment added to list " + comment.getContents());
                }
                catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
       
       
        // Check for single line CFSCRIPT comment (//)
        if (CFScriptDepth == 1
                && "//".equalsIgnoreCase(group)) {
            // Looks like we've found a single line script comment
            CFCommentStartOffset = end;
            //System.out.println("Found a CFSCRIPT line comment at " + start);
            try {
                IRegion region = doc.getLineInformationOfOffset(start);
                region.getLength();
                region.getOffset();
                lineCommentEnd = region.getOffset() + region.getLength();
                commentLength =  lineCommentEnd - CFCommentStartOffset;
                comment = new CFCommentItem(doc.getLineOfOffset(CFCommentStartOffset),CFCommentStartOffset,CFCommentEndOffset,doc.get(CFCommentStartOffset,commentLength));
                CFCommentList.add(comment);
                //System.out.println("CFSCRIPT line comment added to list " + comment.getContents());
            }
            catch (Exception e) {
                e.printStackTrace();
View Full Code Here

Examples of org.cfeclipse.cfml.parser.docitems.CFCommentItem

    String[] tasktags = fPrefs.getString(EditorPreferenceConstants.TASK_TAGS).split(",");
    String[] priorities = fPrefs.getString(EditorPreferenceConstants.TASK_TAGS_PRIORTIES).split(",");

    while (i.hasNext()) {
      CFCommentItem comment = (CFCommentItem) i.next();

      for (int x = 0; x < tasktags.length; x++) {
        if (tasktags[x].length() != 0) {

          Pattern markerPattern = Pattern.compile(tasktags[x] + "[^A-Za-z]", Pattern.CASE_INSENSITIVE);

          String[] lines = comment.getContents().split("[\\n]");

          for (int line = 0; line < lines.length; line++) {
            Matcher matcher = markerPattern.matcher(lines[line]);

            if (matcher.find()) {
              try {
                if (priorities[x].length() == 0) {
                  priorities[x] = "0";
                }
                Map attrs = new HashMap();
                MarkerUtilities.setLineNumber(attrs, comment.getLineNumber() + line + 1);
                attrs.put(IMarker.PRIORITY, Integer.parseInt(priorities[x]));
                String message = lines[line].substring(matcher.start(), lines[line].length());
                MarkerUtilities.setMessage(attrs, message);
                MarkerUtilities.createMarker(resource, attrs, "org.cfeclipse.cfml.todomarker");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.