Commit graph

5 commits

Author SHA1 Message Date
jimmylai
b232547826
[typing] refactor TypeVar CSTNodeT for consistency and reusability (#54) 2019-08-29 21:30:34 -07:00
Jennifer Taylor
9a90fda8c3 Document additional caveats with parse_statement and parse_expression. 2019-08-29 11:33:57 -07:00
Jennifer Taylor
95f649af79 Fix incorrect round-tripping of newlines when parsing statements.
Hypothesis found that when we have a statement like `pass\r`, we detect that
`\r` is the default and parse the trailing newline as `Newline(None)`. However, when
we render the statement back out again, since we don't have a module, we construct
a default module which treats `Newline(None)` as a `\n` not a '\r'. So, when we are
parsing statements or expressions, disable auto-inferring the default newline and always
infer the default rendered newline (`\n`) so that rendering a statement/expression back
out behaves as expected.
2019-08-29 11:33:57 -07:00
Jennifer Taylor
47a3c75670 Add documentation for parse_module and parse_expression. 2019-08-01 14:55:19 -07:00
Jennifer Taylor
3fb60b9706 Make parser package private
Now that this is imported from the top level, make it private.
2019-07-26 12:48:22 -07:00
Renamed from libcst/parser/_entrypoints.py (Browse further)