Giter Club home page Giter Club logo

sprache's People

Contributors

nblumhardt avatar

sprache's Issues

Enhancement: Unit testing grammers

My experience so far is that it is extremely important to write tests against 
your grammer to verify the parsing behavior.  What would make that easier would 
be if the AssertParser was distributed along with the library.  I think the 
classes for ResultHelper, Success and Failure would need to be public as well.  
Is this something we could look forward to in a future release?  I know it's 
open source and I could make the changes to a fork but I hate to do that if 
it's something that is a common need and you would be open to.

Original issue reported on code.google.com by [email protected] on 9 Apr 2012 at 8:16

Failure to build Sprache on Mono 2.8

What steps will reproduce the problem?
1. hg clone ...
2. cd sprache
3. xbuild

What is the expected output? What do you see instead?

Build FAILED.
Errors:

/Users/jeffreymiller/Projects/sprache/Sprache.sln (default targets) ->
(Build target) ->
/Users/jeffreymiller/Projects/sprache/Sprache/Sprache.csproj (default targets) 
->
/Library/Frameworks/Mono.framework/Versions/2.8.1/lib/mono/4.0/Microsoft.CSharp.
targets (CoreCompile target) ->

    Parse.cs(430,64): error CS0266: Cannot implicitly convert type `Sprache.Parser<System.Collections.Generic.IEnumerable<T>>' to `Sprache.Parser<T>'. An explicit conversion exists (are you missing a cast?)
    Parse.cs(430,64): error CS1662: Cannot convert `lambda expression' to delegate type `System.Func<System.Collections.Generic.IEnumerable<T>,Sprache.Parser<T>>' because some of the return types in the block are not implicitly convertible to the delegate return type



What version of the product are you using? On what operating system?

J-Scott-Millers-iMac:sprache jeffreymiller$ uname -a
Darwin J-Scott-Millers-iMac.local 10.5.0 Darwin Kernel Version 10.5.0: Fri Nov  
5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/RELEASE_I386 i386

J-Scott-Millers-iMac:sprache jeffreymiller$ mono --version
Mono JIT compiler version 2.8.1 (tarball Mon Nov 22 09:52:37 MST 2010)
Copyright (C) 2002-2010 Novell, Inc and Contributors. www.mono-project.com
    TLS:           normal
    SIGSEGV:       normal
    Notification:  Thread + polling
    Architecture:  x86
    Disabled:      none
    Misc:          debugger softdebug 
    LLVM:          supported, not enabled.
    GC:            Included Boehm (with typed GC)



Please provide any additional information below.

It looks like this is a problem with Mono's generic type inference. I haven't 
had a chance to come up with a simple repro case to confirm this, but I have 
found that if the lambda declared within the Until parser extension method is 
explicitly declared, all is well. The modified method looks like:

        /// <summary>
        /// Parse a sequence of items until a terminator is reached.
        /// Returns the sequence, discarding the terminator.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="U"></typeparam>
        /// <param name="parser"></param>
        /// <param name="until"></param>
        /// <returns></returns>
        public static Parser<IEnumerable<T>> Until<T, U>(this Parser<T> parser, Parser<U> until)
        {
            //return parser.Except(until).Many().Then(r => until.Return(r));

            Func<IEnumerable<T>, Parser<IEnumerable<T>>> returnFunc = r => until.Return(r);

            return parser.Except(until).Many().Then(returnFunc);
        }

Original issue reported on code.google.com by [email protected] on 30 Dec 2010 at 6:27

Does not support decimals without leading digits

For the decimal ".23" is not recognised by Parse.Decimal.

Fix: 
http://code.google.com/r/robert-sprache/source/detail?r=bc37605aba52ba0ced6d9268
8b2b1a9b18f60705

Most likely a more succinct way to do it though

Original issue reported on code.google.com by [email protected] on 21 May 2012 at 1:49

Base class for object-oriented parsers

E.g. in Ometa a parser can inherit from another parser and extend/modify 
productions.

Perhaps not the default/only way to use Sprache, but well worth exploring as 
base classes for common kinds of parsers would be a great way to get started 
quickly.

Original issue reported on code.google.com by [email protected] on 5 Jan 2010 at 12:02

Decimal is culture specific

Parse.Decimal parses numbers with fractions where the decimal separator is a 
".". 

This should be replaced with 
System.Globalization.CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSepara
tor. 

Original issue reported on code.google.com by [email protected] on 28 Dec 2012 at 4:34

Downgrade to .NET 3.5

Sprache doesn't currently use any .NET 4.0 specific features, so it can be 
downgraded to 3.5.

Patch: 
http://code.google.com/r/mauricioscheffer-1/source/detail?r=8dd42ab88fb3c9102918
e1f6634f5bc40fc59c54

Original issue reported on code.google.com by [email protected] on 2 Nov 2011 at 3:43

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.