Server IP : 127.0.0.2 / Your IP : 18.217.0.242 Web Server : Apache/2.4.18 (Ubuntu) System : User : www-data ( ) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : disk_free_space,disk_total_space,diskfreespace,dl,exec,fpaththru,getmyuid,getmypid,highlight_file,ignore_user_abord,leak,listen,link,opcache_get_configuration,opcache_get_status,passthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,php_uname,phpinfo,posix_ctermid,posix_getcwd,posix_getegid,posix_geteuid,posix_getgid,posix_getgrgid,posix_getgrnam,posix_getgroups,posix_getlogin,posix_getpgid,posix_getpgrp,posix_getpid,posix,_getppid,posix_getpwnam,posix_getpwuid,posix_getrlimit,posix_getsid,posix_getuid,posix_isatty,posix_kill,posix_mkfifo,posix_setegid,posix_seteuid,posix_setgid,posix_setpgid,posix_setsid,posix_setuid,posix_times,posix_ttyname,posix_uname,pclose,popen,proc_open,proc_close,proc_get_status,proc_nice,proc_terminate,shell_exec,source,show_source,system,virtual MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/lib/python2.7/dist-packages/pygments/lexers/ |
Upload File : |
# -*- coding: utf-8 -*- """ pygments.lexers.j ~~~~~~~~~~~~~~~~~ Lexer for the J programming language. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, words, include from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, \ String, Text __all__ = ['JLexer'] class JLexer(RegexLexer): """ For `J <http://jsoftware.com/>`_ source code. .. versionadded:: 2.1 """ name = 'J' aliases = ['j'] filenames = ['*.ijs'] mimetypes = ['text/x-j'] validName = r'\b[a-zA-Z]\w*' tokens = { 'root': [ # Shebang script (r'#!.*$', Comment.Preproc), # Comments (r'NB\..*', Comment.Single), (r'\n+\s*Note', Comment.Multiline, 'comment'), (r'\s*Note.*', Comment.Single), # Whitespace (r'\s+', Text), # Strings (r"'", String, 'singlequote'), # Definitions (r'0\s+:\s*0|noun\s+define\s*$', Name.Entity, 'nounDefinition'), (r'\b(([1-4]|13)\s+:\s*0)|((adverb|conjunction|dyad|monad|verb)\s+define)\b', Name.Function, 'explicitDefinition'), # Flow Control (words(('for_', 'goto_', 'label_'), suffix=validName+'\.'), Name.Label), (words(( 'assert', 'break', 'case', 'catch', 'catchd', 'catcht', 'continue', 'do', 'else', 'elseif', 'end', 'fcase', 'for', 'if', 'return', 'select', 'throw', 'try', 'while', 'whilst', ), suffix='\.'), Name.Label), # Variable Names (validName, Name.Variable), # Standard Library (words(( 'ARGV', 'CR', 'CRLF', 'DEL', 'Debug', 'EAV', 'EMPTY', 'FF', 'JVERSION', 'LF', 'LF2', 'Note', 'TAB', 'alpha17', 'alpha27', 'apply', 'bind', 'boxopen', 'boxxopen', 'bx', 'clear', 'cutLF', 'cutopen', 'datatype', 'def', 'dfh', 'drop', 'each', 'echo', 'empty', 'erase', 'every', 'evtloop', 'exit', 'expand', 'fetch', 'file2url', 'fixdotdot', 'fliprgb', 'getargs', 'getenv', 'hfd', 'inv', 'inverse', 'iospath', 'isatty', 'isutf8', 'items', 'leaf', 'list', 'nameclass', 'namelist', 'namelist', 'names', 'nc', 'nl', 'on', 'pick', 'pick', 'rows', 'script', 'scriptd', 'sign', 'sminfo', 'smoutput', 'sort', 'split', 'stderr', 'stdin', 'stdout', 'table', 'take', 'timespacex', 'timex', 'tmoutput', 'toCRLF', 'toHOST', 'toJ', 'tolower', 'toupper', 'type', 'ucp', 'ucpcount', 'usleep', 'utf8', 'uucp', )), Name.Function), # Copula (r'=[.:]', Operator), # Builtins (r'[-=+*#$%@!~`^&";:.,<>{}\[\]\\|/]', Operator), # Short Keywords (r'[abCdDeEfHiIjLMoprtT]\.', Keyword.Reserved), (r'[aDiLpqsStux]\:', Keyword.Reserved), (r'(_[0-9])\:', Keyword.Constant), # Parens (r'\(', Punctuation, 'parentheses'), # Numbers include('numbers'), ], 'comment': [ (r'[^)]', Comment.Multiline), (r'^\)', Comment.Multiline, '#pop'), (r'[)]', Comment.Multiline), ], 'explicitDefinition': [ (r'\b[nmuvxy]\b', Name.Decorator), include('root'), (r'[^)]', Name), (r'^\)', Name.Label, '#pop'), (r'[)]', Name), ], 'numbers': [ (r'\b_{1,2}\b', Number), (r'_?\d+(\.\d+)?(\s*[ejr]\s*)_?\d+(\.?=\d+)?', Number), (r'_?\d+\.(?=\d+)', Number.Float), (r'_?\d+x', Number.Integer.Long), (r'_?\d+', Number.Integer), ], 'nounDefinition': [ (r'[^)]', String), (r'^\)', Name.Label, '#pop'), (r'[)]', String), ], 'parentheses': [ (r'\)', Punctuation, '#pop'), # include('nounDefinition'), include('explicitDefinition'), include('root'), ], 'singlequote': [ (r"[^']", String), (r"''", String), (r"'", String, '#pop'), ], }