Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3
Døªj¿5 ã @ s– d dl mZmZmZmZ d dlmZ ddd„Zdd„ Zddd „Z dd
d„Z
dd
„ Zdd„ Zd dd„Z
d!dd„Zd"dd„Zd#dd„Zdd„ Zdd„ ZdS )$é )ÚAtRuleÚDeclarationÚ
ParseErrorÚ
QualifiedRule)Úparse_component_value_listFc C s t | tƒrt| |ƒ} t| ƒS )aq Iterate component values out of string or component values iterable.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments: If the input is a string, ignore all CSS comments.
:returns: An iterator yielding :term:`component values`.
)Ú
isinstanceÚstrr Úiter)ÚinputÚ
skip_comments© r ú3/tmp/pip-build-_d5lkt3n/tinycss2/tinycss2/parser.pyÚ_to_token_iterator s
r c C s x| D ]}|j dkr|S qW dS )zçReturn the next significant (neither whitespace or comment) token.
:type tokens: :term:`iterator`
:param tokens: An iterator yielding :term:`component values`.
:returns: A :term:`component value`, or :obj:`None`.
Ú
whitespaceÚcommentN)r r )Útype)ÚtokensÚtokenr r r
Ú_next_significant s
r c C sR t | |ƒ}t|ƒ}t|ƒ}|dkr0tddddƒS |dk rJt|j|jddƒS |S dS )aú Parse a single :diagram:`component value`.
This is used e.g. for an attribute value
referred to by ``attr(foo length)``.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments: If the input is a string, ignore all CSS comments.
:returns:
A :term:`component value` (that is neither whitespace or comment),
or a :class:`~tinycss2.ast.ParseError`.
Nr ÚemptyzInput is emptyzextra-inputzGot more than one token)r r r Úsource_lineÚ
source_column)r
r r ÚfirstÚsecondr r r
Úparse_one_component_value" s
r c C s2 t | |ƒ}t|ƒ}|dkr(tddddƒS t||ƒS )a? Parse a single :diagram:`declaration`.
This is used e.g. for a declaration in an `@supports
`_ test.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments: If the input is a string, ignore all CSS comments.
:returns:
A :class:`~tinycss2.ast.Declaration`
or :class:`~tinycss2.ast.ParseError`.
Any whitespace or comment before the ``:`` colon is dropped.
Nr r zInput is empty)r r r Ú_parse_declaration)r
r r Úfirst_tokenr r r
Úparse_one_declaration> s
r c C s
| }|j dkr&t|j|jdd|j ƒS t|ƒ}|dkrHt|j|jddƒS |dkrht|j|jdd|j ƒS g }d}xht|ƒD ]\\}}|dkrœ|d krœd
}|}n0|d
kr¾|j dkr¾|jdkr¾d}n|j dkrÌd}|j|ƒ qzW |dkrì||d…= t|j|j|j |j||dkƒS )a§ Parse a declaration.
Consume :obj:`tokens` until the end of the declaration or the first error.
:type first_token: :term:`component value`
:param first_token: The first component value of the rule.
:type tokens: :term:`iterator`
:param tokens: An iterator yielding :term:`component values`.
:returns:
A :class:`~tinycss2.ast.Declaration`
or :class:`~tinycss2.ast.ParseError`.
ÚidentÚinvalidz.Expected for declaration name, got %s.Nz,Expected ':' after declaration name, got EOFú:z,Expected ':' after declaration name, got %s.Úvalueú!ZbangZ importantr r )r r )
r r r r r Ú enumerateÚlower_valueÚappendr r! ) r r ÚnameZcolonr! ÚstateÚir Z
bang_positionr r r
r V s:
r c C s4 g }x |D ]}|dkrP |j |ƒ q
W t| t|ƒƒS )z=Like :func:`_parse_declaration`, but stop at the first ``;``.ú;)r% r r )r r Zother_declaration_tokensr r r r
Ú_consume_declaration_in_list‡ s
r* c C sˆ t | |ƒ}g }xt|D ]l}|jdkr2|s€|j|ƒ q|jdkrL|s€|j|ƒ q|jdkrh|jt||ƒƒ q|dkr|jt||ƒƒ qW |S )uM Parse a :diagram:`declaration list` (which may also contain at-rules).
This is used e.g. for the :attr:`~tinycss2.ast.QualifiedRule.content`
of a style rule or ``@page`` rule,
or for the ``style`` attribute of an HTML element.
In contexts that don’t expect any at-rule,
all :class:`~tinycss2.ast.AtRule` objects
should simply be rejected as invalid.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments:
Ignore CSS comments at the top-level of the list.
If the input is a string, ignore all comments.
:type skip_whitespace: :obj:`bool`
:param skip_whitespace:
Ignore whitespace at the top-level of the list.
Whitespace is still preserved
in the :attr:`~tinycss2.ast.Declaration.value` of declarations
and the :attr:`~tinycss2.ast.AtRule.prelude`
and :attr:`~tinycss2.ast.AtRule.content` of at-rules.
:returns:
A list of
:class:`~tinycss2.ast.Declaration`,
:class:`~tinycss2.ast.AtRule`,
:class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
:class:`~tinycss2.ast.WhitespaceToken`
(if ``skip_whitespace`` is false),
and :class:`~tinycss2.ast.ParseError` objects
r r z
at-keywordr) )r r r% Ú_consume_at_ruler* )r
r Úskip_whitespacer Úresultr r r r
Úparse_declaration_list‘ s "
r. c C s^ t | |ƒ}t|ƒ}|dkr(tddddƒS t||ƒ}t|ƒ}|dk rZt|j|jdd|j ƒS |S )a¬ Parse a single :diagram:`qualified rule` or :diagram:`at-rule`.
This would be used e.g. by `insertRule()
`_
in an implementation of CSSOM.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments:
If the input is a string, ignore all CSS comments.
:returns:
A :class:`~tinycss2.ast.QualifiedRule`,
:class:`~tinycss2.ast.AtRule`,
or :class:`~tinycss2.ast.ParseError` objects.
Any whitespace or comment before or after the rule is dropped.
Nr r zInput is emptyzextra-inputz4Expected a single rule, got %s after the first rule.)r r r Ú
_consume_ruler r r )r
r r r ZruleÚnextr r r
Úparse_one_ruleà s
r1 c C sd t | |ƒ}g }xP|D ]H}|jdkr2|s\|j|ƒ q|jdkrL|s\|j|ƒ q|jt||ƒƒ qW |S )a§ Parse a non-top-level :diagram:`rule list`.
This is used for parsing the :attr:`~tinycss2.ast.AtRule.content`
of nested rules like ``@media``.
This differs from :func:`parse_stylesheet` in that
top-level ```` tokens are not ignored.
:type input: :obj:`str` or :term:`iterable`
:param input: A string or an iterable of :term:`component values`.
:type skip_comments: :obj:`bool`
:param skip_comments:
Ignore CSS comments at the top-level of the list.
If the input is a string, ignore all comments.
:type skip_whitespace: :obj:`bool`
:param skip_whitespace:
Ignore whitespace at the top-level of the list.
Whitespace is still preserved
in the :attr:`~tinycss2.ast.QualifiedRule.prelude`
and the :attr:`~tinycss2.ast.QualifiedRule.content` of rules.
:returns:
A list of
:class:`~tinycss2.ast.QualifiedRule`,
:class:`~tinycss2.ast.AtRule`,
:class:`~tinycss2.ast.Comment` (if ``skip_comments`` is false),
:class:`~tinycss2.ast.WhitespaceToken`
(if ``skip_whitespace`` is false),
and :class:`~tinycss2.ast.ParseError` objects.
r r )r r r% r/ )r
r r, r r- r r r r
Úparse_rule_listå s
r2 c C sl t | |ƒ}g }xX|D ]P}|jdkr2|sd|j|ƒ q|jdkrL|sd|j|ƒ q|dkr|jt||ƒƒ qW |S )a² Parse :diagram:`stylesheet` from text.
This is used e.g. for a ``