diff --git a/src/languages/language_python.rs b/src/languages/language_python.rs index 610d1eb0a..9bc6f06de 100644 --- a/src/languages/language_python.rs +++ b/src/languages/language_python.rs @@ -37,51 +37,51 @@ pub enum Python { With = 32, Def = 33, DASHGT = 34, - EQ = 35, - STARSTAR = 36, - Global = 37, - Nonlocal = 38, - Exec = 39, - Class = 40, - AT = 41, - Not = 42, - And = 43, - Or = 44, - PLUS = 45, - DASH = 46, - SLASH = 47, - PERCENT = 48, - SLASHSLASH = 49, - PIPE = 50, - AMP = 51, - CARET = 52, - LTLT = 53, - TILDE = 54, - LT = 55, - LTEQ = 56, - EQEQ = 57, - BANGEQ = 58, - GTEQ = 59, - GT = 60, - LTGT = 61, - Is = 62, - Lambda3 = 63, - PLUSEQ = 64, - DASHEQ = 65, - STAREQ = 66, - SLASHEQ = 67, - ATEQ = 68, - SLASHSLASHEQ = 69, - PERCENTEQ = 70, - STARSTAREQ = 71, - GTGTEQ = 72, - LTLTEQ = 73, - AMPEQ = 74, - CARETEQ = 75, - PIPEEQ = 76, - Yield2 = 77, - LBRACK = 78, - RBRACK = 79, + STARSTAR = 35, + Global = 36, + Nonlocal = 37, + Exec = 38, + Class = 39, + AT = 40, + LBRACK = 41, + RBRACK = 42, + EQ = 43, + Not = 44, + And = 45, + Or = 46, + PLUS = 47, + DASH = 48, + SLASH = 49, + PERCENT = 50, + SLASHSLASH = 51, + PIPE = 52, + AMP = 53, + CARET = 54, + LTLT = 55, + TILDE = 56, + LT = 57, + LTEQ = 58, + EQEQ = 59, + BANGEQ = 60, + GTEQ = 61, + GT = 62, + LTGT = 63, + Is = 64, + Lambda3 = 65, + PLUSEQ = 66, + DASHEQ = 67, + STAREQ = 68, + SLASHEQ = 69, + ATEQ = 70, + SLASHSLASHEQ = 71, + PERCENTEQ = 72, + STARSTAREQ = 73, + GTGTEQ = 74, + LTLTEQ = 75, + AMPEQ = 76, + CARETEQ = 77, + PIPEEQ = 78, + Yield2 = 79, Ellipsis = 80, LBRACE = 81, RBRACE = 82, @@ -91,10 +91,10 @@ pub enum Python { TypeConversion = 86, Integer = 87, Float = 88, - True = 89, - False = 90, - None = 91, - Await2 = 92, + Await2 = 89, + True = 90, + False = 91, + None = 92, Comment = 93, Semicolon = 94, Newline = 95, @@ -134,95 +134,102 @@ pub enum Python { ExceptClause = 129, FinallyClause = 130, WithStatement = 131, - WithItem = 132, - FunctionDefinition = 133, - Parameters = 134, - LambdaParameters = 135, - Parameters2 = 136, - DefaultParameter = 137, - TypedDefaultParameter = 138, - ListSplat = 139, - DictionarySplat = 140, - GlobalStatement = 141, - NonlocalStatement = 142, - ExecStatement = 143, - ClassDefinition = 144, - ParenthesizedListSplat = 145, - ArgumentList = 146, - DecoratedDefinition = 147, - Decorator = 148, - Block = 149, - Variables = 150, - ExpressionList = 151, - DottedName = 152, - ExpressionWithinForInClause = 153, - Expression = 154, - PrimaryExpression = 155, - NotOperator = 156, - BooleanOperator = 157, - BinaryOperator = 158, - UnaryOperator = 159, - ComparisonOperator = 160, - Lambda = 161, - Lambda2 = 162, - Assignment = 163, - AugmentedAssignment = 164, - RightHandSide = 165, - Yield = 166, - Attribute = 167, - Subscript = 168, - Slice = 169, - Call = 170, - TypedParameter = 171, - Type = 172, - KeywordArgument = 173, - List = 174, - ComprehensionClauses = 175, - ListComprehension = 176, - Dictionary = 177, - DictionaryComprehension = 178, - Pair = 179, - Set = 180, - SetComprehension = 181, - ParenthesizedExpression = 182, - CollectionElements = 183, + WithClause = 132, + WithItem = 133, + FunctionDefinition = 134, + Parameters = 135, + LambdaParameters = 136, + ListSplat = 137, + DictionarySplat = 138, + GlobalStatement = 139, + NonlocalStatement = 140, + ExecStatement = 141, + ClassDefinition = 142, + ParenthesizedListSplat = 143, + ArgumentList = 144, + DecoratedDefinition = 145, + Decorator = 146, + Block = 147, + ExpressionList = 148, + DottedName = 149, + Parameters2 = 150, + Patterns = 151, + Parameter = 152, + Pattern = 153, + TuplePattern = 154, + ListPattern = 155, + DefaultParameter = 156, + TypedDefaultParameter = 157, + ListSplatPattern = 158, + DictionarySplatPattern = 159, + ExpressionWithinForInClause = 160, + Expression = 161, + PrimaryExpression = 162, + NotOperator = 163, + BooleanOperator = 164, + BinaryOperator = 165, + UnaryOperator = 166, + ComparisonOperator = 167, + Lambda = 168, + Lambda2 = 169, + Assignment = 170, + AugmentedAssignment = 171, + PatternList = 172, + RightHandSide = 173, + Yield = 174, + Attribute = 175, + Subscript = 176, + Slice = 177, + Call = 178, + TypedParameter = 179, + Type = 180, + KeywordArgument = 181, + List = 182, + Set = 183, Tuple = 184, - GeneratorExpression = 185, - ForInClause = 186, - IfClause = 187, - ConditionalExpression = 188, - ConcatenatedString = 189, - String = 190, - Interpolation = 191, - FormatSpecifier = 192, - FormatExpression = 193, - Await = 194, - ModuleRepeat1 = 195, - SimpleStatementsRepeat1 = 196, - ImportPrefixRepeat1 = 197, - ImportListRepeat1 = 198, - PrintStatementRepeat1 = 199, - AssertStatementRepeat1 = 200, - IfStatementRepeat1 = 201, - TryStatementRepeat1 = 202, - WithStatementRepeat1 = 203, - ParametersRepeat1 = 204, - GlobalStatementRepeat1 = 205, - ArgumentListRepeat1 = 206, - DecoratedDefinitionRepeat1 = 207, - VariablesRepeat1 = 208, - DottedNameRepeat1 = 209, - ComparisonOperatorRepeat1 = 210, - SubscriptRepeat1 = 211, - ComprehensionClausesRepeat1 = 212, - DictionaryRepeat1 = 213, - SetRepeat1 = 214, - CollectionElementsRepeat1 = 215, - ForInClauseRepeat1 = 216, - ConcatenatedStringRepeat1 = 217, - StringRepeat1 = 218, - FormatSpecifierRepeat1 = 219, - Error = 220, + Dictionary = 185, + Pair = 186, + ListComprehension = 187, + DictionaryComprehension = 188, + SetComprehension = 189, + GeneratorExpression = 190, + ComprehensionClauses = 191, + ParenthesizedExpression = 192, + CollectionElements = 193, + ForInClause = 194, + IfClause = 195, + ConditionalExpression = 196, + ConcatenatedString = 197, + String = 198, + Interpolation = 199, + FormatSpecifier = 200, + FormatExpression = 201, + Await = 202, + ModuleRepeat1 = 203, + SimpleStatementsRepeat1 = 204, + ImportPrefixRepeat1 = 205, + ImportListRepeat1 = 206, + PrintStatementRepeat1 = 207, + AssertStatementRepeat1 = 208, + IfStatementRepeat1 = 209, + TryStatementRepeat1 = 210, + WithClauseRepeat1 = 211, + GlobalStatementRepeat1 = 212, + ArgumentListRepeat1 = 213, + DecoratedDefinitionRepeat1 = 214, + DottedNameRepeat1 = 215, + ParametersRepeat1 = 216, + PatternsRepeat1 = 217, + ComparisonOperatorRepeat1 = 218, + SubscriptRepeat1 = 219, + DictionaryRepeat1 = 220, + ComprehensionClausesRepeat1 = 221, + CollectionElementsRepeat1 = 222, + ForInClauseRepeat1 = 223, + ConcatenatedStringRepeat1 = 224, + StringRepeat1 = 225, + FormatSpecifierRepeat1 = 226, + Error = 227, } impl Into<&'static str> for Python { @@ -263,13 +270,15 @@ impl Into<&'static str> for Python { Python::With => "with", Python::Def => "def", Python::DASHGT => "->", - Python::EQ => "=", Python::STARSTAR => "**", Python::Global => "global", Python::Nonlocal => "nonlocal", Python::Exec => "exec", Python::Class => "class", Python::AT => "@", + Python::LBRACK => "[", + Python::RBRACK => "]", + Python::EQ => "=", Python::Not => "not", Python::And => "and", Python::Or => "or", @@ -306,8 +315,6 @@ impl Into<&'static str> for Python { Python::CARETEQ => "^=", Python::PIPEEQ => "|=", Python::Yield2 => "yield", - Python::LBRACK => "[", - Python::RBRACK => "]", Python::Ellipsis => "ellipsis", Python::LBRACE => "{", Python::RBRACE => "}", @@ -317,10 +324,10 @@ impl Into<&'static str> for Python { Python::TypeConversion => "type_conversion", Python::Integer => "integer", Python::Float => "float", + Python::Await2 => "await", Python::True => "true", Python::False => "false", Python::None => "none", - Python::Await2 => "await", Python::Comment => "comment", Python::Semicolon => "_semicolon", Python::Newline => "_newline", @@ -360,13 +367,11 @@ impl Into<&'static str> for Python { Python::ExceptClause => "except_clause", Python::FinallyClause => "finally_clause", Python::WithStatement => "with_statement", + Python::WithClause => "with_clause", Python::WithItem => "with_item", Python::FunctionDefinition => "function_definition", Python::Parameters => "parameters", Python::LambdaParameters => "lambda_parameters", - Python::Parameters2 => "_parameters", - Python::DefaultParameter => "default_parameter", - Python::TypedDefaultParameter => "typed_default_parameter", Python::ListSplat => "list_splat", Python::DictionarySplat => "dictionary_splat", Python::GlobalStatement => "global_statement", @@ -378,12 +383,21 @@ impl Into<&'static str> for Python { Python::DecoratedDefinition => "decorated_definition", Python::Decorator => "decorator", Python::Block => "block", - Python::Variables => "variables", Python::ExpressionList => "expression_list", Python::DottedName => "dotted_name", + Python::Parameters2 => "_parameters", + Python::Patterns => "_patterns", + Python::Parameter => "parameter", + Python::Pattern => "pattern", + Python::TuplePattern => "tuple_pattern", + Python::ListPattern => "list_pattern", + Python::DefaultParameter => "default_parameter", + Python::TypedDefaultParameter => "typed_default_parameter", + Python::ListSplatPattern => "list_splat_pattern", + Python::DictionarySplatPattern => "dictionary_splat_pattern", Python::ExpressionWithinForInClause => "_expression_within_for_in_clause", - Python::Expression => "_expression", - Python::PrimaryExpression => "_primary_expression", + Python::Expression => "expression", + Python::PrimaryExpression => "primary_expression", Python::NotOperator => "not_operator", Python::BooleanOperator => "boolean_operator", Python::BinaryOperator => "binary_operator", @@ -393,6 +407,7 @@ impl Into<&'static str> for Python { Python::Lambda2 => "lambda", Python::Assignment => "assignment", Python::AugmentedAssignment => "augmented_assignment", + Python::PatternList => "pattern_list", Python::RightHandSide => "_right_hand_side", Python::Yield => "yield", Python::Attribute => "attribute", @@ -403,17 +418,17 @@ impl Into<&'static str> for Python { Python::Type => "type", Python::KeywordArgument => "keyword_argument", Python::List => "list", - Python::ComprehensionClauses => "_comprehension_clauses", - Python::ListComprehension => "list_comprehension", + Python::Set => "set", + Python::Tuple => "tuple", Python::Dictionary => "dictionary", - Python::DictionaryComprehension => "dictionary_comprehension", Python::Pair => "pair", - Python::Set => "set", + Python::ListComprehension => "list_comprehension", + Python::DictionaryComprehension => "dictionary_comprehension", Python::SetComprehension => "set_comprehension", + Python::GeneratorExpression => "generator_expression", + Python::ComprehensionClauses => "_comprehension_clauses", Python::ParenthesizedExpression => "parenthesized_expression", Python::CollectionElements => "_collection_elements", - Python::Tuple => "tuple", - Python::GeneratorExpression => "generator_expression", Python::ForInClause => "for_in_clause", Python::IfClause => "if_clause", Python::ConditionalExpression => "conditional_expression", @@ -431,18 +446,17 @@ impl Into<&'static str> for Python { Python::AssertStatementRepeat1 => "assert_statement_repeat1", Python::IfStatementRepeat1 => "if_statement_repeat1", Python::TryStatementRepeat1 => "try_statement_repeat1", - Python::WithStatementRepeat1 => "with_statement_repeat1", - Python::ParametersRepeat1 => "_parameters_repeat1", + Python::WithClauseRepeat1 => "with_clause_repeat1", Python::GlobalStatementRepeat1 => "global_statement_repeat1", Python::ArgumentListRepeat1 => "argument_list_repeat1", Python::DecoratedDefinitionRepeat1 => "decorated_definition_repeat1", - Python::VariablesRepeat1 => "variables_repeat1", Python::DottedNameRepeat1 => "dotted_name_repeat1", + Python::ParametersRepeat1 => "_parameters_repeat1", + Python::PatternsRepeat1 => "_patterns_repeat1", Python::ComparisonOperatorRepeat1 => "comparison_operator_repeat1", Python::SubscriptRepeat1 => "subscript_repeat1", - Python::ComprehensionClausesRepeat1 => "_comprehension_clauses_repeat1", Python::DictionaryRepeat1 => "dictionary_repeat1", - Python::SetRepeat1 => "set_repeat1", + Python::ComprehensionClausesRepeat1 => "_comprehension_clauses_repeat1", Python::CollectionElementsRepeat1 => "_collection_elements_repeat1", Python::ForInClauseRepeat1 => "for_in_clause_repeat1", Python::ConcatenatedStringRepeat1 => "concatenated_string_repeat1", @@ -457,287 +471,296 @@ impl Into<&'static str> for Python { static KEYS: phf::Map<&'static str, Python> = ::phf::Map { key: 3213172566270843353, disps: ::phf::Slice::Static(&[ - (0, 8), (0, 0), + (2, 103), + (0, 0), + (6, 32), + (0, 46), + (0, 93), + (0, 1), (0, 7), - (0, 77), - (1, 81), (0, 3), - (3, 1), - (0, 13), - (0, 32), - (0, 67), - (0, 211), + (1, 39), + (0, 47), + (0, 197), (0, 9), - (0, 11), - (9, 147), - (8, 109), - (0, 206), - (0, 7), - (0, 3), - (1, 112), - (10, 66), - (0, 6), - (0, 104), - (8, 185), - (0, 0), - (15, 122), - (0, 0), - (0, 22), - (0, 85), + (0, 10), + (0, 58), + (0, 23), + (0, 195), + (0, 60), + (2, 221), + (0, 41), + (0, 2), + (2, 18), (0, 0), + (2, 85), + (1, 16), + (9, 18), + (0, 74), + (1, 3), + (0, 204), + (15, 128), + (5, 52), + (15, 199), + (8, 141), (0, 42), - (1, 2), + (0, 204), + (0, 135), + (3, 84), + (0, 8), + (20, 41), + (13, 60), + (25, 122), + (4, 79), + (14, 155), + (0, 204), (0, 0), - (0, 3), - (1, 103), - (0, 13), - (78, 104), - (4, 212), - (26, 152), - (2, 22), - (0, 48), - (1, 117), - (0, 206), - (1, 11), ]), entries: ::phf::Slice::Static(&[ - ("module", Python::Module), - ("|=", Python::PIPEEQ), - ("if_statement", Python::IfStatement), - ("if", Python::If), - ("decorated_definition", Python::DecoratedDefinition), - ("not", Python::Not), - ("<=", Python::LTEQ), + ("concatenated_string", Python::ConcatenatedString), ("chevron", Python::Chevron), - ("%=", Python::PERCENTEQ), + ("list_splat", Python::ListSplat), + ("exec_statement", Python::ExecStatement), + ("lambda", Python::Lambda), + ("nonlocal", Python::Nonlocal), + ("<<", Python::LTLT), + ("argument_list_repeat1", Python::ArgumentListRepeat1), + ("set_comprehension", Python::SetComprehension), + ("import_prefix", Python::ImportPrefix), + ("*=", Python::STAREQ), + ("\\\"", Python::DQUOTE), + ("break_statement", Python::BreakStatement), + ("future_import_statement", Python::FutureImportStatement), ("attribute", Python::Attribute), - ("async", Python::Async), - ("named_expression", Python::NamedExpression), - ("if_clause", Python::IfClause), - ("format_specifier_repeat1", Python::FormatSpecifierRepeat1), - ("aliased_import", Python::AliasedImport), - ("*", Python::STAR), - ("dictionary_splat", Python::DictionarySplat), - ("parameters", Python::Parameters), - ("for_in_clause", Python::ForInClause), - ("]", Python::RBRACK), + ("false", Python::False), + (")", Python::RPAREN), + ("type_conversion", Python::TypeConversion), + ("if", Python::If), + ("ERROR", Python::Error), + ("continue", Python::Continue), ( - "comparison_operator_repeat1", - Python::ComparisonOperatorRepeat1, + "_collection_elements_repeat1", + Python::CollectionElementsRepeat1, ), - ("escape_sequence", Python::EscapeSequence), - ("=", Python::EQ), - ("else_clause", Python::ElseClause), - ("pass_statement", Python::PassStatement), - ("\\\"", Python::DQUOTE), - ("is", Python::Is), + ("pass", Python::Pass), + ("for_in_clause", Python::ForInClause), + ("while_statement", Python::WhileStatement), ("import_prefix_repeat1", Python::ImportPrefixRepeat1), - ("else", Python::Else), - ("_expression", Python::Expression), + ("_collection_elements", Python::CollectionElements), + ("~", Python::TILDE), + ("global", Python::Global), + ("set", Python::Set), + ("primary_expression", Python::PrimaryExpression), + ("slice", Python::Slice), + ("parenthesized_list_splat", Python::ParenthesizedListSplat), + ("module_repeat1", Python::ModuleRepeat1), + ("delete_statement", Python::DeleteStatement), + ("-", Python::DASH), + ("else_clause", Python::ElseClause), + ("lambda_parameters", Python::LambdaParameters), + ("typed_default_parameter", Python::TypedDefaultParameter), + ("break", Python::Break), + ("escape_sequence", Python::EscapeSequence), + ("tuple_pattern", Python::TuplePattern), + ("del", Python::Del), + (",", Python::COMMA), + ("block", Python::Block), + ("_right_hand_side", Python::RightHandSide), + ("_string_content", Python::StringContent), + ("raise", Python::Raise), + ("relative_import", Python::RelativeImport), + ("except_clause", Python::ExceptClause), + ("dictionary_repeat1", Python::DictionaryRepeat1), + ("|=", Python::PIPEEQ), + ("argument_list", Python::ArgumentList), + ("finally", Python::Finally), + ("expression_statement", Python::ExpressionStatement), + ("dictionary_splat", Python::DictionarySplat), ("try_statement", Python::TryStatement), + ("class_definition", Python::ClassDefinition), + ("unary_operator", Python::UnaryOperator), + ("global_statement", Python::GlobalStatement), + ("_import_list_repeat1", Python::ImportListRepeat1), + ("expression", Python::Expression), + ("-=", Python::DASHEQ), + ("dictionary_splat_pattern", Python::DictionarySplatPattern), + ("}", Python::RBRACE), + ("integer", Python::Integer), + ("@=", Python::ATEQ), + ("|", Python::PIPE), + (":", Python::COLON), + ("module", Python::Module), + ("&=", Python::AMPEQ), + ("format_specifier_repeat1", Python::FormatSpecifierRepeat1), + ("else", Python::Else), + ("elif", Python::Elif), + ("print", Python::Print), (">=", Python::GTEQ), - ("tuple", Python::Tuple), - ("pair", Python::Pair), - ("__future__", Python::Future), - ("false", Python::False), - ("import_statement", Python::ImportStatement), - ("argument_list_repeat1", Python::ArgumentListRepeat1), + ("_statement", Python::Statement), + ("&", Python::AMP), + ("%", Python::PERCENT), + ("pattern_list", Python::PatternList), + ("identifier", Python::Identifier), + ("/", Python::SLASH), + ("for", Python::For), ( "decorated_definition_repeat1", Python::DecoratedDefinitionRepeat1, ), + ("pass_statement", Python::PassStatement), ("/=", Python::SLASHEQ), - ("//=", Python::SLASHSLASHEQ), - ("//", Python::SLASHSLASH), - ("string", Python::String), - ("**=", Python::STARSTAREQ), - ("elif_clause", Python::ElifClause), - ("break", Python::Break), - ("function_definition", Python::FunctionDefinition), - ("conditional_expression", Python::ConditionalExpression), - ("<>", Python::LTGT), - ("with", Python::With), - ("none", Python::None), - ("del", Python::Del), - ("delete_statement", Python::DeleteStatement), - ("variables", Python::Variables), - ("_simple_statements", Python::SimpleStatements), - ("exec", Python::Exec), - ("==", Python::EQEQ), - ("variables_repeat1", Python::VariablesRepeat1), - ("_semicolon", Python::Semicolon), - ("global_statement_repeat1", Python::GlobalStatementRepeat1), - ("subscript", Python::Subscript), + ("->", Python::DASHGT), + ("]", Python::RBRACK), + ("string_repeat1", Python::StringRepeat1), + ("for_in_clause_repeat1", Python::ForInClauseRepeat1), + ("except", Python::Except), + ("^=", Python::CARETEQ), + ("boolean_operator", Python::BooleanOperator), + ("list_pattern", Python::ListPattern), + ("not", Python::Not), + ("<<=", Python::LTLTEQ), ("[", Python::LBRACK), - ("print", Python::Print), + ("class", Python::Class), + ("_semicolon", Python::Semicolon), + ("async", Python::Async), + ("type", Python::Type), + ("<=", Python::LTEQ), + ("print_statement_repeat1", Python::PrintStatementRepeat1), ( - "_simple_statements_repeat1", - Python::SimpleStatementsRepeat1, + "concatenated_string_repeat1", + Python::ConcatenatedStringRepeat1, ), - ("future_import_statement", Python::FutureImportStatement), + ("binary_operator", Python::BinaryOperator), + ("subscript_repeat1", Python::SubscriptRepeat1), + ("_not_escape_sequence", Python::NotEscapeSequence), + ("elif_clause", Python::ElifClause), + ("pair", Python::Pair), + ("with_clause", Python::WithClause), + ("%=", Python::PERCENTEQ), ("format_specifier_token1", Python::FormatSpecifierToken1), + ("if_statement_repeat1", Python::IfStatementRepeat1), ("return", Python::Return), - ("break_statement", Python::BreakStatement), - ("finally_clause", Python::FinallyClause), - ("format_specifier", Python::FormatSpecifier), - ("expression_list", Python::ExpressionList), - (">>=", Python::GTGTEQ), - ("^", Python::CARET), - ("parenthesized_expression", Python::ParenthesizedExpression), - ("augmented_assignment", Python::AugmentedAssignment), - ("{", Python::LBRACE), - ("parenthesized_list_splat", Python::ParenthesizedListSplat), ( - "_collection_elements_repeat1", - Python::CollectionElementsRepeat1, + "_expression_within_for_in_clause", + Python::ExpressionWithinForInClause, ), - ("set_repeat1", Python::SetRepeat1), - ("raise", Python::Raise), - ("nonlocal", Python::Nonlocal), - ("comment", Python::Comment), - ("|", Python::PIPE), - ("unary_operator", Python::UnaryOperator), - ("identifier", Python::Identifier), - ("global_statement", Python::GlobalStatement), - ("_right_hand_side", Python::RightHandSide), - (">>", Python::GTGT), - ("yield", Python::Yield), + ("function_definition", Python::FunctionDefinition), + ("import_statement", Python::ImportStatement), + ("true", Python::True), + ("_simple_statements", Python::SimpleStatements), + ("parameter", Python::Parameter), + ("list_splat_pattern", Python::ListSplatPattern), + ("dotted_name_repeat1", Python::DottedNameRepeat1), + ("global_statement_repeat1", Python::GlobalStatementRepeat1), + ("and", Python::And), + ("!=", Python::BANGEQ), + ("assignment", Python::Assignment), + ("decorated_definition", Python::DecoratedDefinition), + ("comparison_operator", Python::ComparisonOperator), + ("try", Python::Try), + ("none", Python::None), + ("while", Python::While), + ("dictionary_comprehension", Python::DictionaryComprehension), + ("import", Python::Import), + ("conditional_expression", Python::ConditionalExpression), + ("with", Python::With), + ("if_clause", Python::IfClause), + ("parameters", Python::Parameters), + ("typed_parameter", Python::TypedParameter), + (">", Python::GT), + ("print_statement", Python::PrintStatement), + (":=", Python::COLONEQ), + ("return_statement", Python::ReturnStatement), ("for_statement", Python::ForStatement), - ("lambda_parameters", Python::LambdaParameters), - (")", Python::RPAREN), - ("except", Python::Except), - ("nonlocal_statement", Python::NonlocalStatement), - ("integer", Python::Integer), + ("default_parameter", Python::DefaultParameter), + ("assert_statement_repeat1", Python::AssertStatementRepeat1), + ("as", Python::As), + ("not_operator", Python::NotOperator), + ("_import_list", Python::ImportList), + ("finally_clause", Python::FinallyClause), + ("string", Python::String), ( "_comprehension_clauses_repeat1", Python::ComprehensionClausesRepeat1, ), - ("type_conversion", Python::TypeConversion), - ("string_repeat1", Python::StringRepeat1), - ("%", Python::PERCENT), ("continue_statement", Python::ContinueStatement), - ("as", Python::As), + ("with_item", Python::WithItem), + ("or", Python::Or), + ("named_expression", Python::NamedExpression), + ("float", Python::Float), + ("dictionary", Python::Dictionary), + ("with_clause_repeat1", Python::WithClauseRepeat1), + ("generator_expression", Python::GeneratorExpression), + ("==", Python::EQEQ), + ("keyword_argument", Python::KeywordArgument), + ("import_from_statement", Python::ImportFromStatement), + ("if_statement", Python::IfStatement), ("call", Python::Call), - ("slice", Python::Slice), - ("end", Python::End), - ("/", Python::SLASH), - ("<<", Python::LTLT), - ("}", Python::RBRACE), - ("concatenated_string", Python::ConcatenatedString), + ("(", Python::LPAREN), + ("yield", Python::Yield), + ("list_comprehension", Python::ListComprehension), + ("from", Python::From), ("dotted_name", Python::DottedName), - ("if_statement_repeat1", Python::IfStatementRepeat1), - ("return_statement", Python::ReturnStatement), - ("in", Python::In), - ("@=", Python::ATEQ), - ("binary_operator", Python::BinaryOperator), - ("continue", Python::Continue), + ("_parameters_repeat1", Python::ParametersRepeat1), + ("__future__", Python::Future), + ("^", Python::CARET), + ("list", Python::List), + ("//", Python::SLASHSLASH), + ("augmented_assignment", Python::AugmentedAssignment), + ("comment", Python::Comment), + ("**=", Python::STARSTAREQ), + ("def", Python::Def), + ("{", Python::LBRACE), + ("pattern", Python::Pattern), + ("=", Python::EQ), + ("*", Python::STAR), + ("_patterns_repeat1", Python::PatternsRepeat1), + ("+=", Python::PLUSEQ), + ("decorator", Python::Decorator), + ("_comprehension_clauses", Python::ComprehensionClauses), + ("**", Python::STARSTAR), + ("format_specifier", Python::FormatSpecifier), + ("aliased_import", Python::AliasedImport), + ("expression_list", Python::ExpressionList), + ("raise_statement", Python::RaiseStatement), ("with_statement", Python::WithStatement), - ("ERROR", Python::Error), - ("_dedent", Python::Dedent), - ("<", Python::LT), - ("with_item", Python::WithItem), - ("^=", Python::CARETEQ), - ("set_comprehension", Python::SetComprehension), - ("import_from_statement", Python::ImportFromStatement), - ("class", Python::Class), + ("subscript", Python::Subscript), ("ellipsis", Python::Ellipsis), - ("expression_statement", Python::ExpressionStatement), - ("comparison_operator", Python::ComparisonOperator), - ("print_statement", Python::PrintStatement), - ("for_in_clause_repeat1", Python::ForInClauseRepeat1), - ("lambda", Python::Lambda), - ("elif", Python::Elif), - ("_collection_elements", Python::CollectionElements), - (":", Python::COLON), - ("for", Python::For), - ("try", Python::Try), + ("_newline", Python::Newline), + ("await", Python::Await), + ("@", Python::AT), + ("try_statement_repeat1", Python::TryStatementRepeat1), + ("assert_statement", Python::AssertStatement), + ("format_expression", Python::FormatExpression), + ("<", Python::LT), + ("_indent", Python::Indent), + ("//=", Python::SLASHSLASHEQ), + ("tuple", Python::Tuple), ( - "concatenated_string_repeat1", - Python::ConcatenatedStringRepeat1, + "comparison_operator_repeat1", + Python::ComparisonOperatorRepeat1, ), - ("dictionary", Python::Dictionary), - ("_primary_expression", Python::PrimaryExpression), - ("raise_statement", Python::RaiseStatement), - ("try_statement_repeat1", Python::TryStatementRepeat1), + ("parenthesized_expression", Python::ParenthesizedExpression), + ("_dedent", Python::Dedent), + (">>", Python::GTGT), + ("nonlocal_statement", Python::NonlocalStatement), ("assert", Python::Assert), - ("->", Python::DASHGT), - ("-=", Python::DASHEQ), - ("finally", Python::Finally), - ("&", Python::AMP), - ("exec_statement", Python::ExecStatement), - ("**", Python::STARSTAR), - ("import_prefix", Python::ImportPrefix), - ("_comprehension_clauses", Python::ComprehensionClauses), - ("decorator", Python::Decorator), - ("except_clause", Python::ExceptClause), - ("type", Python::Type), - ("list", Python::List), - ("_statement", Python::Statement), + ("exec", Python::Exec), + ("<>", Python::LTGT), ( - "_expression_within_for_in_clause", - Python::ExpressionWithinForInClause, + "_simple_statements_repeat1", + Python::SimpleStatementsRepeat1, ), - ("-", Python::DASH), - ("await", Python::Await), - ("_indent", Python::Indent), - ("!=", Python::BANGEQ), - ("_import_list_repeat1", Python::ImportListRepeat1), - ("module_repeat1", Python::ModuleRepeat1), - ("_parameters_repeat1", Python::ParametersRepeat1), - ("_import_list", Python::ImportList), - ("print_statement_repeat1", Python::PrintStatementRepeat1), - ("_not_escape_sequence", Python::NotEscapeSequence), - ("or", Python::Or), - ("generator_expression", Python::GeneratorExpression), - ("from", Python::From), - ("with_statement_repeat1", Python::WithStatementRepeat1), - ("&=", Python::AMPEQ), - ("true", Python::True), - ("_newline", Python::Newline), - ("boolean_operator", Python::BooleanOperator), - ("float", Python::Float), - ("(", Python::LPAREN), - ("assert_statement", Python::AssertStatement), - ("@", Python::AT), - ("assert_statement_repeat1", Python::AssertStatementRepeat1), - ("block", Python::Block), - ("assignment", Python::Assignment), - ("import", Python::Import), - ("not_operator", Python::NotOperator), - ("+", Python::PLUS), - ("argument_list", Python::ArgumentList), - ("while_statement", Python::WhileStatement), - ("_string_content", Python::StringContent), - ("typed_parameter", Python::TypedParameter), - ("<<=", Python::LTLTEQ), - ("relative_import", Python::RelativeImport), - (":=", Python::COLONEQ), - ("def", Python::Def), - ("default_parameter", Python::DefaultParameter), - ("+=", Python::PLUSEQ), + ("in", Python::In), + (">>=", Python::GTGTEQ), + (".", Python::DOT), + ("_patterns", Python::Patterns), + ("is", Python::Is), ("wildcard_import", Python::WildcardImport), - ("typed_default_parameter", Python::TypedDefaultParameter), - ("pass", Python::Pass), - (">", Python::GT), + ("end", Python::End), ("interpolation", Python::Interpolation), - ("dictionary_comprehension", Python::DictionaryComprehension), - ("keyword_argument", Python::KeywordArgument), - ("format_expression", Python::FormatExpression), - (".", Python::DOT), - ("global", Python::Global), - (",", Python::COMMA), - ("and", Python::And), - ("set", Python::Set), - ("*=", Python::STAREQ), - ("~", Python::TILDE), - ("subscript_repeat1", Python::SubscriptRepeat1), - ("class_definition", Python::ClassDefinition), - ("while", Python::While), - ("list_splat", Python::ListSplat), - ("dotted_name_repeat1", Python::DottedNameRepeat1), - ("list_comprehension", Python::ListComprehension), - ("dictionary_repeat1", Python::DictionaryRepeat1), + ("+", Python::PLUS), ]), }; diff --git a/tree-sitter-python b/tree-sitter-python index 58f572408..f568dfabf 160000 --- a/tree-sitter-python +++ b/tree-sitter-python @@ -1 +1 @@ -Subproject commit 58f57240834d6b88624e32ad0ab9531d55fb7a5d +Subproject commit f568dfabf7c4611077467a9cd13297fa0658abb6