관리-도구
편집 파일: lexer.cpython-38.pyc
U +�e�? � @ sN d Z ddlZddlZddlmZ ddlmZ ddlmZ i ZG dd� d�Z dS )zGprovides the Lexer class for parsing template strings into parse trees.� N)� exceptions)� parsetree)�adjust_whitespacec @ s� e Zd Zd%dd�Zedd� �Zd&dd�Zdd � Zd d� Zdd � Z e �d�Zdd� Z dd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#d$� ZdS )'�LexerNc C sx || _ || _t�| j�| _d| _d| _d| _d| _g | _ g | _ g | _|| _|d krZg | _ nt|d�sn|g| _ n|| _ d S )N� r �__iter__)�text�filenamer ZTemplateNode�template�matched_lineno�matched_charpos�lineno�match_position�tag�control_line� ternary_stack�encoding�preprocessor�hasattr)�selfr r Zinput_encodingr � r �8/opt/hc_python/lib/python3.8/site-packages/mako/lexer.py�__init__ s zLexer.__init__c C s | j | j| j| jd�S )N)�sourcer �posr )r r r r )r r r r �exception_kwargs* s �zLexer.exception_kwargsc C sV zt ||f }W n: tk rJ |r0t�||�nt�|�}|t ||f<