3 ��X�� � @ s� d Z ddlZddlmZmZmZmZmZmZm Z ddl mZmZm Z mZmZmZmZmZmZmZ ddddgZG d d� de�ZG d d� de�ZG dd� de�ZG dd� de�ZdS ) z� pygments.lexers.int_fiction ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for interactive fiction languages. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. � N)� RegexLexer�include�bygroups�using�this�default�words) �Text�Comment�Operator�Keyword�Name�String�Number�Punctuation�Error�Generic�Inform6Lexer�Inform6TemplateLexer�Inform7Lexer� Tads3Lexerc O @ st e Zd ZdZdZddgZdgZejej B ej B ZdZdZ dZd Zd Zdeef ejdfed�gd efde ejfged�dedfdedfdefe�de�ged�dedfdeef e�dffde efde edfged�de�dgfdedfde�dhfd e efd!e efd"edfd#e edfd$ejdfd%efd&ejd'fd(efed�g de�difd*efd+e edfd%ejfd,ed-fed�gded.fd/edfed�gd0edfed�gd"edfed�gd1ejdfed2�ged�d3eef e j!dfd4eef e"e j!e j#e j!�dfd5eef e"e j!e j#e j!�dfd6e e j�djfd6e e j$�dkfd9e e f e%j&dfd:e%j'dfd;e%j(dfd<e%j)dfd=e e"ee�dfd>e e"eej*j+�dfd?e�dlfdAe e"eej,�dfdBej-�dmfe.�dndPdQ�ej-dfdRej-dfe.�dod�dPd��ej-dfe.�dpd�dPd��ej-dfeedfgd�e j#fd�e e jfd�e jfd�e j#fd�e j#fd6e e jdfgd�e j#fd�e e j$fd�e j$fd�e j#fd�eef e j#fd�eeef e j#fd�eef e j#fd6e e j$dfgd�e e j$fd�e j$fd�e j#fd6e e j$dfged�eej/dfed�ged�eej*j+dfed�ged�eejdfed�ged�eej*dfed�gd�e j0dfged�eej-dfged�dBefd,edfde�dqfe.�drd�dPd��ed�fd�e�dsfd�e�dtfd�e�dufd�e�dvfd�e"ee�fd�ed�fd�e�dwfd�ed�fd�e�dxfd�e�dyfd�e�dzfd�e�d{fd�e�d|fd�e�d}fd�e�d~fd�e�dfd�e�d�fd�e�d�feej1�d�fged�eej,dfed�ged�d,edfd�efd�e j$d�feej*fged�d,efd�edfd/efe�d��ged�d�e�d�fed�ged�d�edfeej1dfged�de�d�fed�gd+e efd�ejdfedged�d,ed.fd"efd�ejd�fd�ejfd/efe�d��ged�d�edfeej1fed�ged��de�d�fd�e�d�fe�d�ged�d,edf�defd+e edf�de�dfe�d�ged��ded�fed�ged�d,edfd"ef�ded�fedged�d6e e j$�d�fe�d��ged�d6e e j$�d�fgd�e j#fed��ged�e.�d�dPdQ�edf�d,e edfge�d-�ed�ge�d-�ed�ged��d.efed�ged�e.�d�dPdQ�edfed�ged�d�edf�d9efe.�d�dPdQ�ed�f�dHef�dIe�d�f�dKe�d�f�dNe�d�f�dOe�d�f�dPe�d�f�dSe e�dTf�dUejd'f�dVe�dWf�dXedfded�f�dYe�d�fe�d��ged��dZedf�d[e ejdf�d\eef ej,dfed�ged�dedfed�ged�d,e�d�fe�d��ged�d,edfd/efe�d��ged�de�d�fed�ged�d6e e j$�d�fee�d_fgd/efe�d��g�da�2Z2�db�dc� Z3�ddS (� r z^ For `Inform 6 <http://inform-fiction.org/>`_ source code. .. versionadded:: 2.0 zInform 6Zinform6Zi6z*.infz[a-zA-Z_]\w*u \-‐-—u "“”u '‘’u \n z\A(!%%[^%s]*[%s])+� directivez\s+z![^%s]*�_whitespacez\[zmany-valuesz:|(?=;)�#pop�<� expression�_expressionz(?=sp\b)z(?=[%s%s$0-9#a-zA-Z_])�valuez\+\+|[%s]{1,2}(?!>)|~~?z(?=[()\[%s,?@{:;])z\(z\)� statements�localsz>(?=(\s+|(![^%s]*))*[>;])z\+\+|[%s]{2}(?!>)�,z6&&?|\|\|?|[=~><]?=|[%s]{1,2}>?|\.\.?[&#]?|::|[<>+*/%%]z*(has|hasnt|in|notin|ofclass|or|provides)\bzsp\bz\?~?�label?z[@{]�#pushz[\[\]]z[%s]>�;z#pop:3z#pop:2�:z(from|near|to)\bzhas\b�_list-expressionz[%s][^@][%s]z#([%s])(@\{[0-9a-fA-F]{1,4}\})([%s])z([%s])(@.{2})([%s])z[%s]�dictionary-word�stringz)\$[+%s][0-9]*\.?[0-9]*([eE][+%s]?[0-9]+)?z\$[0-9a-fA-F]+z \$\$[01]+z[0-9]+z (##|#a\$)(%s)z (#g\$)(%s)z#[nw]\$�obsolete-dictionary-wordz (#r\$)(%s)�#�system-constant�child�children�elder�eldest�glk�indirect� metaclass�parent�random�sibling�younger�youngestz\b)�suffixz#(?i)(Class|Object|Routine|String)\b�Box__Routine�CA__Pr�CDefArt� CInDefArt�Cl__Ms�Copy__Primitive�CP__Tab�DA__Pr�DB__Pr�DefArt� Dynam__String� EnglishNumber� Glk__Wrap�IA__Pr�IB__Pr�InDefArt�Main__�Meta__class�OB__Move� OB__Remove�OC__Cl�OP__Pr�Print__Addr�Print__PName�PrintShortName�RA__Pr�RA__Sc�RL__Pr� R_Process�RT__ChG�RT__ChGt� RT__ChLDB� RT__ChLDW�RT__ChPR�RT__ChPrintA�RT__ChPrintC�RT__ChPrintO�RT__ChPrintS�RT__ChPS�RT__ChR� RT__ChSTB� RT__ChSTW�RT__ChT�RT__Err�RT__TrPS�RV__Pr� Symb__Tab�Unsigned__Compare�WV__Pr� Z__Regionz(?i))�prefixr7 �call�copy�create�DEBUG�destroy�DICT_CHAR_SIZE�DICT_ENTRY_BYTES�DICT_IS_UNICODE�DICT_WORD_SIZE�false�FLOAT_INFINITY� FLOAT_NAN�FLOAT_NINFINITY�GOBJFIELD_CHAIN�GOBJFIELD_CHILD�GOBJFIELD_NAME�GOBJFIELD_PARENT�GOBJFIELD_PROPTAB�GOBJFIELD_SIBLING�GOBJ_EXT_START�GOBJ_TOTAL_LENGTH�Grammar__Version�INDIV_PROP_START�INFIX�infix__watching�MODULE_MODE�name�nothing�NUM_ATTR_BYTES�print�print_to_array�recreate� remaining�self�sender�STRICT_MODE�sw__var� sys__glob0� sys__glob1� sys__glob2�sys_statusline_flag�TARGET_GLULX�TARGET_ZCODE� temp__global2� temp__global3� temp__global4�temp_global�true�USE_MODULES�WORDSIZEz[~^]+z [^~^\\@({%s]+z[({]z@\{[0-9a-fA-F]{,4}\}z@.{2}z\\z(@(\\\s*[%s]\s*)*@((\\\s*[%s]\s*)*[0-9])*zC@(\\\s*[%s]\s*)*\{((\\\s*[%s]\s*)*[0-9a-fA-F]){,4}(\\\s*[%s]\s*)*\}z!@(\\\s*[%s]\s*)*.(\\\s*[%s]\s*)*.z[^~^\\({\[\]%s]+z [~^({\[\]]z\S\w*r � routine-name?� abbreviate�endif� dictionary�ifdef�iffalse�ifndef�ifnot�iftrue�ifv3�ifv5�release�serial�switches�system_file�versionz(?i)(array|global)\b�directive-keyword?�_globalz(?i)attribute\b�alias?� _constantz(?i)class\b�object-body� duplicates� class-namez(?i)(constant|default)\bz(?i)(end\b)(.*)z(?i)(extend|verb)\b�grammarz(?i)fake_action\bz(?i)import\b�manifestz(?i)(include|link)\b�before-plain-stringz(?i)(lowstring|undef)\bz (?i)message\b� diagnosticz(?i)(nearby|object)\b�_object-headz(?i)property\b�property-keyword*z (?i)replace\bz(?i)statusline\bz (?i)stub\bz(?i)trace\b�trace-keyword?z(?i)zcharacter\bz\*�"�plain-stringz\]zalias\bz#(?=[,;]|(class|has|private|with)\b)z(class|has|private|with)\bzclass\bz class-segmentz(has|private|with)\b�_object-expression�=�grammar-linez_directive-keywordz[/*]z(noun|scope)\bz=routinez(?i)global\b�message-string�additive�alias�buffer�class�creature�data�error� fatalerror�first�has�held�initial�initstr�last�long�meta�multi�multiexcept� multiheld�multiinside�noun�number�only�private�replace�reverse�scope�score�special�table�terminating�time�topic�warning�withz[%s]{1,2}>|[+=]z_directive-keyword!z(additive|long)\b�assembly�expressions�lines�linker�objects�off�on�symbols�tokens�verbsz[;{}]�box�break�continue�give� inversion�new_line�quit�read�remove�return�rfalse�rtrue�spaces�untilz(do|else)\bz(font|style)\b�miscellaneous-keyword?zfor\b�for�(?z(if|switch|while)z(jump|save|restore)\bzobjectloop\b�_keyword-expression� variable?zprint(_ret)?\b|(?=[%s])z print-listz\.�@�opcodez#(?![agrnw]\$|#)zmove\bz:(bold|fixed|from|near|off|on|reverse|roman|to|underline)\bzX(a|A|an|address|char|name|number|object|property|string|the|The)\b(?=(\s+|(![^%s]*))*\))z%s(?=(\s+|(![^%s]*))*\))�_for-expression�form�operands�_assembly-expression)2�rootr r r r z_assembly-expressionz_for-expressionz_keyword-expressionz_list-expressionz_object-expressionr zdictionary-wordr'