Updated Cashel to F# 2.0, .NET 4.0, FsUnit 0.9 and adjusted namespaces to Cashel. This is a much less drastic than the previous pull request.
Updated to F# 2.0, .NET 4.0, FsUnit 0.9, NUnit 2.5.9, and renamed fun…
…ctions according to current F# conventions. Also added a FAKE build script.
Removed build step to remove tests from projects as that option is no…
…t present in the Cashel solution.
Moved namespace from DevHawk.Parser to Cashel and extracted primitive…
…s into different modules to enable better dependency management.
Renamed functions to make them generally shorter and and more familia…
…r to other parser libraries. skipItem -> item -> token, itemEqual -> matchToken, itemsEqual -> matchTokens, repeatUntil -> until, skip, skipItems -> skips, etc.
Renamed satisfy to filter to match the common function name.
Added ArraySegmentPrimitives and tests. Fixed all but two failing tests.
Fixed failing tests.
Fixed the build script.
Updated .sln and added a .nuspec file. Updates to the build script ar…
Added repeat1While primitive and tests for lists and array segments.
Creates a list from a given string.
Creates an array segment from the provided string input.
Creates a new array segment given a string and an offset. This creates an underlying array from the string with an offset already set.
Same as line 6, but defaulted to an offset of 1 for single character matches.
F# generally uses structural comparisons. However, NUnit does not, especially when working with general .NET types like ArraySegment. This operator tests the structural sameness of two array segments. The goal is not to have identical ArraySegment instances or even two instances using the same underlying array, as most tests are recreating the array as well for readability. These will likely be refactored once the ArraySegmentPrimitives are refactored to always use the same underlying buffer.
These are intended to be used in single-threaded event loop state machines (a mouthful) which share a single, segmented memory buffer. Given the specificity of the intended target, this may best be removed. However, it also serves as an example of how one might extend the core functionality of the cashel Parser monad.
This should really be of type Parser<ArraySegment<'a> list, ArraySegment<'a>>.
Again, type should be Parser<ArraySegment<'a> list, unit>.
Combinators matching more than one value should ideally be typed as Parser<ArraySegment<'a> list, ArraySegment<'a> list>. This begins looking hairy, but it matches the intent: keep the values in the original buffer and provide a way to access them. One might presume that a single ArraySegment<'a> is all that's necessary; however, you quickly lose the ability to skip characters that are not needed, and the combinations further up the parse may not match anymore.
Removed ArraySegmentPrimitives and merged CharListPrimitives back int…
…o ListPrimitives. The idea behind ArraySegmentPrimitives proved to be flawed.
I just removed the ArraySegment stuff. Turns out it wasn't helpful in the end, as you surmised when we last spoke. :)
So I finally got around to checking out your latest pull request. I'm not 100% sold on FAKE (and the build script needs some cleanup), but I like most of your changes. Question: why did you add ParserBuilder.ReturnFrom, map, unfold and <*>? As far as I can tell, these aren't used anywhere inthe project and have no tests. I assume you added them for a reason?
Yikes. I thought I had tests for those at some point. I was using them in one of my projects and thought that was the best place to put them, but I should have double-checked that the tests were there. Apologies for that. I'll try to add them soon.