File: //home/arjun/projects/env/lib64/python3.10/site-packages/tinycss2/__pycache__/ast.cpython-310.pyc
o
we�[ � @ sv d Z ddlmZ ddlmZmZmZ G dd� d�ZG dd� de�ZG d d
� d
e�Z G dd� de�Z
G d
d� de�ZG dd� de�ZG dd� de�Z
G dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd� de�ZG dd � d e�ZG d!d"� d"e�ZG d#d$� d$e�ZG d%d&� d&e�ZG d'd(� d(e�ZG d)d*� d*e�ZG d+d,� d,e�ZG d-d.� d.e�Zd/S )0z5
Data structures for the CSS abstract syntax tree.
� )�ascii_lower� )�
_serialize_to�serialize_identifier�serialize_namec @ s8 e Zd ZdZddgZdd� Zdd� Zdd � Zd
d� ZdS )
�Nodea� Every 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_columnc C s || _ || _d S �N)r r )�selfr r � r �E/home/arjun/projects/env/lib/python3.10/site-packages/tinycss2/ast.py�__init__5 s
z
Node.__init__c C s | j j| d�S )N�r )�repr_format�formatr r r r
�__repr__9 � z
Node.__repr__c C s g }| � |j� d�|�S )z>Serialize this node to CSS syntax and return a Unicode string.� )r �append�join)r �chunksr r r
� serialize<