3 ��Xu � @ s^ d Z ddlZddlmZmZmZ ddlmZmZm Z m Z mZmZm Z dgZG dd� de�ZdS )z� pygments.lexers.resource ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for resource definition files. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)� RegexLexer�bygroups�words)�Comment�String�Number�Operator�Text�Keyword�Name� ResourceLexerc @ s� e Zd ZdZdZddgZdgZd)Zej ej B Zdefde dfdejfdefddje� eeee�fdefee�efgde fde jdfde dfgdeee j�d*fgde jdfde jdfdeee jee j�dfdeee jee jee jeje jee jeje j�dfd eee jee jee j�dfde jfgd!eeeje j�dfd"eeje j�d#fde jd+fde jfgde jdfde jdfd$e fgd%�Zd&d'� Zd(S ),r zzLexer for `ICU Resource bundles <http://userguide.icu-project.org/locale/resources>`_. .. versionadded:: 2.0 ZResourceBundleZresourceZresourcebundlez*.txt�:table�:array�:string�:bin�:import� :intvector�:int�:aliasz//.*?$�"�stringz-?\d+z[,{}]z([^\s{:]+)(\s*)(%s?)�|z\s+zc(\\x[0-9a-f]{2}|\\u[0-9a-f]{4}|\\U00[0-9a-f]{6}|\\[0-7]{1,3}|\\c.|\\[abtnvfre\'"?\\]|\\\{|[^"{\\])+z\{�msgname�#popz([^{},]+)(\s*)�messagez\}z(,)(\s*)([a-z]+)(\s*\})z>(,)(\s*)([a-z]+)(\s*)(,)(\s*)(offset)(\s*)(:)(\s*)(-?\d+)(\s*)�choicez(,)(\s*)([a-z]+)(\s*)(,)(\s*)z(=|<|>|<=|>=|!=)(-?\d+)(\s*\{)z([a-z]+)(\s*\{)�strz[^{}]+)�rootr r r r r c C s | j d�rdS d S )Nz root:tableg �?)� startswith)�text� r �/usr/lib/python3.6/resource.py�analyse_textS s zResourceLexer.analyse_textN)r r r r r r r r )r r )r r )�__name__� __module__�__qualname__�__doc__�name�aliases� filenamesZ_types�re� MULTILINE� IGNORECASE�flagsr r r ZIntegerr �joinr r r r r ZEscapeZWordZType�tokensr"