Comments (7)
I was thinking the same.
from reason.
The pretty printer currently uses objects/classes, and those were recently disabled (because they deferred to the build in pretty printer). We could either trivially make it not use objects (a bunch of recursive let bindings instead) or implement objects.
I have a giant stack of diffs that I'm waiting to land as soon as the Easy_format
changes are pushed to OPAM, so I think it would be best to implement it after I land those to prevent many merge conflicts.
from reason.
I think we are almost ready for this.
from reason.
This is depending on #63
from reason.
I thought this would be difficult to self-host because of the challenges in building Reason from source, when you don't have an available Reason. But then I realized we can use a simple trick. The OCaml compiler (supposedly) supports loading files that are simply serialized ASTs. (The same output that -pp
accepts, and the same output that refmt
spits out by default).
So we can simply check in the serialized AST for reason_pprint_ast
and friends. Our build scripts for Reason can simply disregard the actual .re
files and only ever build the serialized AST files. The result is that it successfully builds a version of Reason that is a binary, even if Reason was not originally installed.
from reason.
@jordwalke Interesting idea. If we are able to do that, I imagine we can even write parsers in reason as well (need to add a -pp option in Menhir first).
from reason.
Stale, will keep it in ocaml for now
from reason.
Related Issues (20)
- Comments and opens HOT 2
- module types with one line and attribute prints in one line instead of two HOT 1
- Release process HOT 2
- Polyvariants following printing as variants
- Upgrade menhir to recent version HOT 2
- cannot build 3.9.0 with esy HOT 5
- refmt removes parents leading to invalid code HOT 2
- Application with comment, breaks into newline HOT 1
- Refmt doesn't break the line when an extra long string occurs in switch branch
- Rfmt mangles partial application of operators HOT 1
- Support for "string" [@JSX] HOT 2
- Support for `external%foo`
- Investigate potential outcometree bug
- Pattern-matching of `bool` value is formatted to ternary if we match `true` first HOT 3
- Open module from another directory HOT 1
- Merlin infers wrong types for labelled optional arguments in 5.2
- Formatting destructured record with letops results in a syntax error
- outcome printer: `test/class.t` tests show failure
- rtop reads init.ml
- use topfind is not working in rtop HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reason.