Server IP : 85.214.239.14 / Your IP : 3.145.80.247 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/self/root/lib/python3/dist-packages/pygments/lexers/ |
Upload File : |
""" pygments.lexers.ambient ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for AmbientTalk language. :copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, words, bygroups from pygments.token import Comment, Operator, Keyword, Name, String, \ Number, Punctuation, Whitespace __all__ = ['AmbientTalkLexer'] class AmbientTalkLexer(RegexLexer): """ Lexer for AmbientTalk source code. .. versionadded:: 2.0 """ name = 'AmbientTalk' url = 'https://code.google.com/p/ambienttalk' filenames = ['*.at'] aliases = ['ambienttalk', 'ambienttalk/2', 'at'] mimetypes = ['text/x-ambienttalk'] flags = re.MULTILINE | re.DOTALL builtin = words(('if:', 'then:', 'else:', 'when:', 'whenever:', 'discovered:', 'disconnected:', 'reconnected:', 'takenOffline:', 'becomes:', 'export:', 'as:', 'object:', 'actor:', 'mirror:', 'taggedAs:', 'mirroredBy:', 'is:')) tokens = { 'root': [ (r'\s+', Whitespace), (r'//.*?\n', Comment.Single), (r'/\*.*?\*/', Comment.Multiline), (r'(def|deftype|import|alias|exclude)\b', Keyword), (builtin, Name.Builtin), (r'(true|false|nil)\b', Keyword.Constant), (r'(~|lobby|jlobby|/)\.', Keyword.Constant, 'namespace'), (r'"(\\\\|\\[^\\]|[^"\\])*"', String), (r'\|', Punctuation, 'arglist'), (r'<:|[*^!%&<>+=,./?-]|:=', Operator), (r"`[a-zA-Z_]\w*", String.Symbol), (r"[a-zA-Z_]\w*:", Name.Function), (r"[{}()\[\];`]", Punctuation), (r'(self|super)\b', Name.Variable.Instance), (r"[a-zA-Z_]\w*", Name.Variable), (r"@[a-zA-Z_]\w*", Name.Class), (r"@\[", Name.Class, 'annotations'), include('numbers'), ], 'numbers': [ (r'(\d+\.\d*|\d*\.\d+)([eE][+-]?[0-9]+)?', Number.Float), (r'\d+', Number.Integer) ], 'namespace': [ (r'[a-zA-Z_]\w*\.', Name.Namespace), (r'[a-zA-Z_]\w*:', Name.Function, '#pop'), (r'[a-zA-Z_]\w*(?!\.)', Name.Function, '#pop') ], 'annotations': [ (r"(.*?)\]", Name.Class, '#pop') ], 'arglist': [ (r'\|', Punctuation, '#pop'), (r'(\s*)(,)(\s*)', bygroups(Whitespace, Punctuation, Whitespace)), (r'[a-zA-Z_]\w*', Name.Variable), ], }