Git Product home page Git Product logo

Comments (3)

cdleary avatar cdleary commented on May 4, 2024

Note we may want to re-open or file a new issue for just "protobuf to DSLX conversion produces really long literals in a single line" -- we could do something temporary before we have a full auto formatting solution of any kind that a) assumes infinite line length and b) just causes appropriate newlines-each-struct-field-with-indent/dedent to happen when the serialized single-line version is beyond a certain length (say 80 chars). cc @RobSpringer will leave up to you how to track that one best.

from xls.

cdleary avatar cdleary commented on May 4, 2024

Note that most DSLX "language tests" have auto-formatting enabled as of eb08413 -- there are about four .x files in the repo that cannot be successfully auto-formatted now, will try to knock those out next week and have std.x be auto-formatted (with a test that it remains auto-formatted).

WIP binary is dslx_fmt https://github.com/google/xls/blob/d445fc4f61bd3569c309c4d8b962145ad83efe0c/xls/dslx/dslx_fmt.cc

from xls.

cdleary avatar cdleary commented on May 4, 2024

I'd consider it fairly complete now -- notably most remaining holes are due to the fact comments can go in the middle of constructs at arbitrary spots. To handle that large space of possibilities we could "mark" comments from the original source text runs as being formatted properly and give an error return code if there exist any unhandled comments from the original text. But I think I can largely claim this is complete, even given the few comment-formatting escapes and some remaining 100-char escapes it mostly does what we're looking for.

from xls.

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.