<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Reflection.Emit;

namespace CIL
{
    public class ILReader : IEnumerator<Instruction>
    {
        Module module;
        IList<LocalVariableInfo> locals;
        ParameterInfo[] args;
        byte[] code;
        int i;

        public ILReader(Module module, MethodBody body, ParameterInfo[] args)
        {
            this.module = module;
            this.locals = body.LocalVariables;
            this.args = args;
            this.code = body.GetILAsByteArray();
        }

        public Instruction Current { get; private set; }

        public LocalVariableInfo Local(int slot)
        {
            return locals[slot];
        }

        public ParameterInfo Parameter(int slot)
        {
            return args[slot];
        }

        public struct Label
        {
            internal int pos;
        }

        public Label Mark()
        {
            return new Label { pos = i };
        }

        public void Seek(Label mark)
        {
            i = mark.pos;
        }

        public bool MoveNext()
        {
            if (i >= code.Length) return false;
            var op = IL.GetOpCode(code, ref i);
            var arg = default(Operand);
            switch (op.OperandType)
            {<commit_msg>expose the function's arguments and locals for easier processing<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Reflection.Emit;

namespace CIL
{
    public class ILReader : IEnumerator<Instruction>
    {
        Module module;
        byte[] code;
        int i;

        public ILReader(Module module, MethodBody body, ParameterInfo[] args)
        {
            this.module = module;
            this.Locals = body.LocalVariables;
            this.Args = args;
            this.code = body.GetILAsByteArray();
        }

        public Instruction Current { get; private set; }
        public IList<LocalVariableInfo> Locals { get; private set; }
        public IList<ParameterInfo> Args { get; private set; }

        public struct Label
        {
            internal int pos;
        }

        public Label Mark()
        {
            return new Label { pos = i };
        }

        public void Seek(Label mark)
        {
            i = mark.pos;
        }

        public bool MoveNext()
        {
            if (i >= code.Length) return false;
            var op = IL.GetOpCode(code, ref i);
            var arg = default(Operand);
            switch (op.OperandType)
            {
{'fraction_non_alphanumeric': 0.0845229151014275, 'fraction_numerical': 0.0, 'mean_word_length': 1.644488579940417, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6386884', 'n_tokens_mistral': 701, 'n_tokens_neox': 696, 'n_words': 202}