Skip to content

Commit

Permalink
Update inspect script
Browse files Browse the repository at this point in the history
  • Loading branch information
overlookmotel committed Apr 30, 2024
1 parent 4da2a3a commit fb7bce1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tasks/inspect_ast/lib/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,15 @@ const nestedEnums = Object.values(types).flatMap((type) => {
}).sort();
console.log(nestedEnums.join('\n'));

console.log('--------------------');
console.log('> Enums with unboxed variants:');
const enumsWithUnboxedVariants = Object.values(types).flatMap((type) => {
if (type.kind !== 'enum') return [];
return type.variants.filter(({type: variantType}) => variantType && variantType.kind !== 'box')
.map(variant => `${type.name} -> ${variant.type.name}`);
}).sort();
console.log(enumsWithUnboxedVariants.join('\n'));

console.log('--------------------');
console.log('> Structs that need boxing:')
const structsThatNeedBoxing = Object.values(types).filter(type => (
Expand Down

0 comments on commit fb7bce1

Please sign in to comment.