MCPcopy Create free account
hub / github.com/astral-sh/ruff / parse_simple_expression

Method parse_simple_expression

crates/ruff_python_parser/src/parser/expression.rs:239–241  ·  view source on GitHub ↗

Parses every Python expression except unparenthesized tuples, named expressions, and `if` expression. This is a combination of the `disjunction`, `starred_expression`, `yield_expr` and `lambdef` rules of the [Python grammar]. Note that this function parses lambda expression but reports an error as they're not allowed in this context. This is done for better error recovery. Use [`Parser::parse_co

(&mut self, context: ExpressionContext)

Source from the content-addressed store, hash-verified

237 ///
238 /// [Python grammar]: https://docs.python.org/3/reference/grammar.html
239 fn parse_simple_expression(&mut self, context: ExpressionContext) -> ParsedExpr {
240 self.parse_binary_expression_or_higher(OperatorPrecedence::None, context)
241 }
242
243 /// Parses a binary expression using the [Pratt parsing algorithm].
244 ///

Tested by

no test coverage detected