fix parsing slot count by only accepting specific entities

This commit is contained in:
mdgriffith 2020-08-01 19:54:12 -04:00
parent 0bb0bcfb55
commit 4d72626a27
2 changed files with 15 additions and 3 deletions

View File

@ -50,8 +50,7 @@ export const compileAndTransform = async (
source: elmSource,
});
// This will parse everything in `elm-packages`, but it causes everything to fail for some reason :/
// Object.assign(parsedVariants, parseDir('elm-packages'));
Object.assign(parsedVariants, parseDir('elm-packages'));
const source = ts.createSourceFile(
'elm.js',

View File

@ -124,10 +124,23 @@ export const parseElm = ({
break;
}
default: {
case 'type_ref': {
slots.push(detail.text);
break;
}
case 'type_variable': {
slots.push(detail.text);
break;
}
case 'type_expression': {
slots.push(detail.text);
break;
}
default: {
break;
}
}
}
totalTypeSlotCount = Math.max(totalTypeSlotCount, slots.length);