Commit graph

16 commits

Author SHA1 Message Date
jkarres
621d9a949a typo fix 2020-04-05 10:50:10 -07:00
Jennifer Taylor
63f7c5a5d8 Fix typing issue with subscript elements where visitors of Index and Slice could not return each other. 2020-02-03 10:30:29 -08:00
Jennifer Taylor
6eb6ec7b1d Add posonly parameter support to Parameters node.
This is part one of a two-part change to support the posonly param indicator "/".
2020-01-15 11:18:12 -08:00
Jennifer Taylor
40e19ac457 Remove deprecated ExtSlice. 2020-01-08 17:18:19 -08:00
Jennifer Taylor
e2868f703b Add documentation to matchers. 2019-10-01 15:28:58 -07:00
Benjamin Woodruff
90e4efb348 Add docs for MaybeSentinel and RemovalSentinel
These were referred to by other parts of the documentation, and they
provide core parts of our functionality, so we should have explicit
documentation for them.
2019-08-08 11:04:02 -07:00
Benjamin Woodruff
647ef53f0e Finish documentation pass over expressions
This commit mostly focuses on f-strings, collections, comprehensions,
and subscripts/slices.

I added intersphinx support to the sphinx config so I could link to
`ast.literal_eval`.

I exported BaseSimpleComp, since I felt it had some documentation value.
2019-08-06 19:39:43 -07:00
Jennifer Taylor
9ca3d39fb6 Rename Ellipses to Ellipsis to match AST and Python stuff. 2019-08-02 17:17:38 -07:00
Benjamin Woodruff
a4af00dd7f Update the expression documentation
I haven't gone through every expression and cleaned it up yet, but I
have completed the `Names and Object Attributes`, `Operations and
Comparisons`, `Control Flow`, and `Lambda and Function Calls` sections,
as well as part of the `Literal Values` section.
2019-08-02 15:50:17 -07:00
Benjamin Woodruff
f2c887604f Group expression documentation into subcategories
Groups the expression nodes into much smaller subcategories for improved
readablility.

Some nodes defined in the expression module were grouped with statements
because they made more sense there (from a documentation perspective).

This also adds a local table of contents to the top of the nodes page
which better reveals all of the subcategories.

It also exports and categorizes
`BaseAssignTargetExpression`/`BaseDelTargetExpression`. These nodes were
referenced in type annotations of other nodes, so they need to be
exported if only for documentation reasons.
2019-08-01 14:54:36 -07:00
Jennifer Taylor
2e20694ff9 Reorder Statement section of node documentation to have better groups. 2019-07-31 17:27:49 -07:00
Jennifer Taylor
29199ca764 Update documentation on base nodes in statement. 2019-07-31 17:27:49 -07:00
Benjamin Woodruff
88cb0cb88e Remove BaseAtom
I added this originally because it's part of Python's grammar, but since
we merged parenthesis and friends into expressions instead of forming
separate nodes, BaseAtom doesn't have much use.

This fixes also a few bugs:
- A decorator requires a `dotted_name`, so it can only take a `Name` or
  an `Attribute` node, not any atom.
- A `Call` node's function can be any expression, not just a fixed list
  of `BaseExpression` subclasses.
2019-07-31 13:34:07 -07:00
Jennifer Taylor
ebb4681258 Separate operators into groups, add basic description to all existing groups. 2019-07-30 17:36:51 -07:00
Benjamin Woodruff
cf2dfa5ee6 Define DictComp node
This defines the node and adds tests for it, but doesn't implement the
parser for it. That will come in a later PR.
2019-07-30 15:53:07 -07:00
Benjamin Woodruff
c0ac3d7049 Switch from automodule to autoclass everywhere
- Now that we're exporting everything from the top-level libcst package,
  automodule makes a mess of things.
- While it does create more boilerplate, using autoclass/autofunction
  instead of automodule gives us a lot more control over the order in
  which nodes are presented, so we can group them by various categories.

This diff also exports BaseParenthesizableWhitespace, because nodes
refer to it by type, and so it's needed for documentation purposes.
2019-07-29 10:51:59 -07:00