"/" still needs to be escaped in custom operators
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 10.3k
- Forks
- 438
- PR merge metrics
- No merged PRs in 30d
Description
Looks like I'm hitting the same issue, as discussed in #609. Cross-posting my comments from that closed issue:
Looks like there are stil issues with operators with
/inside. The following code snippet is formatted from OCaml and results in syntax error (try link), until I escape (use<\/>operator instead):let routes = Routes.( Infix.( Handlers.( with_method([ (`GET, return_bigstring <$ empty), (`GET, greeter <$> s("greet") *> int </> str </> str), (`GET, sum <$> s("sum") *> int (</>) int), ]) ) ) );What's even worse, refmt removes those escapings, making the code unparseable again.
dune version: 1.10.0
esy version: 0.5.6
refmt version: Reason 3.3.7 @ 43efc14
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied Reason snippet and the reported refmt version, reproducing the syntax error and the formatter's removal of the escaping. Trace how custom operators containing / are parsed and formatted; done means the example parses successfully and refmt preserves valid escaping.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100