Code Monkey home page Code Monkey logo

Comments (2)

quark17 avatar quark17 commented on June 26, 2024

Thanks for reporting these. There's been no effort to make sure that the pretty-printer for an entire BSV file will read back in correctly and identically, so I am not surprised if you find issues like this. The only concern was the printing of any snippets that appear in error messages to the user, which are usually just types, or IDs, or individual method calls. The -d dump flags were considered hidden features for developers, and they didn't need to be perfect (and could change or disappear at any time). But it's a good aim to have the pretty-printer work for full programs, so thank you for reporting this.

The module type should be preserved. I assume that this is just a bug in CVPrint.hs, probably around line 165, in the function p2defs:

line1 = t"module" <+> pvpId d i <> f ys <> t"(" <> pvPrint d 0 ity <> t")"

from bsc.

RyanGlScott avatar RyanGlScott commented on June 26, 2024

Thanks! And I certainly don't expect the pretty-printer to be 100% accurate in all cases. My use case is that I am generating very simple BSV code programmatically using the bsc source code, and I ran into some situations where even very simple code fails to parse when fed back into bsc. My goal is to fix only those issues that I encounter when pretty-printing the very limited subset of BSV that I'm generating.

I'll give CVPrint a closer look. For posterity's sake, here is a permalink to the code mentioned in #663 (comment):

line1 = t"module" <+> pvpId d i <> f ys <> t"(" <> pvPrint d 0 ity <> t")"

from bsc.

Related Issues (20)

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.