mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-05 20:41:47 -07:00
[JSInterp] Reorganise some declarations to align better with yt-dlp
This commit is contained in:
parent
67dbfa65f2
commit
7513413794
2 changed files with 31 additions and 30 deletions
|
@ -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 = '\'"/'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue