Giter VIP home page Giter VIP logo

fsharp.text.regexprovider's Introduction

fsharp.text.regexprovider's People

Contributors

chrsteinert avatar dtchepak avatar forki avatar fsprojectsgit avatar marklam avatar pirrmann avatar sergey-tihon avatar thinkbeforecoding avatar vasily-kirichenko avatar

Stargazers

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

Watchers

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

fsharp.text.regexprovider's Issues

Hang in intellisense or shutdown due to HashSet corruption

I'm getting a very frequent hang in Visual Studio 2013 when working with a source file containing multiple RegexProvider types.
When I attached to the hung devenv, I found two threads both stuck in HashSet.Contains, through Helper.niceName. It looks like the HashSet has been corrupted, since the bucket being searched has a 'next' of itself.
It's a bit of guesswork, but I suspect a race condition between the two threads caused the HashSet to become corrupted due to concurrent operations from the editor or add-in, since generalTypeSet is a non-thread-safe singleton.

Return provided Match type from Match.NextMatch()

When there are several matches for the pattern in the input string, those can be obtained using Matches() instead of Match(). This correctly returns a sequence of the provided Match type.

However, it is also possible to get to the next match directly from a Match instance using Match.NextMatch(). This currently only returns System.Text.RegularExpressions.Match, not the provided type.

Optionally change the names of the provided methods

Description

I'm trying to write code that can work on several regular expressions that share common groups. In order to do that I'm trying to use static constraints and inline methods to perform "duck-typing" on the provided types. This could work, but as methods names on provided types are the same that the ones in the Regex base class type, I then get a compiler error because the correct overload of the function can't be resolved.

I'd love to have the provided methods named TypedMatch and TypedMatches instead of Match and Matches. That way, the overload resolution problem cannot happen. In order to keep backward compatibility, that could be implemented using an optional Prefix parameter for the provider, that would change the names of the generated methods.

If the maintainers are ok with this idea in principle, I'll be pleased to do a pull-request.

.NET Core support

As of now this TP is not compatible with .NET Core. It would be a very nice addition if it would be made compatible with this platform as well. How much work would it be making it compile to .NET Core currently?

Support Replace() with MatchEvaluator using the provided Match type

The Replace() instance method of the Regex class has overloads taking a MatchEvaluator instance, which is a delegate with the signature Match -> string. To benefit from the provided Match type here, a custom MatchEvaluator type would have to be provided, and the Replace() overloads adjusted accordingly.

(On second thought, that's probably not even possible, but I'll leave that to those who actually have a clue about type providers.)

Unable to generate docs

Missing code formatting on http://fsprojects.github.io/FSharp.Text.RegexProvider/

Running build GenerateDocs gave this error:

System.TypeInitializationException: The type initializer for 'Microsoft.FSharp.Metadata.AssemblyLoader' threw an exception. 
---> System.TypeInitializationException: The type initializer for '<StartupCode$FSharp-PowerPack-Metadata>.$Metadata' threw an exception. 
---> System.ArgumentException: could not produce an FSharpAssembly object for the assembly 'FSharp.Core' because this is not an F# assembly

Consider renaming to FSharp.Text.RegexProvider

Hi @dtchepak

I'm wondering if you might be able to rename this project to "FSharp.Text.RegexProvider"? And likewise the provider would be in the namespace "FSharp.Text".

If you could I'd be immensely grateful.

(The reasons are somewhat obvious but are explained in the recommended guidelines in more detail, would be happy to talk it over though!)

Best regards,
Don

Support typed match with offset

Hello fellows,

It would improve the provider if typed match supports all overloads of the regular match function like specifying an offset.

If you're fine with this I would make a PR.

problem running build.cmd after git clone

Description

Running build.cmd does not work just after running clone. The problem is that paket have not installed fsi.exe under the packages folder.

Repro steps

git clone ...
build.cmd

Known workaround

I commented out GenerateHelp task in the build.fsx dependency graph.

Then

build.cmd

worked and finally

git checkout build.fsx

to verify that the build script worked after paket had installed FSI executable somewhere under the packages folder.

This is just a heads up. Feel free to ignore this issue. I am just inspecting the Regex type provider, to learn about TP's.

Support option type for the typed match expression

Hello again :)

So far I understood the regex class it's safe to use the complete match and it's groups if the parent match field Success is true. Moreover the same approach is used for active patterns and therefor I would like to add a tryTypedMatch function to the provider having as additional fields the value of each group.

Would you appreciate this?

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.