Remove code for generating unused url parser.

This commit is contained in:
Dillon Kearns 2019-09-08 09:57:29 -07:00
parent f4f435ccaf
commit 07895d8c3f
2 changed files with 0 additions and 26 deletions

View File

@ -10,8 +10,6 @@ ${staticRoutes.allRoutes}
${staticRoutes.routeRecord}
${staticRoutes.urlParser}
${staticRoutes.imageAssetsRecord}
allImages : List (Path PathKey Path.ToImage)

View File

@ -62,7 +62,6 @@ function generate(scanned) {
var routeRecord = {};
var allRoutes = [];
var urlParser = [];
var routeToMetadata = [];
var routeToExt = [];
var routeToSource = [];
@ -85,19 +84,15 @@ function generate(scanned) {
if (!is404) {
captureRouteRecord(pathFragments, elmType, routeRecord);
allRoutes.push(elmType);
urlParser.push(formatUrlParser(elmType, pathFragments));
// routeToMetadata.push(formatCaseInstance(elmType, scanned[i].metadata));
// routeToExt.push(formatCaseInstance(elmType, ext));
// routeToSource.push(formatCaseInstance(elmType, scanned[i].path));
}
}
return {
exposing: "(simple, Route, all, pages, urlParser, routeToString, assets)",
// routes: toFlatRouteType(allRoutes),
allRoutes: formatAsElmList("all", allRoutes),
routeRecord: toElmRecord("pages", routeRecord, true),
urlParser: formatAsElmUrlParser(urlParser),
// urlToString: formatAsElmUrlToString(urlParser),
// routeToMetadata: formatCaseStatement("toMetadata", routeToMetadata),
// routeToDocExtension: formatCaseStatement("toExt", routeToExt),
// routeToSource: formatCaseStatement("toSourcePath", routeToSource),
@ -233,17 +228,6 @@ ${name} route =
${branches.join("\n\n")}`;
}
function formatUrlParser(elmType, filepathPieces) {
const urlParser = filepathPieces.map(literalUrl).join(" </> ");
const urlStringList = filepathPieces.map(quote).join(", ");
return {
toString: ` ${elmType} ->\n Url.Builder.absolute [ ${urlStringList} ] []`,
parser: `Url.map ${elmType} (${urlParser})`
};
}
function formatAsElmUrlToString(pieces) {
var toString = pieces.map(p => p.toString).join("\n\n");
@ -252,11 +236,3 @@ routeToString route =
case route of
${toString} `;
}
function formatAsElmUrlParser(pieces) {
var parser =
" [ " + pieces.map(p => p.parser).join("\n , ") + "\n ]";
return `urlParser : Url.Parser (Path PathKey Path.ToPage -> a) a
urlParser =\n Url.oneOf\n ${parser} `;
}