Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 Dj\@svdZddlmZddlmZmZmZGdddZGdddeZGd d d eZ Gd d d eZ Gd ddeZ GdddeZ GdddeZ GdddeZGdddeZGdddeZGdddeZGdddeZGdddeZGdd d eZGd!d"d"eZGd#d$d$eZGd%d&d&eZGd'd(d(eZGd)d*d*eZGd+d,d,eZGd-d.d.eZd/S)0z5 Data structures for the CSS abstract syntax tree. ) ascii_lower) _serialize_toserialize_identifierserialize_namec@sJeZdZdZddgZddZeekr.ddZnddZd d Z d d Z d S)NodeaEvery node type inherits from this class, which is never instantiated directly. .. attribute:: type Each child class has a :attr:`type` class attribute with a unique string value. This allows checking for the node type with code like: .. code-block:: python if node.type == 'whitespace': instead of the more verbose: .. code-block:: python from tinycss2.ast import WhitespaceToken if isinstance(node, WhitespaceToken): Every node also has these attributes and methods, which are not repeated for brevity: .. attribute:: source_line The line number of the start of the node in the CSS source. Starts at 1. .. attribute:: source_column The column number within :attr:`source_line` of the start of the node in the CSS source. Starts at 1. .. automethod:: serialize source_line source_columncCs||_||_dS)N)rr )selfrr r 0/tmp/pip-build-_d5lkt3n/tinycss2/tinycss2/ast.py__init__5sz Node.__init__cCs|jj|djdS)N)r utf8) repr_formatformatencode)r r r r __repr__:sz Node.__repr__cCs|jj|dS)N)r )rr)r r r r r=scCsg}|j|jdj|S)z>Serialize this node to CSS syntax and return a Unicode string.)rappendjoin)r chunksr r r serialize@s zNode.serializecCstdS)zSerialize this node to CSS syntax, writing chunks as Unicode string by calling the provided :obj:`write` callback. N)NotImplementedError)r writer r r rFszNode._serialize_toN) __name__ __module__ __qualname____doc__ __slots__r strbytesrrrr r r r r s% rc@s0eZdZdZddgZdZdZddZdd Zd S) ParseErroraA syntax error of some sort. May occur anywhere in the tree. Syntax errors are not fatal in the parser to allow for different error handling behaviors. For example, an error in a Selector list makes the whole rule invalid, but an error in a Media Query list only replaces one comma-separated query with ``not all``. .. autoattribute:: type .. attribute:: kind Machine-readable string indicating the type of error. Example: ``'bad-url'``. .. attribute:: message Human-readable explanation of the error, as a string. Could be translated, expanded to include details, etc. kindmessageerrorz'<{self.__class__.__name__} {self.kind}>cCstj|||||_||_dS)N)rr r"r#)r linecolumnr"r#r r r r hszParseError.__init__cCsZ|jdkr|dnB|jdkr(|dn.|jdkr>||jn|jd krJn td|dS) Nz bad-stringz"[bad string] zbad-urlzurl([bad url])z)]} eof-in-string eof-in-urlzCan not serialize %r)r'r()r" TypeError)r rr r r rms       zParseError._serialize_toN) rrrrrtyperr rr r r r r!Ns r!c@s.eZdZdZdgZdZdZddZddZd S) CommentaA CSS comment. Comments can be ignored by passing ``skip_comments=True`` to functions such as :func:`~tinycss2.parse_component_value_list`. .. autoattribute:: type .. attribute:: value The content of the comment, between ``/*`` and ``*/``, as a string. valuecommentz(<{self.__class__.__name__} {self.value}>cCstj|||||_dS)N)rr r,)r r%r&r,r r r r szComment.__init__cCs|d||j|ddS)Nz/*z*/)r,)r rr r r rs zComment._serialize_toN) rrrrrr*rr rr r r r r+zs  r+c@s.eZdZdZdgZdZdZddZddZd S) WhitespaceTokenzA :diagram:`whitespace-token`. .. autoattribute:: type .. attribute:: value The whitespace sequence, as a string, as in the original CSS source. r, whitespacez<{self.__class__.__name__}>cCstj|||||_dS)N)rr r,)r r%r&r,r r r r szWhitespaceToken.__init__cCs||jdS)N)r,)r rr r r rszWhitespaceToken._serialize_toN) rrrrrr*rr rr r r r r.s  r.c@s>eZdZdZdgZdZdZddZddZd d Z d d Z d S) LiteralTokenaToken that represents one or more characters as in the CSS source. .. autoattribute:: type .. attribute:: value A string of one to four characters. Instances compare equal to their :attr:`value`, so that these are equivalent: .. code-block:: python if node == ';': if node.type == 'literal' and node.value == ';': This regroups what `the specification`_ defines as separate token types: .. _the specification: https://drafts.csswg.org/css-syntax-3/ * ** ``:`` * ** ``;`` * ** ``,`` * ** ``-->`` * ** ``