Instagram / Instagram/LibCST

Native parser ignores value of `default_newline` from PartialParserConfig

Open
#902 0 comments 0 reactions 0 assignees View on GitHub
bug parsing
Dominant language
Python
Stars
1.9k
Forks
229
PR merge metrics
No merged PRs in 30d

Description

Using LibCST 0.4.9

Reproduction code:
```py
import os
import libcst

CONFIG = libcst.PartialParserConfig(default_newline="\n")

print("Python parser:", repr(libcst.parse_module('x = 1\r\n', CONFIG).default_newline))
os.environ["LIBCST_PARSER_TYPE"] = "native"
print("Native parser:", repr(libcst.parse_module('x = 1\r\n', CONFIG).default_newline))
```

Expected result:
```
Python parser: '\n'
Native parser: '\n'
```

Actual result:
```
Python parser: '\n'
Native parser: '\r\n'
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.