Changeset 2403

Show
Ignore:
Timestamp:
07/28/08 19:39:42 (16 months ago)
Author:
jon
Message:

[tests] add a test for the pretty printer

Location:
trunk/ProjectFortress
Files:
1 added
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/build.xml

    r2377 r2403  
    558558                    <exclude name="**/*$*.class"/> 
    559559                    <exclude name="**/SyntaxAbstractionJUTestAll.class"/> 
     560                    <exclude name="**/tools/AstJUTest.class"/> 
    560561                </fileset> 
    561562            </batchtest> 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/Parser.java

    r2297 r2403  
    147147 
    148148    /** 
     149     * Parses a string as a compilation unit. See parseFile above. 
     150     */ 
     151    public static CompilationUnit parseString(APIName api_name, String buffer) throws IOException { 
     152        // Also throws StaticError, ParserError 
     153        BufferedReader in = Useful.bufferedStringReader(buffer); 
     154        Fortress parser = new Fortress(in, api_name.getText()); 
     155        xtc.parser.Result parseResult = parser.pFile(0); 
     156        return checkResultCU(parseResult, parser, api_name.getText()); 
     157    } 
     158 
     159    /** 
    149160     * Checks that a xtc.parser.Result is contains a CompilationUnit, 
    150161     * and checks the filename for the appropriate suffix.