Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tree-sitter-python

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tree-sitter-python - npm Package Compare versions

Comparing version 0.15.0 to 0.15.1

queries/highlights.scm

321

grammar.js

@@ -19,4 +19,4 @@ const PREC = {

times: 17,
power: 18,
unary: 19,
unary: 18,
power: 19,
call: 20,

@@ -30,5 +30,13 @@ }

$.comment,
/[\s\uFEFF\u2060\u200B]|\\\r?\n/
/[\s\f\uFEFF\u2060\u200B]|\\\r?\n/
],
supertypes: $ => [
$._simple_statement,
$._compound_statement,
$._expression,
$._primary_expression,
$._parameter,
],
externals: $ => [

@@ -47,2 +55,4 @@ $._newline,

$.keyword_identifier,
$._suite,
$._parameter,
],

@@ -64,3 +74,6 @@

$._simple_statement,
optional(repeat(seq($._semicolon, $._simple_statement))),
optional(repeat(seq(
$._semicolon,
$._simple_statement
))),
optional($._semicolon),

@@ -104,3 +117,6 @@ $._newline

'import',
$._import_list
choice(
$._import_list,
seq('(', $._import_list, ')'),
)
),

@@ -110,6 +126,6 @@

'from',
choice(
field('module_name', choice(
$.relative_import,
$.dotted_name
),
)),
'import',

@@ -124,6 +140,6 @@ choice(

_import_list: $ => seq(
commaSep1(choice(
commaSep1(field('name', choice(
$.dotted_name,
$.aliased_import
)),
))),
optional(',')

@@ -133,5 +149,5 @@ ),

aliased_import: $ => seq(
$.dotted_name,
field('name', $.dotted_name),
'as',
$.identifier
field('alias', $.identifier)
),

@@ -145,3 +161,3 @@

$.chevron,
repeat(seq(',', $._expression)),
repeat(seq(',', field('argument', $._expression))),
optional(','))

@@ -151,3 +167,3 @@ ),

'print',
commaSep1($._expression),
commaSep1(field('argument', $._expression)),
optional(','))

@@ -164,4 +180,3 @@ )

'assert',
$._expression,
repeat(seq(',', $._expression))
commaSep1($._expression)
),

@@ -178,5 +193,5 @@

named_expression: $ => seq(
$.identifier,
field('name', $.identifier),
':=',
$._expression
field('value', $._expression)
),

@@ -197,3 +212,3 @@

optional($.expression_list),
optional(seq('from', $._expression))
optional(seq('from', field('cause', $._expression)))
),

@@ -220,7 +235,7 @@

'if',
$._expression,
field('condition', $._expression),
':',
$._suite,
repeat($.elif_clause),
optional($.else_clause)
field('consequence', $._suite),
repeat(field('alternative', $.elif_clause)),
optional(field('alternative', $.else_clause))
),

@@ -230,5 +245,5 @@

'elif',
$._expression,
field('condition', $._expression),
':',
$._suite
field('consequence', $._suite)
),

@@ -239,3 +254,3 @@

':',
$._suite
field('body', $._suite)
),

@@ -246,8 +261,8 @@

'for',
$.variables,
field('left', $.variables),
'in',
$.expression_list,
field('right', $.expression_list),
':',
$._suite,
optional($.else_clause)
field('body', $._suite),
field('alternative', optional($.else_clause))
),

@@ -257,6 +272,6 @@

'while',
$._expression,
field('condition', $._expression),
':',
$._suite,
optional($.else_clause)
field('body', $._suite),
optional(field('alternative', $.else_clause))
),

@@ -267,3 +282,3 @@

':',
$._suite,
field('body', $._suite),
choice(

@@ -303,10 +318,10 @@ seq(

':',
$._suite
field('body', $._suite)
),
with_item: $ => seq(
$._expression,
field('value', $._expression),
optional(seq(
'as',
$._expression
field('alias', $._expression)
))

@@ -318,12 +333,12 @@ ),

'def',
$.identifier,
$.parameters,
field('name', $.identifier),
field('parameters', $.parameters),
optional(
seq(
'->',
$.type
field('return_type', $.type)
)
),
':',
$._suite
field('body', $._suite)
),

@@ -340,27 +355,32 @@

_parameters: $ => seq(
commaSep1(choice(
$.identifier,
$.keyword_identifier,
$.tuple,
$.typed_parameter,
$.default_parameter,
$.typed_default_parameter,
$.list_splat,
$.dictionary_splat
)),
commaSep1($._parameter),
optional(',')
),
_parameter: $ => choice(
$.identifier,
$.keyword_identifier,
$.tuple,
$.typed_parameter,
$.default_parameter,
$.typed_default_parameter,
choice(
$.list_splat,
alias('*', $.list_splat),
),
$.dictionary_splat
),
default_parameter: $ => seq(
choice($.identifier, $.keyword_identifier),
field('name', choice($.identifier, $.keyword_identifier)),
'=',
$._expression
field('value', $._expression)
),
typed_default_parameter: $ => prec(PREC.typed_parameter, seq(
choice($.identifier, $.keyword_identifier),
field('name', choice($.identifier, $.keyword_identifier)),
':',
$.type,
field('type', $.type),
'=',
$._expression
field('value', $._expression)
)),

@@ -370,8 +390,7 @@

'*',
optional($._expression)
$._expression,
),
dictionary_splat: $ => seq(
'*',
'*',
'**',
$._expression

@@ -392,3 +411,3 @@ ),

'exec',
$.string,
field('code', $.string),
optional(

@@ -404,8 +423,17 @@ seq(

'class',
$.identifier,
optional($.argument_list),
field('name', $.identifier),
field('superclasses', optional($.argument_list)),
':',
$._suite
field('body', $._suite)
),
parenthesized_list_splat: $ => seq(
'(',
choice(
alias($.parenthesized_list_splat, $.parenthesized_expression),
$.list_splat,
),
')',
),
argument_list: $ => seq(

@@ -418,2 +446,3 @@ '(',

$.dictionary_splat,
alias($.parenthesized_list_splat, $.parenthesized_expression),
$.keyword_argument

@@ -428,6 +457,6 @@ )

repeat1($.decorator),
choice(
field('definition', choice(
$.class_definition,
$.function_definition
)
))
),

@@ -438,3 +467,3 @@

$.dotted_name,
optional($.argument_list),
field('arguments', optional($.argument_list)),
$._newline

@@ -444,10 +473,11 @@ ),

_suite: $ => choice(
$._simple_statements,
seq(
$._indent,
repeat($._statement),
$._dedent
)
alias($._simple_statements, $.block),
seq($._indent, $.block)
),
block: $ => seq(
repeat($._statement),
$._dedent
),
variables: $ => seq(

@@ -509,31 +539,49 @@ commaSep1($._primary_expression),

not_operator: $ => prec(PREC.not, seq('not', $._expression)),
not_operator: $ => prec(PREC.not, seq(
'not',
field('argument', $._expression)
)),
boolean_operator: $ => choice(
prec.left(PREC.and, seq($._expression, 'and', $._expression)),
prec.left(PREC.or, seq($._expression, 'or', $._expression))
prec.left(PREC.and, seq(
field('left', $._expression),
field('operator', 'and'),
field('right', $._expression)
)),
prec.left(PREC.or, seq(
field('left', $._expression),
field('operator', 'or'),
field('right', $._expression)
))
),
binary_operator: $ => choice(
prec.left(PREC.plus, seq($._primary_expression, '+', $._primary_expression)),
prec.left(PREC.plus, seq($._primary_expression, '-', $._primary_expression)),
prec.left(PREC.times, seq($._primary_expression, '*', $._primary_expression)),
prec.left(PREC.times, seq($._primary_expression, '@', $._primary_expression)),
prec.left(PREC.times, seq($._primary_expression, '/', $._primary_expression)),
prec.left(PREC.times, seq($._primary_expression, '%', $._primary_expression)),
prec.left(PREC.times, seq($._primary_expression, '//', $._primary_expression)),
prec.left(PREC.power, seq($._primary_expression, '**', $._primary_expression)),
prec.left(PREC.bitwise_or, seq($._primary_expression, '|', $._primary_expression)),
prec.left(PREC.bitwise_and, seq($._primary_expression, '&', $._primary_expression)),
prec.left(PREC.xor, seq($._primary_expression, '^', $._primary_expression)),
prec.left(PREC.shift, seq($._primary_expression, '<<', $._primary_expression)),
prec.left(PREC.shift, seq($._primary_expression, '>>', $._primary_expression))
),
binary_operator: $ => {
const table = [
[prec.left, '+', PREC.plus],
[prec.left, '-', PREC.plus],
[prec.left, '*', PREC.times],
[prec.left, '@', PREC.times],
[prec.left, '/', PREC.times],
[prec.left, '%', PREC.times],
[prec.left, '//', PREC.times],
[prec.right, '**', PREC.power],
[prec.left, '|', PREC.bitwise_or],
[prec.left, '&', PREC.bitwise_and],
[prec.left, '^', PREC.xor],
[prec.left, '<<', PREC.shift],
[prec.left, '>>', PREC.shift],
];
unary_operator: $ => choice(
prec(PREC.unary, seq('-', $._primary_expression)),
prec(PREC.unary, seq('+', $._primary_expression)),
prec(PREC.unary, seq('~', $._primary_expression))
),
return choice(...table.map(([fn, operator, precedence]) => fn(precedence, seq(
field('left', $._primary_expression),
field('operator', operator),
field('right', $._primary_expression)
))));
},
unary_operator: $ => prec(PREC.unary, seq(
field('operator', choice('+', '-', '~')),
field('argument', $._primary_expression)
)),
comparison_operator: $ => prec.left(PREC.compare, seq(

@@ -561,5 +609,5 @@ $._primary_expression,

'lambda',
optional($.lambda_parameters),
field('parameters', optional($.lambda_parameters)),
':',
$._expression
field('body', $._expression)
)),

@@ -569,13 +617,13 @@

'lambda',
optional($.lambda_parameters),
field('parameters', optional($.lambda_parameters)),
':',
$._expression_within_for_in_clause
field('body', $._expression_within_for_in_clause)
),
assignment: $ => seq(
$.expression_list,
field('left', $.expression_list),
choice(
seq('=', $._right_hand_side),
seq(':', $.type),
seq(':', $.type, '=', $._right_hand_side)
seq('=', field('right', $._right_hand_side)),
seq(':', field('type', $.type)),
seq(':', field('type', $.type), '=', field('right', $._right_hand_side))
)

@@ -585,5 +633,8 @@ ),

augmented_assignment: $ => seq(
$.expression_list,
choice('+=', '-=', '*=', '/=', '@=', '//=', '%=', '**=', '>>=', '<<=', '&=', '^=', '|='),
$._right_hand_side
field('left', $.expression_list),
field('operator', choice(
'+=', '-=', '*=', '/=', '@=', '//=', '%=', '**=',
'>>=', '<<=', '&=', '^=', '|='
)),
field('right', $._right_hand_side)
),

@@ -610,11 +661,11 @@

attribute: $ => seq(
$._primary_expression,
field('object', $._primary_expression),
'.',
$.identifier
field('attribute', $.identifier)
),
subscript: $ => seq(
$._primary_expression,
field('value', $._primary_expression),
'[',
commaSep1(choice($._expression, $.slice)),
field('subscript', commaSep1(choice($._expression, $.slice))),
optional(','),

@@ -634,7 +685,7 @@ ']'

call: $ => prec(PREC.call, seq(
$._primary_expression,
choice(
field('function', $._primary_expression),
field('arguments', choice(
$.generator_expression,
$.argument_list
)
))
)),

@@ -649,3 +700,3 @@

':',
$.type
field('type', $.type)
)),

@@ -656,5 +707,5 @@

keyword_argument: $ => seq(
choice($.identifier, $.keyword_identifier),
field('name', choice($.identifier, $.keyword_identifier)),
'=',
$._expression
field('value', $._expression)
),

@@ -671,3 +722,3 @@

_comprehension_body: $ => seq(
_comprehension_clauses: $ => seq(
$.for_in_clause,

@@ -682,4 +733,4 @@ repeat(choice(

'[',
$._expression,
$._comprehension_body,
field('body', $._expression),
$._comprehension_clauses,
']'

@@ -697,4 +748,4 @@ ),

'{',
$.pair,
$._comprehension_body,
field('body', $.pair),
$._comprehension_clauses,
'}'

@@ -704,5 +755,5 @@ ),

pair: $ => seq(
$._expression,
field('key', $._expression),
':',
$._expression
field('value', $._expression)
),

@@ -719,4 +770,4 @@

'{',
$._expression,
$._comprehension_body,
field('body', $._expression),
$._comprehension_clauses,
'}'

@@ -740,4 +791,4 @@ ),

'(',
$._expression,
$._comprehension_body,
field('body', $._expression),
$._comprehension_clauses,
')'

@@ -749,5 +800,5 @@ ),

'for',
$.variables,
field('left', $.variables),
'in',
commaSep1($._expression_within_for_in_clause),
field('right', commaSep1($._expression_within_for_in_clause)),
optional(',')

@@ -776,3 +827,3 @@ ),

alias($._string_start, '"'),
repeat(choice($.interpolation, $.escape_sequence, $._string_content)),
repeat(choice($.interpolation, $.escape_sequence, $._not_escape_sequence, $._string_content)),
alias($._string_end, '"')

@@ -789,3 +840,3 @@ ),

escape_sequence: $ => token(seq(
escape_sequence: $ => token(prec(1, seq(
'\\',

@@ -796,8 +847,10 @@ choice(

/x[a-fA-F\d]{2}/,
/o\d{3}/,
/\r\n/,
/[^uxo]/
/\d{3}/,
/\r?\n/,
/['"abfrntv\\]/,
)
)),
))),
_not_escape_sequence: $ => '\\',
format_specifier: $ => seq(

@@ -804,0 +857,0 @@ ':',

{
"name": "tree-sitter-python",
"version": "0.15.0",
"version": "0.15.1",
"description": "Python grammar for tree-sitter",

@@ -16,3 +16,3 @@ "main": "index.js",

"devDependencies": {
"tree-sitter-cli": "^0.15.3",
"tree-sitter-cli": "^0.15.12",
"tree-sitter-highlight-schema": "^0.1.1"

@@ -29,3 +29,2 @@ },

"scope": "source.python",
"highlights": "src/highlights.json",
"file-types": [

@@ -32,0 +31,0 @@ "py"

[
{
"type": "_compound_statement",
"named": true,
"subtypes": [
{
"type": "class_definition",
"named": true
},
{
"type": "decorated_definition",
"named": true
},
{
"type": "for_statement",
"named": true
},
{
"type": "function_definition",
"named": true
},
{
"type": "if_statement",
"named": true
},
{
"type": "try_statement",
"named": true
},
{
"type": "while_statement",
"named": true
},
{
"type": "with_statement",
"named": true
}
]
},
{
"type": "_expression",
"named": true,
"subtypes": [
{
"type": "_primary_expression",
"named": true
},
{
"type": "await",
"named": true
},
{
"type": "boolean_operator",
"named": true
},
{
"type": "comparison_operator",
"named": true
},
{
"type": "conditional_expression",
"named": true
},
{
"type": "lambda",
"named": true
},
{
"type": "named_expression",
"named": true
},
{
"type": "not_operator",
"named": true
}
]
},
{
"type": "_parameter",
"named": true,
"subtypes": [
{
"type": "default_parameter",
"named": true
},
{
"type": "dictionary_splat",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "list_splat",
"named": true
},
{
"type": "tuple",
"named": true
},
{
"type": "typed_default_parameter",
"named": true
},
{
"type": "typed_parameter",
"named": true
}
]
},
{
"type": "_primary_expression",
"named": true,
"subtypes": [
{
"type": "attribute",
"named": true
},
{
"type": "binary_operator",
"named": true
},
{
"type": "call",
"named": true
},
{
"type": "concatenated_string",
"named": true
},
{
"type": "dictionary",
"named": true
},
{
"type": "dictionary_comprehension",
"named": true
},
{
"type": "ellipsis",
"named": true
},
{
"type": "false",
"named": true
},
{
"type": "float",
"named": true
},
{
"type": "generator_expression",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "integer",
"named": true
},
{
"type": "list",
"named": true
},
{
"type": "list_comprehension",
"named": true
},
{
"type": "none",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
},
{
"type": "set",
"named": true
},
{
"type": "set_comprehension",
"named": true
},
{
"type": "string",
"named": true
},
{
"type": "subscript",
"named": true
},
{
"type": "true",
"named": true
},
{
"type": "tuple",
"named": true
},
{
"type": "unary_operator",
"named": true
}
]
},
{
"type": "_simple_statement",
"named": true,
"subtypes": [
{
"type": "assert_statement",
"named": true
},
{
"type": "break_statement",
"named": true
},
{
"type": "continue_statement",
"named": true
},
{
"type": "delete_statement",
"named": true
},
{
"type": "exec_statement",
"named": true
},
{
"type": "expression_statement",
"named": true
},
{
"type": "future_import_statement",
"named": true
},
{
"type": "global_statement",
"named": true
},
{
"type": "import_from_statement",
"named": true
},
{
"type": "import_statement",
"named": true
},
{
"type": "nonlocal_statement",
"named": true
},
{
"type": "pass_statement",
"named": true
},
{
"type": "print_statement",
"named": true
},
{
"type": "raise_statement",
"named": true
},
{
"type": "return_statement",
"named": true
}
]
},
{
"type": "aliased_import",
"named": true,
"fields": {}
"fields": {
"alias": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "dotted_name",
"named": true
}
]
}
}
},

@@ -10,3 +305,29 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "dictionary_splat",
"named": true
},
{
"type": "keyword_argument",
"named": true
},
{
"type": "list_splat",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
}
]
}
},

@@ -16,3 +337,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -22,3 +353,46 @@ {

"named": true,
"fields": {}
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression_list",
"named": true
}
]
},
"right": {
"multiple": false,
"required": false,
"types": [
{
"type": "assignment",
"named": true
},
{
"type": "augmented_assignment",
"named": true
},
{
"type": "expression_list",
"named": true
},
{
"type": "yield",
"named": true
}
]
},
"type": {
"multiple": false,
"required": false,
"types": [
{
"type": "type",
"named": true
}
]
}
}
},

@@ -28,3 +402,24 @@ {

"named": true,
"fields": {}
"fields": {
"attribute": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"object": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
}
},

@@ -34,3 +429,94 @@ {

"named": true,
"fields": {}
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression_list",
"named": true
}
]
},
"operator": {
"multiple": false,
"required": true,
"types": [
{
"type": "%=",
"named": false
},
{
"type": "&=",
"named": false
},
{
"type": "**=",
"named": false
},
{
"type": "*=",
"named": false
},
{
"type": "+=",
"named": false
},
{
"type": "-=",
"named": false
},
{
"type": "//=",
"named": false
},
{
"type": "/=",
"named": false
},
{
"type": "<<=",
"named": false
},
{
"type": ">>=",
"named": false
},
{
"type": "@=",
"named": false
},
{
"type": "^=",
"named": false
},
{
"type": "|=",
"named": false
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "assignment",
"named": true
},
{
"type": "augmented_assignment",
"named": true
},
{
"type": "expression_list",
"named": true
},
{
"type": "yield",
"named": true
}
]
}
}
},

@@ -40,3 +526,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -46,8 +542,141 @@ {

"named": true,
"fields": {}
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
},
"operator": {
"multiple": false,
"required": true,
"types": [
{
"type": "%",
"named": false
},
{
"type": "&",
"named": false
},
{
"type": "*",
"named": false
},
{
"type": "**",
"named": false
},
{
"type": "+",
"named": false
},
{
"type": "-",
"named": false
},
{
"type": "/",
"named": false
},
{
"type": "//",
"named": false
},
{
"type": "<<",
"named": false
},
{
"type": ">>",
"named": false
},
{
"type": "@",
"named": false
},
{
"type": "^",
"named": false
},
{
"type": "|",
"named": false
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
}
},
{
"type": "block",
"named": true,
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_compound_statement",
"named": true
},
{
"type": "_simple_statement",
"named": true
}
]
}
},
{
"type": "boolean_operator",
"named": true,
"fields": {}
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
},
"operator": {
"multiple": false,
"required": true,
"types": [
{
"type": "and",
"named": false
},
{
"type": "or",
"named": false
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -62,3 +691,28 @@ {

"named": true,
"fields": {}
"fields": {
"arguments": {
"multiple": false,
"required": true,
"types": [
{
"type": "argument_list",
"named": true
},
{
"type": "generator_expression",
"named": true
}
]
},
"function": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
}
},

@@ -68,3 +722,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -74,3 +738,34 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"superclasses": {
"multiple": false,
"required": false,
"types": [
{
"type": "argument_list",
"named": true
}
]
}
}
},

@@ -80,3 +775,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
},

@@ -86,3 +791,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "string",
"named": true
}
]
}
},

@@ -92,3 +807,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -103,3 +828,28 @@ {

"named": true,
"fields": {}
"fields": {
"definition": {
"multiple": false,
"required": true,
"types": [
{
"type": "class_definition",
"named": true
},
{
"type": "function_definition",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "decorator",
"named": true
}
]
}
},

@@ -109,3 +859,24 @@ {

"named": true,
"fields": {}
"fields": {
"arguments": {
"multiple": false,
"required": false,
"types": [
{
"type": "argument_list",
"named": true
}
]
}
},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "dotted_name",
"named": true
}
]
}
},

@@ -115,3 +886,24 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -121,3 +913,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression_list",
"named": true
}
]
}
},

@@ -127,3 +929,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "dictionary_splat",
"named": true
},
{
"type": "pair",
"named": true
}
]
}
},

@@ -133,3 +949,28 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "pair",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "for_in_clause",
"named": true
},
{
"type": "if_clause",
"named": true
}
]
}
},

@@ -139,3 +980,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -145,3 +996,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
},

@@ -151,3 +1012,24 @@ {

"named": true,
"fields": {}
"fields": {
"condition": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
},
"consequence": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
}
},

@@ -157,3 +1039,14 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
}
},

@@ -163,3 +1056,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "block",
"named": true
}
]
}
},

@@ -169,3 +1076,24 @@ {

"named": true,
"fields": {}
"fields": {
"code": {
"multiple": false,
"required": true,
"types": [
{
"type": "string",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -175,3 +1103,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -181,3 +1119,25 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "assignment",
"named": true
},
{
"type": "augmented_assignment",
"named": true
},
{
"type": "yield",
"named": true
}
]
}
},

@@ -187,3 +1147,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
},

@@ -193,3 +1163,32 @@ {

"named": true,
"fields": {}
"fields": {
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "variables",
"named": true
}
]
},
"right": {
"multiple": true,
"required": true,
"types": [
{
"type": ",",
"named": false
},
{
"type": "_expression",
"named": true
},
{
"type": "lambda",
"named": true
}
]
}
}
},

@@ -199,3 +1198,44 @@ {

"named": true,
"fields": {}
"fields": {
"alternative": {
"multiple": false,
"required": false,
"types": [
{
"type": "else_clause",
"named": true
}
]
},
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
},
"left": {
"multiple": false,
"required": true,
"types": [
{
"type": "variables",
"named": true
}
]
},
"right": {
"multiple": false,
"required": true,
"types": [
{
"type": "expression_list",
"named": true
}
]
}
}
},

@@ -205,3 +1245,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -211,3 +1261,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "format_expression",
"named": true
}
]
}
},

@@ -217,3 +1277,44 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
},
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"parameters": {
"multiple": false,
"required": true,
"types": [
{
"type": "parameters",
"named": true
}
]
},
"return_type": {
"multiple": false,
"required": false,
"types": [
{
"type": "type",
"named": true
}
]
}
}
},

@@ -223,3 +1324,18 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": true,
"required": true,
"types": [
{
"type": "aliased_import",
"named": true
},
{
"type": "dotted_name",
"named": true
}
]
}
}
},

@@ -229,3 +1345,28 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "for_in_clause",
"named": true
},
{
"type": "if_clause",
"named": true
}
]
}
},

@@ -235,3 +1376,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
},

@@ -241,3 +1392,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -247,3 +1408,38 @@ {

"named": true,
"fields": {}
"fields": {
"alternative": {
"multiple": true,
"required": false,
"types": [
{
"type": "elif_clause",
"named": true
},
{
"type": "else_clause",
"named": true
}
]
},
"condition": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
},
"consequence": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
}
},

@@ -253,3 +1449,42 @@ {

"named": true,
"fields": {}
"fields": {
"module_name": {
"multiple": false,
"required": true,
"types": [
{
"type": "dotted_name",
"named": true
},
{
"type": "relative_import",
"named": true
}
]
},
"name": {
"multiple": true,
"required": false,
"types": [
{
"type": "aliased_import",
"named": true
},
{
"type": "dotted_name",
"named": true
}
]
}
},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "wildcard_import",
"named": true
}
]
}
},

@@ -264,3 +1499,18 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": true,
"required": true,
"types": [
{
"type": "aliased_import",
"named": true
},
{
"type": "dotted_name",
"named": true
}
]
}
}
},

@@ -270,3 +1520,21 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "format_specifier",
"named": true
},
{
"type": "type_conversion",
"named": true
}
]
}
},

@@ -276,13 +1544,54 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},
{
"type": "keyword_identifier",
"named": true,
"fields": {}
},
{
"type": "lambda",
"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "lambda",
"named": true
}
]
},
"parameters": {
"multiple": false,
"required": false,
"types": [
{
"type": "lambda_parameters",
"named": true
}
]
}
}
},

@@ -292,3 +1601,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_parameter",
"named": true
}
]
}
},

@@ -298,3 +1617,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "list_splat",
"named": true
}
]
}
},

@@ -304,3 +1637,28 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "for_in_clause",
"named": true
},
{
"type": "if_clause",
"named": true
}
]
}
},

@@ -310,3 +1668,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -316,3 +1684,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_compound_statement",
"named": true
},
{
"type": "_simple_statement",
"named": true
}
]
}
},

@@ -322,3 +1704,24 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -328,3 +1731,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
}
},

@@ -334,3 +1747,14 @@ {

"named": true,
"fields": {}
"fields": {
"argument": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -340,3 +1764,24 @@ {

"named": true,
"fields": {}
"fields": {
"key": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -346,3 +1791,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_parameter",
"named": true
}
]
}
},

@@ -352,3 +1807,25 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "list_splat",
"named": true
},
{
"type": "parenthesized_expression",
"named": true
},
{
"type": "yield",
"named": true
}
]
}
},

@@ -363,3 +1840,24 @@ {

"named": true,
"fields": {}
"fields": {
"argument": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "chevron",
"named": true
}
]
}
},

@@ -369,3 +1867,24 @@ {

"named": true,
"fields": {}
"fields": {
"cause": {
"multiple": false,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "expression_list",
"named": true
}
]
}
},

@@ -375,3 +1894,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "dotted_name",
"named": true
},
{
"type": "import_prefix",
"named": true
}
]
}
},

@@ -381,3 +1914,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "expression_list",
"named": true
}
]
}
},

@@ -387,3 +1930,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "list_splat",
"named": true
}
]
}
},

@@ -393,3 +1950,28 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "for_in_clause",
"named": true
},
{
"type": "if_clause",
"named": true
}
]
}
},

@@ -399,3 +1981,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -405,3 +1997,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "escape_sequence",
"named": true
},
{
"type": "interpolation",
"named": true
}
]
}
},

@@ -411,3 +2017,32 @@ {

"named": true,
"fields": {}
"fields": {
"subscript": {
"multiple": true,
"required": true,
"types": [
{
"type": ",",
"named": false
},
{
"type": "_expression",
"named": true
},
{
"type": "slice",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
}
},

@@ -417,3 +2052,32 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "else_clause",
"named": true
},
{
"type": "except_clause",
"named": true
},
{
"type": "finally_clause",
"named": true
}
]
}
},

@@ -423,3 +2087,17 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": false,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "yield",
"named": true
}
]
}
},

@@ -429,3 +2107,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
},

@@ -435,3 +2123,34 @@ {

"named": true,
"fields": {}
"fields": {
"name": {
"multiple": false,
"required": true,
"types": [
{
"type": "identifier",
"named": true
}
]
},
"type": {
"multiple": false,
"required": true,
"types": [
{
"type": "type",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -441,3 +2160,32 @@ {

"named": true,
"fields": {}
"fields": {
"type": {
"multiple": false,
"required": true,
"types": [
{
"type": "type",
"named": true
}
]
}
},
"children": {
"multiple": false,
"required": true,
"types": [
{
"type": "dictionary_splat",
"named": true
},
{
"type": "identifier",
"named": true
},
{
"type": "list_splat",
"named": true
}
]
}
},

@@ -447,3 +2195,32 @@ {

"named": true,
"fields": {}
"fields": {
"argument": {
"multiple": false,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
},
"operator": {
"multiple": false,
"required": true,
"types": [
{
"type": "+",
"named": false
},
{
"type": "-",
"named": false
},
{
"type": "~",
"named": false
}
]
}
}
},

@@ -453,3 +2230,13 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "_primary_expression",
"named": true
}
]
}
},

@@ -459,3 +2246,34 @@ {

"named": true,
"fields": {}
"fields": {
"alternative": {
"multiple": false,
"required": false,
"types": [
{
"type": "else_clause",
"named": true
}
]
},
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
},
"condition": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -470,3 +2288,24 @@ {

"named": true,
"fields": {}
"fields": {
"alias": {
"multiple": false,
"required": false,
"types": [
{
"type": "_expression",
"named": true
}
]
},
"value": {
"multiple": false,
"required": true,
"types": [
{
"type": "_expression",
"named": true
}
]
}
}
},

@@ -476,3 +2315,24 @@ {

"named": true,
"fields": {}
"fields": {
"body": {
"multiple": false,
"required": true,
"types": [
{
"type": "block",
"named": true
}
]
}
},
"children": {
"multiple": true,
"required": true,
"types": [
{
"type": "with_item",
"named": true
}
]
}
},

@@ -482,21 +2342,39 @@ {

"named": true,
"fields": {}
"fields": {},
"children": {
"multiple": false,
"required": false,
"types": [
{
"type": "_expression",
"named": true
},
{
"type": "expression_list",
"named": true
}
]
}
},
{
"type": "import",
"type": "!=",
"named": false
},
{
"type": ".",
"type": "%",
"named": false
},
{
"type": "from",
"type": "%=",
"named": false
},
{
"type": "__future__",
"type": "&",
"named": false
},
{
"type": "&=",
"named": false
},
{
"type": "(",

@@ -510,306 +2388,298 @@ "named": false

{
"type": ",",
"type": "*",
"named": false
},
{
"type": "as",
"type": "**",
"named": false
},
{
"type": "*",
"type": "**=",
"named": false
},
{
"type": "print",
"type": "*=",
"named": false
},
{
"type": ">>",
"type": "+",
"named": false
},
{
"type": "assert",
"type": "+=",
"named": false
},
{
"type": ":=",
"type": ",",
"named": false
},
{
"type": "return",
"type": "-",
"named": false
},
{
"type": "del",
"type": "-=",
"named": false
},
{
"type": "raise",
"type": "->",
"named": false
},
{
"type": "pass",
"type": ".",
"named": false
},
{
"type": "break",
"type": "/",
"named": false
},
{
"type": "continue",
"type": "//",
"named": false
},
{
"type": "if",
"type": "//=",
"named": false
},
{
"type": ":",
"type": "/=",
"named": false
},
{
"type": "elif",
"type": ":",
"named": false
},
{
"type": "else",
"type": ":=",
"named": false
},
{
"type": "async",
"type": "<",
"named": false
},
{
"type": "for",
"type": "<<",
"named": false
},
{
"type": "in",
"type": "<<=",
"named": false
},
{
"type": "while",
"type": "<=",
"named": false
},
{
"type": "try",
"type": "<>",
"named": false
},
{
"type": "except",
"type": "=",
"named": false
},
{
"type": "finally",
"type": "==",
"named": false
},
{
"type": "with",
"type": ">",
"named": false
},
{
"type": "def",
"type": ">=",
"named": false
},
{
"type": "->",
"type": ">>",
"named": false
},
{
"type": "=",
"type": ">>=",
"named": false
},
{
"type": "global",
"type": "@",
"named": false
},
{
"type": "nonlocal",
"type": "@=",
"named": false
},
{
"type": "exec",
"type": "[",
"named": false
},
{
"type": "class",
"type": "]",
"named": false
},
{
"type": "@",
"type": "^",
"named": false
},
{
"type": "not",
"type": "^=",
"named": false
},
{
"type": "and",
"type": "__future__",
"named": false
},
{
"type": "or",
"type": "and",
"named": false
},
{
"type": "+",
"type": "as",
"named": false
},
{
"type": "-",
"type": "assert",
"named": false
},
{
"type": "/",
"type": "async",
"named": false
},
{
"type": "%",
"type": "await",
"named": false
},
{
"type": "//",
"type": "break",
"named": false
},
{
"type": "**",
"type": "class",
"named": false
},
{
"type": "|",
"type": "continue",
"named": false
},
{
"type": "&",
"type": "def",
"named": false
},
{
"type": "^",
"type": "del",
"named": false
},
{
"type": "<<",
"type": "elif",
"named": false
},
{
"type": "~",
"named": false
"type": "ellipsis",
"named": true
},
{
"type": "<",
"type": "else",
"named": false
},
{
"type": "<=",
"named": false
"type": "escape_sequence",
"named": true
},
{
"type": "==",
"type": "except",
"named": false
},
{
"type": "!=",
"type": "exec",
"named": false
},
{
"type": ">=",
"named": false
"type": "false",
"named": true
},
{
"type": ">",
"type": "finally",
"named": false
},
{
"type": "<>",
"named": false
"type": "float",
"named": true
},
{
"type": "is",
"type": "for",
"named": false
},
{
"type": "lambda",
"type": "from",
"named": false
},
{
"type": "+=",
"type": "global",
"named": false
},
{
"type": "-=",
"named": false
"type": "identifier",
"named": true
},
{
"type": "*=",
"type": "if",
"named": false
},
{
"type": "/=",
"type": "import",
"named": false
},
{
"type": "@=",
"type": "in",
"named": false
},
{
"type": "//=",
"named": false
"type": "integer",
"named": true
},
{
"type": "%=",
"type": "is",
"named": false
},
{
"type": "**=",
"type": "lambda",
"named": false
},
{
"type": ">>=",
"named": false
"type": "none",
"named": true
},
{
"type": "<<=",
"type": "nonlocal",
"named": false
},
{
"type": "&=",
"type": "not",
"named": false
},
{
"type": "^=",
"type": "or",
"named": false
},
{
"type": "|=",
"type": "pass",
"named": false
},
{
"type": "yield",
"type": "print",
"named": false
},
{
"type": "[",
"type": "raise",
"named": false
},
{
"type": "]",
"type": "return",
"named": false
},
{
"type": "ellipsis",
"type": "true",
"named": true
},
{
"type": "{",
"type": "try",
"named": false
},
{
"type": "}",
"named": false
},
{
"type": "escape_sequence",
"named": true
},
{
"type": "type_conversion",

@@ -819,33 +2689,33 @@ "named": true

{
"type": "integer",
"named": true
"type": "while",
"named": false
},
{
"type": "float",
"named": true
"type": "with",
"named": false
},
{
"type": "identifier",
"named": true
"type": "yield",
"named": false
},
{
"type": "true",
"named": true
"type": "{",
"named": false
},
{
"type": "false",
"named": true
"type": "|",
"named": false
},
{
"type": "none",
"named": true
"type": "|=",
"named": false
},
{
"type": "await",
"type": "}",
"named": false
},
{
"type": "comment",
"named": true
"type": "~",
"named": false
}
]

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc