SeeminglyScience / ILAssembler

ILAsm-like DSL for PowerShell
MIT License
16 stars 1 forks source link

Attribute support #7

Open SeeminglyScience opened 4 years ago

SeeminglyScience commented 4 years ago

Should look like:

using namespace System
using namespace System.Diagnostics
using namespace System.Runtime.CompilerServices

il { [byref] [int] $_._([object[]] $args) } {
    # Method attribute
    .custom { [void] [DebuggerStepThroughAttribute].new() } = {
        0x01, 0x00, 0x00, 0x00
    }

    # Return type attribute
    .param [0] {
        .custom { [void] [IsReadOnlyAttribute].new() } = {
            0x01, 0x00, 0x00, 0x00
        }
    }

    # Parameter "args"
    .param [1] {
        .custom { [void] [ParamArrayAttribute].new() } = {
            0x01, 0x00, 0x00, 0x00
        }
    }

    ldnull
    ret
}