conditional_expression_test\r
=\r
test_variable:variable_identifier\r
- {SP}* "is" {SP}*\r
+ {SP}* "is"\r
+ [ {SP}+ "not" {SP} negated:`True` ]\r
+ {SP}*\r
test_function:variable_identifier\r
[\r
{SP}*\r
parse_variable(ast['test_function_parameter'])\r
]\r
\r
- return nodes.Test(\r
+ test_node = nodes.Test(\r
node,\r
name,\r
args,\r
lineno=lineno_from_parseinfo(ast['parseinfo'])\r
)\r
\r
+ if 'negated' in ast and ast['negated']:\r
+ test_node = nodes.Not(\r
+ test_node,\r
+ lineno=lineno_from_parseinfo(ast['parseinfo'])\r
+ )\r
+\r
+ return test_node\r
+\r
def parse_literal(ast):\r
if 'literal_type' not in ast:\r
raise\r