microsoft / microsoft/typespec
Allow \ to escape newline in multi-line strings
Open
design:needed
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Currently TypeSpec adds a newline (\n) at the end of every line except the last of a multi-line string. This is consistent with the behavior of many HLLs like JavaScript and Python. But those languages also allow a backslash (\) to escape that newline. TypeSpec should have a similar feature.
### JavaScript
```js
> foo = "bar \
... baz"
'bar baz'
>
```
### Python
```python
>>> foo = """bar \
... baz"""
>>> foo
'bar baz'
>>>
```
Contributor guide
Assessment
This issue has not been assessed yet.