@Test public void testCleanWithGlobalsGlsl100MultipleDeclarations() throws Exception { final String program = "" + "int g1;" + "int g2 = g1, g3 = g1, g4 = 5;" + "void main() {" + "}"; final String expectedProgram = "" + "int g1;" + "int g2, g3, g4;" + "void main() {" + " g2 = g1;" + " g3 = g1;" + " g4 = 5;" + "}"; final TranslationUnit tu = ParseHelper.parse(program); ConstCleaner.clean(tu); CompareAsts.assertEqualAsts(expectedProgram, tu); }
public static void clean(TranslationUnit tu) { new ConstCleaner(tu); }
ConstCleaner extends ScopeTrackingVisitor { public static void clean(TranslationUnit tu) { new ConstCleaner(tu); } }
ConstCleaner extends ScopeTrackingVisitor { public static void clean(TranslationUnit tu) { new ConstCleaner(tu); } private  ConstCleaner(TranslationUnit tu); }
ConstCleaner extends ScopeTrackingVisitor { public static void clean(TranslationUnit tu) { new ConstCleaner(tu); } private  ConstCleaner(TranslationUnit tu); static void clean(TranslationUnit tu); @Override void visitFunctionDefinition(FunctionDefinition functionDefinition); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr); @Override void visitVariablesDeclaration(VariablesDeclaration variablesDeclaration); }
ConstCleaner extends ScopeTrackingVisitor { public static void clean(TranslationUnit tu) { new ConstCleaner(tu); } private  ConstCleaner(TranslationUnit tu); static void clean(TranslationUnit tu); @Override void visitFunctionDefinition(FunctionDefinition functionDefinition); @Override void visitVariableIdentifierExpr(VariableIdentifierExpr variableIdentifierExpr); @Override void visitVariablesDeclaration(VariablesDeclaration variablesDeclaration);  }