@Test public void shouldDestructureToastWithTupleFieldMatch() { transform( "module scotch.test", "data Person { name :: (String, String) }", "firstName Person { name = (fn, _) } = fn" ); shouldHavePattern("scotch.test.(#1)", asList( capture("firstName", t(0)), struct("Person", t(1), asList( field("name", t(2), struct("scotch.data.tuple.(,)", t(4), asList( field("_0", t(7), capture("fn", t(6))), field("_1", t(10), ignore(t(9))) ))) )) ), unshuffled(id("fn", t(11)))); }
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);  }