Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Improve conversion of quoted strings from Reason. #238

Merged
merged 2 commits into from
Jan 17, 2021

Conversation

IwanKaramazow
Copy link
Contributor

Fixes #237

The conversion from Reason to ReScript naively picks up // as comments inside quoted strings..

input:

let x = {j|https://www.apple.com|j};
let x = {|https://www.apple.com|};
let x = {js|https://www.apple.com|js};

output:

let x = j`https://www.apple.com` //www.apple.com|j};
let x = `https://www.apple.com` //www.apple.com|};
let x = `https://www.apple.com` //www.apple.com|js};

This patch fixes this behaviour and doesn't produce any extra comments

Iwan added 2 commits January 17, 2021 19:03
Fixes #237

The conversion from Reason to ReScript naively picks up `//` as comments inside quoted strings..

input:
```reason
let x = {j|https://www.apple.com|j};
let x = {|https://www.apple.com|};
let x = {js|https://www.apple.com|js};
```

output:
```rescript
let x = j`https://www.apple.com` //www.apple.com|j};
let x = `https://www.apple.com` //www.apple.com|};
let x = `https://www.apple.com` //www.apple.com|js};
```

This patch fixes this behaviour and doesn't produce any extra comments
@IwanKaramazow IwanKaramazow merged commit a92aa9c into master Jan 17, 2021
@ryyppy ryyppy deleted the quoted-string-conversion branch May 3, 2022 05:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Conversion of quoted strings sometimes introduces extra comments when containing comment like syntax
1 participant