home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 January / maximum-cd-2011-01.iso / DiscContents / calibre-0.7.26.msi / file_2367 (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-10-31  |  16.7 KB  |  799 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. import re
  5. from pygments.lexer import Lexer, RegexLexer, bygroups, include, do_insertions
  6. from pygments.token import Comment, String, Punctuation, Keyword, Name, Operator, Number, Text, Generic
  7. from pygments.lexers.agile import PythonLexer
  8. __all__ = [
  9.     'MuPADLexer',
  10.     'MatlabLexer',
  11.     'MatlabSessionLexer',
  12.     'NumPyLexer',
  13.     'RConsoleLexer',
  14.     'SLexer']
  15.  
  16. class MuPADLexer(RegexLexer):
  17.     name = 'MuPAD'
  18.     aliases = [
  19.         'mupad']
  20.     filenames = [
  21.         '*.mu']
  22.     tokens = {
  23.         'root': [
  24.             ('//.*?$', Comment.Single),
  25.             ('/\\*', Comment.Multiline, 'comment'),
  26.             ('"(?:[^"\\\\]|\\\\.)*"', String),
  27.             ('\\(|\\)|\\[|\\]|\\{|\\}', Punctuation),
  28.             ('(?x)\\b(?:\n            next|break|end|\n            axiom|end_axiom|category|end_category|domain|end_domain|inherits|\n            if|%if|then|elif|else|end_if|\n            case|of|do|otherwise|end_case|\n            while|end_while|\n            repeat|until|end_repeat|\n            for|from|to|downto|step|end_for|\n            proc|local|option|save|begin|end_proc|\n            delete|frame\n          )\\b', Keyword),
  29.             ('(?x)\\b(?:\n            DOM_ARRAY|DOM_BOOL|DOM_COMPLEX|DOM_DOMAIN|DOM_EXEC|DOM_EXPR|\n            DOM_FAIL|DOM_FLOAT|DOM_FRAME|DOM_FUNC_ENV|DOM_HFARRAY|DOM_IDENT|\n            DOM_INT|DOM_INTERVAL|DOM_LIST|DOM_NIL|DOM_NULL|DOM_POLY|DOM_PROC|\n            DOM_PROC_ENV|DOM_RAT|DOM_SET|DOM_STRING|DOM_TABLE|DOM_VAR\n          )\\b', Name.Class),
  30.             ('(?x)\\b(?:\n            PI|EULER|E|CATALAN|\n            NIL|FAIL|undefined|infinity|\n            TRUE|FALSE|UNKNOWN\n          )\\b', Name.Constant),
  31.             ('\\b(?:dom|procname)\\b', Name.Builtin.Pseudo),
  32.             ("\\.|,|:|;|=|\\+|-|\\*|/|\\^|@|>|<|\\$|\\||!|\\'|%|~=", Operator),
  33.             ('(?x)\\b(?:\n            and|or|not|xor|\n            assuming|\n            div|mod|\n            union|minus|intersect|in|subset\n          )\\b', Operator.Word),
  34.             ('\\b(?:I|RDN_INF|RD_NINF|RD_NAN)\\b', Number),
  35.             ('(?x)\n          ((?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)\n          (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*)\\s*([(])', bygroups(Name.Function, Punctuation)),
  36.             ('(?x)\n          (?:[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)\n          (?:::[a-zA-Z_#][a-zA-Z_#0-9]*|`[^`]*`)*', Name.Variable),
  37.             ('[0-9]+(?:\\.[0-9]*)?(?:e[0-9]+)?', Number),
  38.             ('\\.[0-9]+(?:e[0-9]+)?', Number),
  39.             ('.', Text)],
  40.         'comment': [
  41.             ('[^*/]', Comment.Multiline),
  42.             ('/\\*', Comment.Multiline, '#push'),
  43.             ('\\*/', Comment.Multiline, '#pop'),
  44.             ('[*/]', Comment.Multiline)] }
  45.  
  46.  
  47. class MatlabLexer(RegexLexer):
  48.     name = 'Matlab'
  49.     aliases = [
  50.         'matlab',
  51.         'octave']
  52.     filenames = [
  53.         '*.m']
  54.     mimetypes = [
  55.         'text/matlab']
  56.     elfun = [
  57.         'sin',
  58.         'sind',
  59.         'sinh',
  60.         'asin',
  61.         'asind',
  62.         'asinh',
  63.         'cos',
  64.         'cosd',
  65.         'cosh',
  66.         'acos',
  67.         'acosd',
  68.         'acosh',
  69.         'tan',
  70.         'tand',
  71.         'tanh',
  72.         'atan',
  73.         'atand',
  74.         'atan2',
  75.         'atanh',
  76.         'sec',
  77.         'secd',
  78.         'sech',
  79.         'asec',
  80.         'asecd',
  81.         'asech',
  82.         'csc',
  83.         'cscd',
  84.         'csch',
  85.         'acsc',
  86.         'acscd',
  87.         'acsch',
  88.         'cot',
  89.         'cotd',
  90.         'coth',
  91.         'acot',
  92.         'acotd',
  93.         'acoth',
  94.         'hypot',
  95.         'exp',
  96.         'expm1',
  97.         'log',
  98.         'log1p',
  99.         'log10',
  100.         'log2',
  101.         'pow2',
  102.         'realpow',
  103.         'reallog',
  104.         'realsqrt',
  105.         'sqrt',
  106.         'nthroot',
  107.         'nextpow2',
  108.         'abs',
  109.         'angle',
  110.         'complex',
  111.         'conj',
  112.         'imag',
  113.         'real',
  114.         'unwrap',
  115.         'isreal',
  116.         'cplxpair',
  117.         'fix',
  118.         'floor',
  119.         'ceil',
  120.         'round',
  121.         'mod',
  122.         'rem',
  123.         'sign']
  124.     specfun = [
  125.         'airy',
  126.         'besselj',
  127.         'bessely',
  128.         'besselh',
  129.         'besseli',
  130.         'besselk',
  131.         'beta',
  132.         'betainc',
  133.         'betaln',
  134.         'ellipj',
  135.         'ellipke',
  136.         'erf',
  137.         'erfc',
  138.         'erfcx',
  139.         'erfinv',
  140.         'expint',
  141.         'gamma',
  142.         'gammainc',
  143.         'gammaln',
  144.         'psi',
  145.         'legendre',
  146.         'cross',
  147.         'dot',
  148.         'factor',
  149.         'isprime',
  150.         'primes',
  151.         'gcd',
  152.         'lcm',
  153.         'rat',
  154.         'rats',
  155.         'perms',
  156.         'nchoosek',
  157.         'factorial',
  158.         'cart2sph',
  159.         'cart2pol',
  160.         'pol2cart',
  161.         'sph2cart',
  162.         'hsv2rgb',
  163.         'rgb2hsv']
  164.     elmat = [
  165.         'zeros',
  166.         'ones',
  167.         'eye',
  168.         'repmat',
  169.         'rand',
  170.         'randn',
  171.         'linspace',
  172.         'logspace',
  173.         'freqspace',
  174.         'meshgrid',
  175.         'accumarray',
  176.         'size',
  177.         'length',
  178.         'ndims',
  179.         'numel',
  180.         'disp',
  181.         'isempty',
  182.         'isequal',
  183.         'isequalwithequalnans',
  184.         'cat',
  185.         'reshape',
  186.         'diag',
  187.         'blkdiag',
  188.         'tril',
  189.         'triu',
  190.         'fliplr',
  191.         'flipud',
  192.         'flipdim',
  193.         'rot90',
  194.         'find',
  195.         'end',
  196.         'sub2ind',
  197.         'ind2sub',
  198.         'bsxfun',
  199.         'ndgrid',
  200.         'permute',
  201.         'ipermute',
  202.         'shiftdim',
  203.         'circshift',
  204.         'squeeze',
  205.         'isscalar',
  206.         'isvector',
  207.         'ans',
  208.         'eps',
  209.         'realmax',
  210.         'realmin',
  211.         'pi',
  212.         'i',
  213.         'inf',
  214.         'nan',
  215.         'isnan',
  216.         'isinf',
  217.         'isfinite',
  218.         'j',
  219.         'why',
  220.         'compan',
  221.         'gallery',
  222.         'hadamard',
  223.         'hankel',
  224.         'hilb',
  225.         'invhilb',
  226.         'magic',
  227.         'pascal',
  228.         'rosser',
  229.         'toeplitz',
  230.         'vander',
  231.         'wilkinson']
  232.     tokens = {
  233.         'root': [
  234.             ('^!.*', String.Other),
  235.             ('%.*$', Comment),
  236.             ('^\\s*function', Keyword, 'deffunc'),
  237.             ('(break|case|catch|classdef|continue|else|elseif|end|for|function|global|if|otherwise|parfor|persistent|return|switch|try|while)\\b', Keyword),
  238.             ('(' + '|'.join(elfun + specfun + elmat) + ')\\b', Name.Builtin),
  239.             ('-|==|~=|<|>|<=|>=|&&|&|~|\\|\\|?', Operator),
  240.             ('\\.\\*|\\*|\\+|\\.\\^|\\.\\\\|\\.\\/|\\/|\\\\', Operator),
  241.             ('\\[|\\]|\\(|\\)|\\{|\\}|:|@|\\.|,', Punctuation),
  242.             ('=|:|;', Punctuation),
  243.             ("(?<=[\\w\\)\\]])\\'", Operator),
  244.             ("(?<![\\w\\)\\]])\\'", String, 'string'),
  245.             ('[a-zA-Z_][a-zA-Z0-9_]*', Name),
  246.             ('.', Text)],
  247.         'string': [
  248.             ("[^\\']*\\'", String, '#pop')],
  249.         'deffunc': [
  250.             ('(\\s*)(?:(.+)(\\s*)(=)(\\s*))?(.+)(\\()(.*)(\\))(\\s*)', bygroups(Text.Whitespace, Text, Text.Whitespace, Punctuation, Text.Whitespace, Name.Function, Punctuation, Text, Punctuation, Text.Whitespace), '#pop')] }
  251.     
  252.     def analyse_text(text):
  253.         if re.match('^\\s*%', text, re.M):
  254.             return 0.9
  255.         if re.match('^!\\w+', text, re.M):
  256.             return 0.9
  257.         return 0.1
  258.  
  259.  
  260. line_re = re.compile('.*?\n')
  261.  
  262. class MatlabSessionLexer(Lexer):
  263.     name = 'Matlab session'
  264.     aliases = [
  265.         'matlabsession']
  266.     
  267.     def get_tokens_unprocessed(self, text):
  268.         mlexer = MatlabLexer(**self.options)
  269.         curcode = ''
  270.         insertions = []
  271.         for match in line_re.finditer(text):
  272.             line = match.group()
  273.             if line.startswith('>>'):
  274.                 insertions.append((len(curcode), [
  275.                     (0, Generic.Prompt, line[:3])]))
  276.                 curcode += line[3:]
  277.                 continue
  278.             if line.startswith('???'):
  279.                 idx = len(curcode)
  280.                 line = '\n' + line
  281.                 token = (0, Generic.Traceback, line)
  282.                 insertions.append((idx, [
  283.                     token]))
  284.                 continue
  285.             if curcode:
  286.                 for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
  287.                     yield item
  288.                 
  289.                 curcode = ''
  290.                 insertions = []
  291.             
  292.             yield (match.start(), Generic.Output, line)
  293.         
  294.         if curcode:
  295.             for item in do_insertions(insertions, mlexer.get_tokens_unprocessed(curcode)):
  296.                 yield item
  297.             
  298.         
  299.  
  300.  
  301.  
  302. class NumPyLexer(PythonLexer):
  303.     name = 'NumPy'
  304.     aliases = [
  305.         'numpy']
  306.     mimetypes = []
  307.     filenames = []
  308.     EXTRA_KEYWORDS = set([
  309.         'abs',
  310.         'absolute',
  311.         'accumulate',
  312.         'add',
  313.         'alen',
  314.         'all',
  315.         'allclose',
  316.         'alltrue',
  317.         'alterdot',
  318.         'amax',
  319.         'amin',
  320.         'angle',
  321.         'any',
  322.         'append',
  323.         'apply_along_axis',
  324.         'apply_over_axes',
  325.         'arange',
  326.         'arccos',
  327.         'arccosh',
  328.         'arcsin',
  329.         'arcsinh',
  330.         'arctan',
  331.         'arctan2',
  332.         'arctanh',
  333.         'argmax',
  334.         'argmin',
  335.         'argsort',
  336.         'argwhere',
  337.         'around',
  338.         'array',
  339.         'array2string',
  340.         'array_equal',
  341.         'array_equiv',
  342.         'array_repr',
  343.         'array_split',
  344.         'array_str',
  345.         'arrayrange',
  346.         'asanyarray',
  347.         'asarray',
  348.         'asarray_chkfinite',
  349.         'ascontiguousarray',
  350.         'asfarray',
  351.         'asfortranarray',
  352.         'asmatrix',
  353.         'asscalar',
  354.         'astype',
  355.         'atleast_1d',
  356.         'atleast_2d',
  357.         'atleast_3d',
  358.         'average',
  359.         'bartlett',
  360.         'base_repr',
  361.         'beta',
  362.         'binary_repr',
  363.         'bincount',
  364.         'binomial',
  365.         'bitwise_and',
  366.         'bitwise_not',
  367.         'bitwise_or',
  368.         'bitwise_xor',
  369.         'blackman',
  370.         'bmat',
  371.         'broadcast',
  372.         'byte_bounds',
  373.         'bytes',
  374.         'byteswap',
  375.         'c_',
  376.         'can_cast',
  377.         'ceil',
  378.         'choose',
  379.         'clip',
  380.         'column_stack',
  381.         'common_type',
  382.         'compare_chararrays',
  383.         'compress',
  384.         'concatenate',
  385.         'conj',
  386.         'conjugate',
  387.         'convolve',
  388.         'copy',
  389.         'corrcoef',
  390.         'correlate',
  391.         'cos',
  392.         'cosh',
  393.         'cov',
  394.         'cross',
  395.         'cumprod',
  396.         'cumproduct',
  397.         'cumsum',
  398.         'delete',
  399.         'deprecate',
  400.         'diag',
  401.         'diagflat',
  402.         'diagonal',
  403.         'diff',
  404.         'digitize',
  405.         'disp',
  406.         'divide',
  407.         'dot',
  408.         'dsplit',
  409.         'dstack',
  410.         'dtype',
  411.         'dump',
  412.         'dumps',
  413.         'ediff1d',
  414.         'empty',
  415.         'empty_like',
  416.         'equal',
  417.         'exp',
  418.         'expand_dims',
  419.         'expm1',
  420.         'extract',
  421.         'eye',
  422.         'fabs',
  423.         'fastCopyAndTranspose',
  424.         'fft',
  425.         'fftfreq',
  426.         'fftshift',
  427.         'fill',
  428.         'finfo',
  429.         'fix',
  430.         'flat',
  431.         'flatnonzero',
  432.         'flatten',
  433.         'fliplr',
  434.         'flipud',
  435.         'floor',
  436.         'floor_divide',
  437.         'fmod',
  438.         'frexp',
  439.         'fromarrays',
  440.         'frombuffer',
  441.         'fromfile',
  442.         'fromfunction',
  443.         'fromiter',
  444.         'frompyfunc',
  445.         'fromstring',
  446.         'generic',
  447.         'get_array_wrap',
  448.         'get_include',
  449.         'get_numarray_include',
  450.         'get_numpy_include',
  451.         'get_printoptions',
  452.         'getbuffer',
  453.         'getbufsize',
  454.         'geterr',
  455.         'geterrcall',
  456.         'geterrobj',
  457.         'getfield',
  458.         'gradient',
  459.         'greater',
  460.         'greater_equal',
  461.         'gumbel',
  462.         'hamming',
  463.         'hanning',
  464.         'histogram',
  465.         'histogram2d',
  466.         'histogramdd',
  467.         'hsplit',
  468.         'hstack',
  469.         'hypot',
  470.         'i0',
  471.         'identity',
  472.         'ifft',
  473.         'imag',
  474.         'index_exp',
  475.         'indices',
  476.         'inf',
  477.         'info',
  478.         'inner',
  479.         'insert',
  480.         'int_asbuffer',
  481.         'interp',
  482.         'intersect1d',
  483.         'intersect1d_nu',
  484.         'inv',
  485.         'invert',
  486.         'iscomplex',
  487.         'iscomplexobj',
  488.         'isfinite',
  489.         'isfortran',
  490.         'isinf',
  491.         'isnan',
  492.         'isneginf',
  493.         'isposinf',
  494.         'isreal',
  495.         'isrealobj',
  496.         'isscalar',
  497.         'issctype',
  498.         'issubclass_',
  499.         'issubdtype',
  500.         'issubsctype',
  501.         'item',
  502.         'itemset',
  503.         'iterable',
  504.         'ix_',
  505.         'kaiser',
  506.         'kron',
  507.         'ldexp',
  508.         'left_shift',
  509.         'less',
  510.         'less_equal',
  511.         'lexsort',
  512.         'linspace',
  513.         'load',
  514.         'loads',
  515.         'loadtxt',
  516.         'log',
  517.         'log10',
  518.         'log1p',
  519.         'log2',
  520.         'logical_and',
  521.         'logical_not',
  522.         'logical_or',
  523.         'logical_xor',
  524.         'logspace',
  525.         'lstsq',
  526.         'mat',
  527.         'matrix',
  528.         'max',
  529.         'maximum',
  530.         'maximum_sctype',
  531.         'may_share_memory',
  532.         'mean',
  533.         'median',
  534.         'meshgrid',
  535.         'mgrid',
  536.         'min',
  537.         'minimum',
  538.         'mintypecode',
  539.         'mod',
  540.         'modf',
  541.         'msort',
  542.         'multiply',
  543.         'nan',
  544.         'nan_to_num',
  545.         'nanargmax',
  546.         'nanargmin',
  547.         'nanmax',
  548.         'nanmin',
  549.         'nansum',
  550.         'ndenumerate',
  551.         'ndim',
  552.         'ndindex',
  553.         'negative',
  554.         'newaxis',
  555.         'newbuffer',
  556.         'newbyteorder',
  557.         'nonzero',
  558.         'not_equal',
  559.         'obj2sctype',
  560.         'ogrid',
  561.         'ones',
  562.         'ones_like',
  563.         'outer',
  564.         'permutation',
  565.         'piecewise',
  566.         'pinv',
  567.         'pkgload',
  568.         'place',
  569.         'poisson',
  570.         'poly',
  571.         'poly1d',
  572.         'polyadd',
  573.         'polyder',
  574.         'polydiv',
  575.         'polyfit',
  576.         'polyint',
  577.         'polymul',
  578.         'polysub',
  579.         'polyval',
  580.         'power',
  581.         'prod',
  582.         'product',
  583.         'ptp',
  584.         'put',
  585.         'putmask',
  586.         'r_',
  587.         'randint',
  588.         'random_integers',
  589.         'random_sample',
  590.         'ranf',
  591.         'rank',
  592.         'ravel',
  593.         'real',
  594.         'real_if_close',
  595.         'recarray',
  596.         'reciprocal',
  597.         'reduce',
  598.         'remainder',
  599.         'repeat',
  600.         'require',
  601.         'reshape',
  602.         'resize',
  603.         'restoredot',
  604.         'right_shift',
  605.         'rint',
  606.         'roll',
  607.         'rollaxis',
  608.         'roots',
  609.         'rot90',
  610.         'round',
  611.         'round_',
  612.         'row_stack',
  613.         's_',
  614.         'sample',
  615.         'savetxt',
  616.         'sctype2char',
  617.         'searchsorted',
  618.         'seed',
  619.         'select',
  620.         'set_numeric_ops',
  621.         'set_printoptions',
  622.         'set_string_function',
  623.         'setbufsize',
  624.         'setdiff1d',
  625.         'seterr',
  626.         'seterrcall',
  627.         'seterrobj',
  628.         'setfield',
  629.         'setflags',
  630.         'setmember1d',
  631.         'setxor1d',
  632.         'shape',
  633.         'show_config',
  634.         'shuffle',
  635.         'sign',
  636.         'signbit',
  637.         'sin',
  638.         'sinc',
  639.         'sinh',
  640.         'size',
  641.         'slice',
  642.         'solve',
  643.         'sometrue',
  644.         'sort',
  645.         'sort_complex',
  646.         'source',
  647.         'split',
  648.         'sqrt',
  649.         'square',
  650.         'squeeze',
  651.         'standard_normal',
  652.         'std',
  653.         'subtract',
  654.         'sum',
  655.         'svd',
  656.         'swapaxes',
  657.         'take',
  658.         'tan',
  659.         'tanh',
  660.         'tensordot',
  661.         'test',
  662.         'tile',
  663.         'tofile',
  664.         'tolist',
  665.         'tostring',
  666.         'trace',
  667.         'transpose',
  668.         'trapz',
  669.         'tri',
  670.         'tril',
  671.         'trim_zeros',
  672.         'triu',
  673.         'true_divide',
  674.         'typeDict',
  675.         'typename',
  676.         'uniform',
  677.         'union1d',
  678.         'unique',
  679.         'unique1d',
  680.         'unravel_index',
  681.         'unwrap',
  682.         'vander',
  683.         'var',
  684.         'vdot',
  685.         'vectorize',
  686.         'view',
  687.         'vonmises',
  688.         'vsplit',
  689.         'vstack',
  690.         'weibull',
  691.         'where',
  692.         'who',
  693.         'zeros',
  694.         'zeros_like'])
  695.     
  696.     def get_tokens_unprocessed(self, text):
  697.         for index, token, value in PythonLexer.get_tokens_unprocessed(self, text):
  698.             if token is Name and value in self.EXTRA_KEYWORDS:
  699.                 yield (index, Keyword.Pseudo, value)
  700.                 continue
  701.             yield (index, token, value)
  702.         
  703.  
  704.  
  705.  
  706. class RConsoleLexer(Lexer):
  707.     name = 'RConsole'
  708.     aliases = [
  709.         'rconsole',
  710.         'rout']
  711.     filenames = [
  712.         '*.Rout']
  713.     
  714.     def get_tokens_unprocessed(self, text):
  715.         slexer = SLexer(**self.options)
  716.         current_code_block = ''
  717.         insertions = []
  718.         for match in line_re.finditer(text):
  719.             line = match.group()
  720.             if line.startswith('>') or line.startswith('+'):
  721.                 insertions.append((len(current_code_block), [
  722.                     (0, Generic.Prompt, line[:2])]))
  723.                 current_code_block += line[2:]
  724.                 continue
  725.             if current_code_block:
  726.                 for item in do_insertions(insertions, slexer.get_tokens_unprocessed(current_code_block)):
  727.                     yield item
  728.                 
  729.                 current_code_block = ''
  730.                 insertions = []
  731.             
  732.             yield (match.start(), Generic.Output, line)
  733.         
  734.         if current_code_block:
  735.             for item in do_insertions(insertions, slexer.get_tokens_unprocessed(current_code_block)):
  736.                 yield item
  737.             
  738.         
  739.  
  740.  
  741.  
  742. class SLexer(RegexLexer):
  743.     name = 'S'
  744.     aliases = [
  745.         'splus',
  746.         's',
  747.         'r']
  748.     filenames = [
  749.         '*.S',
  750.         '*.R']
  751.     mimetypes = [
  752.         'text/S-plus',
  753.         'text/S',
  754.         'text/R']
  755.     tokens = {
  756.         'comments': [
  757.             ('#.*$', Comment.Single)],
  758.         'valid_name': [
  759.             ('[a-zA-Z][0-9a-zA-Z\\._]+', Text),
  760.             ('`.+`', String.Backtick)],
  761.         'punctuation': [
  762.             ('\\[|\\]|\\[\\[|\\]\\]|\\$|\\(|\\)|@|:::?|;|,', Punctuation)],
  763.         'keywords': [
  764.             ('for(?=\\s*\\()|while(?=\\s*\\()|if(?=\\s*\\()|(?<=\\s)else|(?<=\\s)break(?=;|$)|return(?=\\s*\\()|function(?=\\s*\\()', Keyword.Reserved)],
  765.         'operators': [
  766.             ('<-|-|==|<=|>=|<|>|&&|&|!=|\\|\\|?', Operator),
  767.             ('\\*|\\+|\\^|/|%%|%/%|=', Operator),
  768.             ('%in%|%*%', Operator)],
  769.         'builtin_symbols': [
  770.             ('(NULL|NA|TRUE|FALSE|NaN)\\b', Keyword.Constant),
  771.             ('(T|F)\\b', Keyword.Variable)],
  772.         'numbers': [
  773.             ('(?<![0-9a-zA-Z\\)\\}\\]`\\"])(?=\\s*)[-\\+]?[0-9]+(\\.[0-9]*)?(E[0-9][-\\+]?(\\.[0-9]*)?)?', Number),
  774.             ('\\.[0-9]*(E[0-9][-\\+]?(\\.[0-9]*)?)?', Number)],
  775.         'statements': [
  776.             include('comments'),
  777.             ('\\s+', Text),
  778.             ("\\'", String, 'string_squote'),
  779.             ('\\"', String, 'string_dquote'),
  780.             include('builtin_symbols'),
  781.             include('numbers'),
  782.             include('keywords'),
  783.             include('punctuation'),
  784.             include('operators'),
  785.             include('valid_name')],
  786.         'root': [
  787.             include('statements'),
  788.             ('\\{|\\}', Punctuation),
  789.             ('.', Text)],
  790.         'string_squote': [
  791.             ("[^\\']*\\'", String, '#pop')],
  792.         'string_dquote': [
  793.             ('[^\\"]*\\"', String, '#pop')] }
  794.     
  795.     def analyse_text(text):
  796.         return '<-' in text
  797.  
  798.  
  799.