Git Product home page Git Product logo

ironrure's People

Contributors

cirzen avatar hanabi1224 avatar idisposable avatar iwillspeak avatar justlou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ironrure's Issues

Abstract IntPtr IDisposable Stuff

At the moment we have two classes (Regex and Error) which are IDisposable wrappers around raw pointers. The IDisposable implementations are pretty much the same for both. With the addition of captures it might be worth creating an abstract base class for this.

Make `Captures` an `IEnumerable` of `Match`

This would make logical sense to allow the user to enumerate the matches in a given capture group.

Could be as simple as a yield-based custom iterator which loops through the capture indices and returns the matches one by one by doing self[i].

Allow Targetting .NET Framwork Any CPU

Currently if you target Any CPU the output directory will contain just one copy of the rure.dll library. This can be worked around for different architectures by manually targetting the appropriate architecture's Runtime Identifier (win7-x64 etc).

For .NET Framework we can work around this at runtime by manually loading the correct library disk in the RureFfi class's static-constructor. This should ensure the library is loaded before P/Invoke gets involved. For .NET core this shouldn't be needed as the appropriate library will be loaded from the runtimes folder.

Add Captures Support

Captures support for regex searching and the ability to query captures information from the regex itself.

Add a Regex.Captures method (or similar based on the naming scheme from .NET). This should provide a set of captures that can be directly queried by indexing with [uint], along with iteration support.

Given a regex instnace you should be able to convert a capture name into a capture index. Maybe use an indexer here again. E.g.: new Regex("(<foo>.)")["foo"] // => 1.

Create 'Drop-In' Wrapper

Create a second package which wraps the main IronRure one and provides a 'drop-in' replacement for .NET Regex.

Add Options Support to Regex

Currently the Regex class can only be instantiated with a basic pattern. Add a constructor overload that takes an options object and flags integer.

The Options object should itself be a managed wrapper around the rure_options, handling the lifetime of that object. This should allow users to cache options between creating multiple Regex instances.

Add `Replace` Support

Add the following methods to Regex:

  • Replace - replaces the first match.
  • ReplaceAll - replaces all matches.

These should accept either constant strings, closures or IReplacer instances in the same way that the rust regex and rust-onig do.

Add Overload to `Regex` Constructor

Update the constructor of Regex to add an overload which takes flags but no options, similar to the RegexSet. Ideally both should have the same set of constructors for 1.0.

Upgrade Rust Regex Version

Change the version of the rust regex crate that the batteries reference and upgrade the batteries in this project.

Create Benchmark

Should show a performance comparison between this lib and .NET Regex and RE2.NET.

Add Regex Set Support

Create a wrapper around rure_regex_set. This should be really useful as it minimises the number of managed/unmanaged transitions required to match the regex.

Regex 1.0 support

Like the title says. Now regex 1.0 is a thing we should move to using it in this library.

FFI bindings should match target calling convention

Currently this defaults to WinAPI on windows. Should be C call.

Each of the DllImport attributes in the RureFfi class needs to have the calling convention set to the c calling convention (CallingConvention.Cdecl).

https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute.callingconvention?view=netcore-2.0
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.callingconvention?view=netcore-2.0#Fields

Set Package Details

Currently the package description and author are empty. Create package descriptions and add them to the .csproj files.

Switch to `SafeHandle` for Unmanaged Resources

Switchout the unmanaged resource with specific handle wrappers that inherit from SafeHandle. This should bring some extra safety to the handle types as SafeHandles appear to work transparently with FFI.

Address Regex Memory Bloat in Long Running Applications

Thread-local scratch space is only clearered when the regex is disposed. If regexes are used on the threadpool you can end up with quite a lot of memory usage quite quickly.

We could solve this by exposing the ability to clone the regex for each match.

Satellite Launch Date is Incorrect

I don't know what I was up to when I originally googled the satellite launch date used in the README but it isn't correct. Sputnik was launched in 1957. I've got the tee shirt and everything.

Update the README to correct the date of first satellite launch, and any places that depend on it.

ContentFiles from Batteries Should not be PrivateAssets

Currently the projects and tests in IronRure work correctly, however consumers of the
IronRure package will not get the ContentFiles from the windows batteries. This can
be fixed by removing contentFiles from the 'dependency assets'.

This should just be a matter of adding the following to the batteries nuget reference:

    <PrivateAssets>analyzers;build</PrivateAssets>

https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#controlling-dependency-assets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.