viewtopic.php?f=4&t=17215&start=30#p22538
nerdzero mentioned doing this in the IDE add-in, but I would think doing it in the compiler would make more sense so that the compiler and IDE were always in sync doing the same thing.
Here is a tiny Cobra sample:
"""
cecil.cobra
Download nuget.exe and then:
nuget install Mono.Cecil
copy Mono.Cecil<TAB>\...\Mono.Cecil.dll .
cobra cecil.cobra
@help AssemblyDefinition
@help Module
@help TypeDefinition
"""
use Mono.Cecil
class P
def main
name = 'Cobra.Core.dll'
ad = AssemblyDefinition.readAssembly(name)
trace ad, ad.name, ad.fullName
for mod in ad.modules
trace mod, mod.name
for type in mod.types
trace type, type.name
print 'done.'
The more I think about it, the more convinced I am to go this route. System.Reflection has its problems and no one on the .NET team seems to be fixing them.
Plenty of projects have gone before us, so I think we'll be fine:
https://github.com/jbevain/cecil/wiki/Users
Any questions or concerns?