Code Monkey home page Code Monkey logo

oppen-pretty-printer's People

Contributors

mark-summerfield avatar stevej2608 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

oppen-pretty-printer's Issues

Small problems in README

The README should have "Tokens as T" rather than "Token as T" and print(pprint(tokens)) to see the output.

However, all I can get from the test program after the above changes is:
beginx := 40 + 2end
even after adjusting the lineWidth using
pprint_open(lineWidth=5)

The first eg issues...

I've now realised that the output of the first example is as intended.

But it doesn't seem right; surely the whole point of the eg is to show a simple pprint with a begin/end block?

I changed the first example to this:

tokens = [
    T.BEGIN(),
    T.STRING("begin"),
    T.LINEBREAK,
    T.STRING("x"),
    T.BREAK(), T.STRING(":="), T.BREAK(),
    T.STRING("40"),
    T.BREAK(), T.STRING("+"), T.BREAK(),
    T.STRING("2"),
    T.LINEBREAK,
    T.STRING("end"),
    T.END(),
    T.EOF()]
for line in pprint(tokens).splitlines(): print(line)

But this surprisingly produces:

begin
  x := 40 + 2
  end

Well, it is a surpise to me.

Failed to pip install

I did a pip install using Python 3.10 on Linux but the install did not include tokens.py:

.../python3.10/site-packages/oppen_pretty_printer-0.1.2-py3.10.egg-info
.../python3.10/site-packages/oppen_pretty_printer
.../python3.10/site-packages/oppen_pretty_printer/__pycache__/pretty_oppen.cpython-310.pyc
.../python3.10/site-packages/oppen_pretty_printer/__pycache__/pretty.cpython-310.pyc
.../python3.10/site-packages/oppen_pretty_printer/pretty.py
.../python3.10/site-packages/oppen_pretty_printer/pretty_oppen.py

So, of course it doesn't work.

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.