Code Monkey home page Code Monkey logo

celma's People

Contributors

d-plaindoux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

celma's Issues

Optimization

Since the Celma parser produces an AST we are able to traverse it in order to optimize the produced parser. This can be done by computing the first(s) element in order to have a more predictive parser removing try and backtracks.

What do `alter`s mean?

First of all, thanks for the work. Especially the macro, really making char to char consuming more clear (meaningful).

While I was reading the README, one thing I did not quite get. What do those alters mean?

I guess ^ means "not any", ! means "not all". But I have no idea what does # mean.

How to do "look ahead"?

For example, in this parsec rule let STRING:{String} = ('"' c=#((("\"" -> {'\"'})|^'"')*) '"') -> {mk_string(c)}, I assuming that it consumes the whole string of "something". If I want to stop when next char is double quote, but leave it in the stream?

Escaping issue.

First of all, I do not know if this is Celma issue, or just how proc macro works.

When I make parsec_rules, I write '\"' in code. Then use cargo expand. The expanded code contains '\"' as expected.

But when I write "\"", the expanded code is "\\\"".

warning: unused variable: `a`

  --> ~/src/Git/celma/core/src/parser/lookahead.rs:54:21
   |
54 |             Success(a, _, ba) => Success((), s, ba),
   |                     ^ help: if this is intentional, prefix it with an underscore: `_a`
   |
   = note: `#[warn(unused_variables)]` on by default

Generalization

Celma supports generic streams. The Celma parser metalanguage should be generalized and not only reduced to input like a stream of chars.

Lookahead parser

The lookahead should be implemented in

  • the core library
  • as an extension of the macro-based language.

Question: How to match "chars until a string"?

For example, bash variable substitution. The input is written as "This is ${prog_name} speaking". In my opinion, it should be parsed into something like [PLAIN("This is "), VAR("prog_name"), PLAIN(" speaking")]. But when I write the plain parser, I could not figure out how to "consume any chars until string '${'".

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.