mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-25 22:50:42 +03:00
fix parsing slot count by only accepting specific entities
This commit is contained in:
parent
0bb0bcfb55
commit
4d72626a27
@ -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',
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user