aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/jsinterp.py
diff options
context:
space:
mode:
authordirkf <fieldhouse@gmx.net>2025-04-04 12:15:38 +0100
committerdirkf <fieldhouse@gmx.net>2025-04-08 01:59:00 +0100
commit75134137947d1cd58b73f4186b3693d032c5bb66 (patch)
tree583a5c3785cd307e09fbfe1b29218637db80c574 /youtube_dl/jsinterp.py
parent67dbfa65f220e358de713977bed8d818059f7f27 (diff)
[JSInterp] Reorganise some declarations to align better with yt-dlp
Diffstat (limited to 'youtube_dl/jsinterp.py')
-rw-r--r--youtube_dl/jsinterp.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/youtube_dl/jsinterp.py b/youtube_dl/jsinterp.py
index 69c8f77ca..971387df2 100644
--- a/youtube_dl/jsinterp.py
+++ b/youtube_dl/jsinterp.py
@@ -283,17 +283,6 @@ _OPERATORS = (
('**', _js_exp),
)
-_COMP_OPERATORS = (
- ('===', _js_id_op(operator.is_)),
- ('!==', _js_id_op(operator.is_not)),
- ('==', _js_eq),
- ('!=', _js_neq),
- ('<=', _js_comp_op(operator.le)),
- ('>=', _js_comp_op(operator.ge)),
- ('<', _js_comp_op(operator.lt)),
- ('>', _js_comp_op(operator.gt)),
-)
-
_LOG_OPERATORS = (
('|', _js_bit_op(operator.or_)),
('^', _js_bit_op(operator.xor)),
@@ -314,6 +303,17 @@ _UNARY_OPERATORS_X = (
_OPERATOR_RE = '|'.join(map(lambda x: re.escape(x[0]), _OPERATORS + _LOG_OPERATORS))
+_COMP_OPERATORS = (
+ ('===', _js_id_op(operator.is_)),
+ ('!==', _js_id_op(operator.is_not)),
+ ('==', _js_eq),
+ ('!=', _js_neq),
+ ('<=', _js_comp_op(operator.le)),
+ ('>=', _js_comp_op(operator.ge)),
+ ('<', _js_comp_op(operator.lt)),
+ ('>', _js_comp_op(operator.gt)),
+)
+
_NAME_RE = r'[a-zA-Z_$][\w$]*'
_MATCHING_PARENS = dict(zip(*zip('()', '{}', '[]')))
_QUOTES = '\'"/'