@Test public void shouldParseMultipleDrawFromsInDoNotation() { transform( "module scotch.test", "addedStuff = do", " x <- Just 3", " y <- Just 2", " return $ x + y" ); shouldHaveValue("scotch.test.addedStuff", unshuffled( unshuffled( id("Just", t(1)), literal(3) ), id("scotch.control.monad.(>>=)", t(10)), fn("scotch.test.(addedStuff#0)", arg("x", t(0)), unshuffled( unshuffled( id("Just", t(3)), literal(2) ), id("scotch.control.monad.(>>=)", t(9)), fn("scotch.test.(addedStuff#1)", arg("y", t(2)), unshuffled( id("return", t(4)), id("$", t(5)), id("x", t(6)), id("+", t(7)), id("y", t(8)) )) )) )); }
public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) { definition(null, RootDefinition.builder(), builder -> moduleMap.keySet().forEach( moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName))))); return createGraph(definitions).build(); }
SyntaxTransformer { public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) { definition(null, RootDefinition.builder(), builder -> moduleMap.keySet().forEach( moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName))))); return createGraph(definitions).build(); } }
SyntaxTransformer { public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) { definition(null, RootDefinition.builder(), builder -> moduleMap.keySet().forEach( moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName))))); return createGraph(definitions).build(); } SyntaxTransformer(SymbolResolver resolver, SymbolGenerator symbolGenerator); }
SyntaxTransformer { public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) { definition(null, RootDefinition.builder(), builder -> moduleMap.keySet().forEach( moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName))))); return createGraph(definitions).build(); } SyntaxTransformer(SymbolResolver resolver, SymbolGenerator symbolGenerator); DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap); }
SyntaxTransformer { public DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap) { definition(null, RootDefinition.builder(), builder -> moduleMap.keySet().forEach( moduleName -> builder.withModule(transformModules(moduleName, moduleMap.get(moduleName))))); return createGraph(definitions).build(); } SyntaxTransformer(SymbolResolver resolver, SymbolGenerator symbolGenerator); DefinitionGraph transform(Map<String, List<ModuleContext>> moduleMap);  }