3
V'íc ã @ sr d Z ddlZddlmZmZmZmZ ddlmZm Z m
Z
mZmZm
Z
mZ ddlmZmZ dgZG dd deZdS )z¾
pygments.lexers.stata
~~~~~~~~~~~~~~~~~~~~~
Lexer for Stata
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
é N)Ú
RegexLexerÚdefaultÚincludeÚwords)ÚCommentÚKeywordÚNameÚNumberÚStringÚTextÚOperator)Ú
builtins_baseÚbuiltins_functionsÚ
StataLexerc @ sª e Zd ZdZdZdZddgZddgZdd d
gZe j
e jB Ze
de
de
d
e
de
de
de
ddefgdejdfdejdfdejdfdejdfgdejdfdejfdejdfdejfgdejdAfdejdBfdejdfd ejdfdejfgd!ejdfd"ejdfdejfgd!edfdejfgd#ed$fd%ed&fgd#edfd'edfd(ejfe
d
defgd)edfd(ejfe
d
defgd*ejjd+fd,ejjd-fd.ejd/fgd.ejdfd0ejdfd*ejjd+fd,ejjd-fdejfgd*ejjdfd1ejjdfd,ejjd-fd.ejd/fd2ejjfedgd*ejjd+dfd,ejjd-dfd.ejd/dfd3ejjdfgeed4d5d6ejfeed7d4d6efgd8efd9efgd:efgd;ej fd<ej fd=ej fd>ej fgd?Z!d@S )Cr z8
For Stata do files.
.. versionadded:: 2.2
ZStatazhttp://www.stata.com/ZstataZdoz*.doz*.adoztext/x-stataz
text/statazapplication/x-stataÚcommentsÚstringsÚmacrosÚnumbersÚkeywordsÚ operatorsÚformatÚ.z(^//|(?<=\s)//)(?!/)úcomments-double-slashz^\s*\*z
comments-starz/\*zcomments-blockz(^///|(?<=\s)///)úcomments-triple-slashz#pushz\*/\*z(\*/\s+\*(?!/)[^\n]*)|(\*/)ú#popz///.*?\nz.(?=\n)z\nz//.*?(?=\n)z`"zstring-compoundz(?<!`)"zstring-regularz"\'z\\\\|\\"|\\\$|\\`|\\\nz(")(?!\')|(?=\n)z\$(\{|(?=[$`]))zmacro-global-nestedz\$zmacro-global-nameú`zmacro-localú'z\}z\wz\w{1,32}z\bz(?=\())ÚprefixÚsuffixz (^\s*|\s)z-|==|<=|>=|<|>|&|!=z\*|\+|\^|/|!|~|==|~=z>\b[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+|\.)([eE][+-]?[0-9]+)?[i]?\bz%-?\d{1,2}(\.\d{1,2})?[gfe]c?z%(21x|16H|16L|8H|8L)z'%-?(tc|tC|td|tw|tm|tq|th|ty|tg)\S{0,32}z%[-~]?\d{1,4}s)Úrootr zcomments-blockz
comments-starzcomments-triple-slashzcomments-double-slashr zstring-compoundzstring-regularr zmacro-localzmacro-global-nestedzmacro-global-namer r r r N)r r )r r )"Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚnameÚurlÚaliasesÚ filenamesÚ mimetypesÚreÚ MULTILINEÚDOTALLÚflagsr r r ÚSingleZ MultilineÚSpecialr