bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs indentation bug


From: Ronaldo Menezes
Subject: emacs indentation bug
Date: Tue, 14 Oct 2003 21:04:56 -0400
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030827

A student of mine came to me with the attached Java code complaining that emacs could not indent it correctly. Although the code is correct (it compiles, if the other classes were available) the regular expression used in emacs doesn't seem to like some strings with colons. Just try to "indent-region" the attached code
and you'll see what I mean.

Ronaldo Menezes
Assistant Professor, Computer Sciences
Florida Institute of Technology

/*****************************************
 *   Karen Oertner
 *   Lab 06
 *   Implementation of a link list
 *   which has pointers to the 
 *   next node inserted, the next node 
 *   in ascending order, and the 
 *   next node in decending order.
 ******************************************/

public class TestDriver {
    
    public static void main(String[] args) {
        String s = "";
        LinkList ll = new LinkList();
        //add items to the list at the tail
        System.out.println("================================\nAdd items to tail 
");
        ll.add("BBBBBB");
        ll.add("AAAAA");
        ll.add("TEST");
        ll.add("Karen");
        ll.add("Greg");
        ll.add("aaaaa");
        
        //print the lists
        System.out.println("\nThe linked list in inserted order: ");
        ll.printLLNext();
        System.out.println("\n\nThe linked list in decending order (case 
sentitive): ");
        ll.printLLDecend();
        System.out.println("\n\nThe linked list in ascending order (case 
sentitive): "); 
                                                                        
ll.printLLAscend();
        
        //test the insert function - add items to the head of the list
        System.out.println("\n\n=============================\nInsert Function 
at beginning");
        ll.insert("Susan");
        ll.insert("Sara");
        
        //print the lists
        System.out.println("\nThe linked list in inserted order:");
        ll.printLLNext();
        System.out.println("\n\nThe linked list in decending order (case 
sentitive): ");
        ll.printLLDecend();
        System.out.println("\n\nThe linked list in ascending order (case 
sentitive): ");
        ll.printLLAscend();
                                                                                
                                                        
        //test the delete element function
        System.out.println("\n==============================\nDelete Element 
function (case sensitive): ");
        System.out.println(ll.delete("AAAAA"));
        System.out.println(ll.delete("Sara"));
        System.out.println(ll.delete("Gregs"));
        
        //print the lists
        System.out.println("\nThe linked list in inserted order: ");
        ll.printLLNext();
        System.out.println("\n\nThe linked list in decending order (case 
sentitive): ");
        ll.printLLDecend();
        System.out.println("\n\nThe linked list in ascending order (case 
sentitive): ");
        ll.printLLAscend();
        
        //test the delete all elements function
        System.out.println("\n==============================\nDelete All 
Elements function: ");
        ll.deleteAll();
        //print the lists
        
        System.out.println("\nThe linked list in inserted order: ");
        ll.printLLNext();
        System.out.println("\n\nThe linked list in decending order (case 
sentitive): ");
        ll.printLLDecend();
        System.out.println("\n\nThe linked list in ascending order (case 
sentitive): ");
        ll.printLLAscend();
        
        //prove the delete function by adding new items to the list
        System.out.println("\n\n=============================\nRebuild list");
        ll.insert("Sally");
        ll.insert("David");
        ll.add("Zero");
        ll.add("Alpha");

        //print the lists
        System.out.println("\nThe linked list in inserted order: ");
        ll.printLLNext();
        System.out.println("\n\nThe linked list in decending order (case 
sentitive): ");
        ll.printLLDecend();
        System.out.println("\n\nThe linked list in ascending order (case 
sentitive): ");
        ll.printLLAscend();

    }

}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]