# -*- coding: utf-8 -*- """ pygments.lexers.actionscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for ActionScript and MXML. :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, using, this, words, default from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ Number, Punctuation __all__ = ['ActionScriptLexer', 'ActionScript3Lexer', 'MxmlLexer'] class ActionScriptLexer(RegexLexer): """ For ActionScript source code. .. versionadded:: 0.9 """ name = 'ActionScript' aliases = ['as', 'actionscript'] filenames = ['*.as'] mimetypes = ['application/x-actionscript', 'text/x-actionscript', 'text/actionscript'] flags = re.DOTALL tokens = { 'root': [ (r'\s+', Text), (r'//.*?\n', Comment.Single), (r'/\*.*?\*/', Comment.Multiline), (r'/(\\\\|\\/|[^/\n])*/[gim]*', String.Regex), (r'[~^*!%&<>|+=:;,/?\\-]+', Operator), (r'[{}\[\]();.]+', Punctuation), (words(( 'case', 'default', 'for', 'each', 'in', 'while', 'do', 'break', 'return', 'continue', 'if', 'else', 'throw', 'try', 'catch', 'var', 'with', 'new', 'typeof', 'arguments', 'instanceof', 'this', 'switch'), suffix=r'\b'), Keyword), (words(( 'class', 'public', 'final', 'internal', 'native', 'override', 'private', 'protected', 'static', 'import', 'extends', 'implements', 'interface', 'intrinsic', 'return', 'super', 'dynamic', 'function', 'const', 'get', 'namespace', 'package', 'set'), suffix=r'\b'), Keyword.Declaration), (r'(true|false|null|NaN|Infinity|-Infinity|undefined|Void)\b', Keyword.Constant), (words(( 'Accessibility', 'AccessibilityProperties', 'ActionScriptVersion', 'ActivityEvent', 'AntiAliasType', 'ApplicationDomain', 'AsBroadcaster', 'Array', 'AsyncErrorEvent', 'AVM1Movie', 'BevelFilter', 'Bitmap', 'BitmapData', 'BitmapDataChannel', 'BitmapFilter', 'BitmapFilterQuality', 'BitmapFilterType', 'BlendMode', 'BlurFilter', 'Boolean', 'ByteArray', 'Camera', 'Capabilities', 'CapsStyle', 'Class', 'Color', 'ColorMatrixFilter', 'ColorTransform', 'ContextMenu', 'ContextMenuBuiltInItems', 'ContextMenuEvent', 'ContextMenuItem', 'ConvultionFilter', 'CSMSettings', 'DataEvent', 'Date', 'DefinitionError', 'DeleteObjectSample', 'Dictionary', 'DisplacmentMapFilter', 'DisplayObject', 'DisplacmentMapFilterMode', 'DisplayObjectContainer', 'DropShadowFilter', 'Endian', 'EOFError', 'Error', 'ErrorEvent', 'EvalError', 'Event', 'EventDispatcher', 'EventPhase', 'ExternalInterface', 'FileFilter', 'FileReference', 'FileReferenceList', 'FocusDirection', 'FocusEvent', 'Font', 'FontStyle', 'FontType', 'FrameLabel', 'FullScreenEvent', 'Function', 'GlowFilter', 'GradientBevelFilter', 'GradientGlowFilter', 'GradientType', 'Graphics', 'GridFitType', 'HTTPStatusEvent', 'IBitmapDrawable', 'ID3Info', 'IDataInput', 'IDataOutput', 'IDynamicPropertyOutput' 'IDynamicPropertyWriter', 'IEventDispatcher', 'IExternalizable', 'IllegalOperationError', 'IME', 'IMEConversionMode', 'IMEEvent', 'int', 'InteractiveObject', 'InterpolationMethod', 'InvalidSWFError', 'InvokeEvent', 'IOError', 'IOErrorEvent', 'JointStyle', 'Key', 'Keyboard', 'KeyboardEvent', 'KeyLocation', 'LineScaleMode', 'Loader', 'LoaderContext', 'LoaderInfo', 'LoadVars', 'LocalConnection', 'Locale', 'Math', 'Matrix', 'MemoryError', 'Microphone', 'MorphShape', 'Mouse', 'MouseEvent', 'MovieClip', 'MovieClipLoader', 'Namespace', 'NetConnection', 'NetStatusEvent', 'NetStream', 'NewObjectSample', 'Number', 'Object', 'ObjectEncoding', 'PixelSnapping', 'Point', 'PrintJob', 'PrintJobOptions', 'PrintJobOrientation', 'ProgressEvent', 'Proxy', 'QName', 'RangeError', 'Rectangle', 'ReferenceError', 'RegExp', 'Responder', 'Sample', 'Scene', 'ScriptTimeoutError', 'Security', 'SecurityDomain', 'SecurityError', 'SecurityErrorEvent', 'SecurityPanel', 'Selection', 'Shape', 'SharedObject', 'SharedObjectFlushStatus', 'SimpleButton', 'Socket', 'Sound', 'SoundChannel', 'SoundLoaderContext', 'SoundMixer', 'SoundTransform', 'SpreadMethod', 'Sprite', 'StackFrame', 'StackOverflowError', 'Stage', 'StageAlign', 'StageDisplayState', 'StageQuality', 'StageScaleMode', 'StaticText', 'StatusEvent', 'String', 'StyleSheet', 'SWFVersion', 'SyncEvent', 'SyntaxError', 'System', 'TextColorType', 'TextField', 'TextFieldAutoSize', 'TextFieldType', 'TextFormat', 'TextFormatAlign', 'TextLineMetrics', 'TextRenderer', 'TextSnapshot', 'Timer', 'TimerEvent', 'Transform', 'TypeError', 'uint', 'URIError', 'URLLoader', 'URLLoaderDataFormat', 'URLRequest', 'URLRequestHeader', 'URLRequestMethod', 'URLStream', 'URLVariabeles', 'VerifyError', 'Video', 'XML', 'XMLDocument', 'XMLList', 'XMLNode', 'XMLNodeType', 'XMLSocket', 'XMLUI'), suffix=r'\b'), Name.Builtin), (words(( 'decodeURI', 'decodeURIComponent', 'encodeURI', 'escape', 'eval', 'isFinite', 'isNaN', 'isXMLName', 'clearInterval', 'fscommand', 'getTimer', 'getURL', 'getVersion', 'parseFloat', 'parseInt', 'setInterval', 'trace', 'updateAfterEvent', 'unescape'), suffix=r'\b'), Name.Function), (r'[$a-zA-Z_]\w*', Name.Other), (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), (r'0x[0-9a-f]+', Number.Hex), (r'[0-9]+', Number.Integer), (r'"(\\\\|\\"|[^"])*"', String.Double), (r"'(\\\\|\\'|[^'])*'", String.Single), ] } class ActionScript3Lexer(RegexLexer): """ For ActionScript 3 source code. .. versionadded:: 0.11 """ name = 'ActionScript 3' aliases = ['as3', 'actionscript3'] filenames = ['*.as'] mimetypes = ['application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3'] identifier = r'[$a-zA-Z_]\w*' typeidentifier = identifier + '(?:\.<\w+>)?' flags = re.DOTALL | re.MULTILINE tokens = { 'root': [ (r'\s+', Text), (r'(function\s+)(' + identifier + r')(\s*)(\()', bygroups(Keyword.Declaration, Name.Function, Text, Operator), 'funcparams'), (r'(var|const)(\s+)(' + identifier + r')(\s*)(:)(\s*)(' + typeidentifier + r')', bygroups(Keyword.Declaration, Text, Name, Text, Punctuation, Text, Keyword.Type)), (r'(import|package)(\s+)((?:' + identifier + r'|\.)+)(\s*)', bygroups(Keyword, Text, Name.Namespace, Text)), (r'(new)(\s+)(' + typeidentifier + r')(\s*)(\()', bygroups(Keyword, Text, Keyword.Type, Text, Operator)), (r'//.*?\n', Comment.Single), (r'/\*.*?\*/', Comment.Multiline), (r'/(\\\\|\\/|[^\n])*/[gisx]*', String.Regex), (r'(\.)(' + identifier + r')', bygroups(Operator, Name.Attribute)), (r'(case|default|for|each|in|while|do|break|return|continue|if|else|' r'throw|try|catch|with|new|typeof|arguments|instanceof|this|' r'switch|import|include|as|is)\b', Keyword), (r'(class|public|final|internal|native|override|private|protected|' r'static|import|extends|implements|interface|intrinsic|return|super|' r'dynamic|function|const|get|namespace|package|set)\b', Keyword.Declaration), (r'(true|false|null|NaN|Infinity|-Infinity|undefined|void)\b', Keyword.Constant), (r'(decodeURI|decodeURIComponent|encodeURI|escape|eval|isFinite|isNaN|' r'isXMLName|clearInterval|fscommand|getTimer|getURL|getVersion|' r'isFinite|parseFloat|parseInt|setInterval|trace|updateAfterEvent|' r'unescape)\b', Name.Function), (identifier, Name), (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), (r'0x[0-9a-f]+', Number.Hex), (r'[0-9]+', Number.Integer), (r'"(\\\\|\\"|[^"])*"', String.Double), (r"'(\\\\|\\'|[^'])*'", String.Single), (r'[~^*!%&<>|+=:;,/?\\{}\[\]().-]+', Operator), ], 'funcparams': [ (r'\s+', Text), (r'(\s*)(\.\.\.)?(' + identifier + r')(\s*)(:)(\s*)(' + typeidentifier + r'|\*)(\s*)', bygroups(Text, Punctuation, Name, Text, Operator, Text, Keyword.Type, Text), 'defval'), (r'\)', Operator, 'type') ], 'type': [ (r'(\s*)(:)(\s*)(' + typeidentifier + r'|\*)', bygroups(Text, Operator, Text, Keyword.Type), '#pop:2'), (r'\s+', Text, '#pop:2'), default('#pop:2') ], 'defval': [ (r'(=)(\s*)([^(),]+)(\s*)(,?)', bygroups(Operator, Text, using(this), Text, Operator), '#pop'), (r',', Operator, '#pop'), default('#pop') ] } def analyse_text(text): if re.match(r'\w+\s*:\s*\w', text): return 0.3 return 0 class MxmlLexer(RegexLexer): """ For MXML markup. Nested AS3 in <script> tags is highlighted by the appropriate lexer. .. versionadded:: 1.1 """ flags = re.MULTILINE | re.DOTALL name = 'MXML' aliases = ['mxml'] filenames = ['*.mxml'] mimetimes = ['text/xml', 'application/xml'] tokens = { 'root': [ ('[^<&]+', Text), (r'&\S*?;', Name.Entity), (r'(\<\!\[CDATA\[)(.*?)(\]\]\>)', bygroups(String, using(ActionScript3Lexer), String)), ('<!--', Comment, 'comment'), (r'<\?.*?\?>', Comment.Preproc), ('<![^>]*>', Comment.Preproc), (r'<\s*[\w:.-]+', Name.Tag, 'tag'), (r'<\s*/\s*[\w:.-]+\s*>', Name.Tag), ], 'comment': [ ('[^-]+', Comment), ('-->', Comment, '#pop'), ('-', Comment), ], 'tag': [ (r'\s+', Text), (r'[\w.:-]+\s*=', Name.Attribute, 'attr'), (r'/?\s*>', Name.Tag, '#pop'), ], 'attr': [ ('\s+', Text), ('".*?"', String, '#pop'), ("'.*?'", String, '#pop'), (r'[^\s>]+', String, '#pop'), ], }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
__pycache__ | Folder | 0755 |
|
|
__init__.py | File | 10.65 KB | 0644 |
|
_asy_builtins.py | File | 26.68 KB | 0644 |
|
_cl_builtins.py | File | 13.72 KB | 0644 |
|
_cocoa_builtins.py | File | 39.04 KB | 0644 |
|
_csound_builtins.py | File | 21.14 KB | 0644 |
|
_lasso_builtins.py | File | 131.38 KB | 0644 |
|
_lua_builtins.py | File | 8.14 KB | 0644 |
|
_mapping.py | File | 53.43 KB | 0644 |
|
_mql_builtins.py | File | 24.16 KB | 0644 |
|
_openedge_builtins.py | File | 47.23 KB | 0644 |
|
_php_builtins.py | File | 150.75 KB | 0644 |
|
_postgres_builtins.py | File | 10.95 KB | 0644 |
|
_scilab_builtins.py | File | 51.18 KB | 0644 |
|
_sourcemod_builtins.py | File | 26.48 KB | 0644 |
|
_stan_builtins.py | File | 9.88 KB | 0644 |
|
_stata_builtins.py | File | 24.55 KB | 0644 |
|
_tsql_builtins.py | File | 15.12 KB | 0644 |
|
_vim_builtins.py | File | 55.75 KB | 0644 |
|
actionscript.py | File | 10.92 KB | 0644 |
|
agile.py | File | 900 B | 0644 |
|
algebra.py | File | 7.03 KB | 0644 |
|
ambient.py | File | 2.5 KB | 0644 |
|
ampl.py | File | 4.02 KB | 0644 |
|
apl.py | File | 3.09 KB | 0644 |
|
archetype.py | File | 10.87 KB | 0644 |
|
asm.py | File | 24.67 KB | 0644 |
|
automation.py | File | 19.19 KB | 0644 |
|
basic.py | File | 19.83 KB | 0644 |
|
bibtex.py | File | 4.61 KB | 0644 |
|
business.py | File | 27.02 KB | 0644 |
|
c_cpp.py | File | 10.28 KB | 0644 |
|
c_like.py | File | 23.56 KB | 0644 |
|
capnproto.py | File | 2.14 KB | 0644 |
|
chapel.py | File | 3.43 KB | 0644 |
|
clean.py | File | 10.16 KB | 0644 |
|
compiled.py | File | 1.35 KB | 0644 |
|
configs.py | File | 27.6 KB | 0644 |
|
console.py | File | 4.02 KB | 0644 |
|
crystal.py | File | 16.45 KB | 0644 |
|
csound.py | File | 12.25 KB | 0644 |
|
css.py | File | 30.77 KB | 0644 |
|
d.py | File | 9.31 KB | 0644 |
|
dalvik.py | File | 4.32 KB | 0644 |
|
data.py | File | 18.33 KB | 0644 |
|
diff.py | File | 4.76 KB | 0644 |
|
dotnet.py | File | 27.02 KB | 0644 |
|
dsls.py | File | 32.55 KB | 0644 |
|
dylan.py | File | 10.18 KB | 0644 |
|
ecl.py | File | 5.74 KB | 0644 |
|
eiffel.py | File | 2.42 KB | 0644 |
|
elm.py | File | 2.93 KB | 0644 |
|
erlang.py | File | 18.49 KB | 0644 |
|
esoteric.py | File | 9.27 KB | 0644 |
|
ezhil.py | File | 2.95 KB | 0644 |
|
factor.py | File | 17.44 KB | 0644 |
|
fantom.py | File | 9.75 KB | 0644 |
|
felix.py | File | 9.19 KB | 0644 |
|
forth.py | File | 6.98 KB | 0644 |
|
fortran.py | File | 9.54 KB | 0644 |
|
foxpro.py | File | 25.62 KB | 0644 |
|
functional.py | File | 698 B | 0644 |
|
go.py | File | 3.61 KB | 0644 |
|
grammar_notation.py | File | 6.18 KB | 0644 |
|
graph.py | File | 2.31 KB | 0644 |
|
graphics.py | File | 25.23 KB | 0644 |
|
haskell.py | File | 30.49 KB | 0644 |
|
haxe.py | File | 30.23 KB | 0644 |
|
hdl.py | File | 18.26 KB | 0644 |
|
hexdump.py | File | 3.42 KB | 0644 |
|
html.py | File | 18.82 KB | 0644 |
|
idl.py | File | 14.63 KB | 0644 |
|
igor.py | File | 19.53 KB | 0644 |
|
inferno.py | File | 3.04 KB | 0644 |
|
installers.py | File | 12.56 KB | 0644 |
|
int_fiction.py | File | 54.47 KB | 0644 |
|
iolang.py | File | 1.86 KB | 0644 |
|
j.py | File | 4.42 KB | 0644 |
|
javascript.py | File | 58.72 KB | 0644 |
|
julia.py | File | 13.76 KB | 0644 |
|
jvm.py | File | 65.18 KB | 0644 |
|
lisp.py | File | 137.38 KB | 0644 |
|
make.py | File | 7.16 KB | 0644 |
|
markup.py | File | 19.97 KB | 0644 |
|
math.py | File | 700 B | 0644 |
|
matlab.py | File | 28.47 KB | 0644 |
|
ml.py | File | 27.23 KB | 0644 |
|
modeling.py | File | 12.53 KB | 0644 |
|
modula2.py | File | 51.33 KB | 0644 |
|
monte.py | File | 6.16 KB | 0644 |
|
ncl.py | File | 62.49 KB | 0644 |
|
nimrod.py | File | 5.05 KB | 0644 |
|
nit.py | File | 2.68 KB | 0644 |
|
nix.py | File | 3.94 KB | 0644 |
|
oberon.py | File | 3.65 KB | 0644 |
|
objective.py | File | 22.22 KB | 0644 |
|
ooc.py | File | 2.93 KB | 0644 |
|
other.py | File | 1.73 KB | 0644 |
|
parasail.py | File | 2.67 KB | 0644 |
|
parsers.py | File | 26.94 KB | 0644 |
|
pascal.py | File | 31.88 KB | 0644 |
|
pawn.py | File | 7.9 KB | 0644 |
|
perl.py | File | 31.26 KB | 0644 |
|
php.py | File | 10.48 KB | 0644 |
|
praat.py | File | 12.26 KB | 0644 |
|
prolog.py | File | 11.78 KB | 0644 |
|
python.py | File | 41.39 KB | 0644 |
|
qvt.py | File | 5.97 KB | 0644 |
|
r.py | File | 23.2 KB | 0644 |
|
rdf.py | File | 9.18 KB | 0644 |
|
rebol.py | File | 18.18 KB | 0644 |
|
resource.py | File | 2.86 KB | 0644 |
|
rnc.py | File | 1.94 KB | 0644 |
|
roboconf.py | File | 2.02 KB | 0644 |
|
robotframework.py | File | 18.3 KB | 0644 |
|
ruby.py | File | 21.62 KB | 0644 |
|
rust.py | File | 7.51 KB | 0644 |
|
sas.py | File | 9.23 KB | 0644 |
|
scripting.py | File | 66.17 KB | 0644 |
|
shell.py | File | 30.69 KB | 0644 |
|
smalltalk.py | File | 7.05 KB | 0644 |
|
smv.py | File | 2.74 KB | 0644 |
|
snobol.py | File | 2.69 KB | 0644 |
|
special.py | File | 3.08 KB | 0644 |
|
sql.py | File | 28.75 KB | 0644 |
|
stata.py | File | 3.54 KB | 0644 |
|
supercollider.py | File | 3.43 KB | 0644 |
|
tcl.py | File | 5.27 KB | 0644 |
|
templates.py | File | 71.73 KB | 0644 |
|
testing.py | File | 10.5 KB | 0644 |
|
text.py | File | 977 B | 0644 |
|
textedit.py | File | 5.92 KB | 0644 |
|
textfmts.py | File | 10.6 KB | 0644 |
|
theorem.py | File | 18.59 KB | 0644 |
|
trafficscript.py | File | 1.51 KB | 0644 |
|
typoscript.py | File | 8.2 KB | 0644 |
|
urbi.py | File | 5.62 KB | 0644 |
|
varnish.py | File | 7.1 KB | 0644 |
|
verification.py | File | 3.62 KB | 0644 |
|
web.py | File | 918 B | 0644 |
|
webmisc.py | File | 38.96 KB | 0644 |
|
whiley.py | File | 3.92 KB | 0644 |
|
x10.py | File | 1.92 KB | 0644 |
|