tree-sitter-python
Advanced tools
Comparing version 0.13.5 to 0.13.6
@@ -733,2 +733,3 @@ const PREC = { | ||
optional($.type_conversion), | ||
optional($.format_specifier), | ||
'}' | ||
@@ -749,2 +750,12 @@ ), | ||
format_specifier: $ => seq( | ||
':', | ||
repeat(choice( | ||
/[^{}\n]+/, | ||
$.format_expression | ||
)) | ||
), | ||
format_expression: $ => seq('{', $._expression, '}'), | ||
type_conversion: $ => /![a-z]/, | ||
@@ -777,16 +788,15 @@ | ||
float: $ => token( | ||
seq( | ||
float: $ => { | ||
const digits = repeat1(/[0-9]+_?/); | ||
const exponent = seq(/[eE][\+-]?/, digits) | ||
return token(seq( | ||
choice( | ||
seq(repeat(/[0-9]+_?/), '.', repeat(/[0-9]+_?/), optional(/[eE][\+-]?/), repeat(/[0-9]+_?/)), | ||
seq(repeat(/[0-9]+_?/), optional(/[eE][\+-]?/), repeat1(/[0-9]+_?/)) | ||
seq(digits, '.', optional(digits), optional(exponent)), | ||
seq(optional(digits), '.', digits, optional(exponent)), | ||
seq(digits, exponent) | ||
), | ||
optional( | ||
choice( | ||
optional(/[Ll]/), // long numbers | ||
optional(/[jJ]/) // complex numbers | ||
) | ||
) | ||
) | ||
), | ||
optional(choice(/[Ll]/, /[jJ]/)) | ||
)) | ||
}, | ||
@@ -793,0 +803,0 @@ identifier: $ => /[a-zA-Zα-ωΑ-Ω_][a-zA-Zα-ωΑ-Ω_0-9]*/, |
{ | ||
"name": "tree-sitter-python", | ||
"version": "0.13.5", | ||
"version": "0.13.6", | ||
"description": "Python grammar for tree-sitter", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2652040
4865