Code Monkey home page Code Monkey logo

obelisk's Issues

nonempty_list latex output is incomplete

Hi,

On the same file than the one in #10 ; on the line with the nonempty_list, here's what I get in the LaTeX output:

  & \grambar &\MATCH*{} \expr*{} nonempty\_list \zzzzzzEND*{}\\

Which visually gives something like: MATCH <expr> nonempty_list END.

Obviously, something is missing, it should be: MATCH <expr> nonempty_list(<match_case>) END.

Display of pairs seems erroneous

The grammar

edn_assoc:
  | BEGIN_ASSOC; lp = list(pair(value, value)); RIGHT_BRACE { lp }
;

will result in

<edn_assoc> ::= BEGIN_ASSOC <value> <value>* RIGHT_BRACE

and I would expect

<edn_assoc> ::= BEGIN_ASSOC (<value> <value>)* RIGHT_BRACE

Please let me know if there something I'm missing!
Also, thank you for the great software ๐Ÿ‘

nonempty_list isn't recognized ?

Hi !

I've have a .mly file that looks like:

let expr :=
...
| MATCH; m = expr; l = nonempty_list(match_case); END; { Match (Raw, m, l) }

I then run obelisk -i parser.mly and get:

<expr> ::= ...
         ...
         | MATCH <expr> nonempty_list(<match_case>) END

But I would expect the following:

<expr> ::= ...
         ...
         | MATCH <expr> <match_case>+ END

Am I missing something ? Note that, in the same file, list(X) is correctly recognized and translated to X*.

EDIT: I'm on OCaml 4.09.0, menhir 20200211 and obelisk 0.5.0.

Productions starting with "end" generate wrong Latex

Consider the following production definition:

endif: END | ENDIF { }

In Latex version, it will generate a \newcommand\endif{end\_if}, however, \newcommand definitions are not allowed to have names starting with end, or it will emit an error. The generated code for productions starting with end should be with \def instead.

[LaTeX] Add an option to generate only the grammar

Unless I'm mistaken, it's only possible to generate a complete, standalone file, as of now. If so, it would be nice to add an option to generate only the grammar part, in order to include it in a larger document.

Bars

Production and group bars should be treated differently in printers.

[LaTeX] Incorrect or dubious printing

The following file does not produce a very nice output for comma_sep and comma_sep1:

%public %inline comma_sep(X) :
  xs = separated_list(COMMA, X)
    { xs }

%public %inline comma_sep1(X) :
  xs = separated_nonempty_list(COMMA, X)
    { xs }

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.