Giter Site home page Giter Site logo

cakeparse's People

Contributors

sargunv 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

Watchers

 avatar  avatar  avatar

Forkers

cybernetics

cakeparse's Issues

Can't parse a certain grammar

I'm trying to use cakeparse to write the grammar for my shell, https://github.com/cbeust/kash and I can't seem to define a simple grammar to allow either "and" commands:

a && b && c

or "pipe" commands:

a | b | c

Here is what I have, in short:

        val andCommand = singleCommand and zeroOrMore(andAnd and singleCommand)
        val pipeCommand = singleCommand and zeroOrMore(pipe and singleCommand)
        val goal = andCommand or pipeCommand

With that goal, I can only parse one of these two lines but never both.

Am I missing something?

Stack overflow with large input

I may be doing something wrong, but I get a stack overflow when I do the following:

val number = token("number", "[0-9]+")
val space = token("space", "\\s+")
val goal = oneOrMore(number before optional(space))

val input = "557196 56123\n".repeat(5000)
println(input)
val lexed = setOf(number, space).lexer().lex(input).cached()
println("lexed")
val result = lexed.parseToEnd(goal).value
println("Result: $result")

Gradle could not resolve dependencies

When using what's suggested in the docs: compile "me.sargunvohra.lib:CakeParse:1.1.1" gradle gives me a ModuleVersionNotFoundException, but that's easily solved by using lowercase instead. I don't know if this is OS related, specific to the gradle version I use, or just an error in the docs.

I use Window 10 and Gradle 3.3

Write failure and edge case tests for parsers

Need to write tests for:

  • Unexpected end of file when expected a token
  • Unexpected token when expected an end of file
  • Unexpected token when expected another token
  • Instantiate a lexer with tokens that have non-alphanumeric names

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.