Skip to content

Instantly share code, notes, and snippets.

@du-song
Created March 6, 2009 16:33
Show Gist options
  • Save du-song/74968 to your computer and use it in GitHub Desktop.
Save du-song/74968 to your computer and use it in GitHub Desktop.
{ scopeName = 'source.haxe';
fileTypes = ( 'hx' );
foldingStartMarker = '(/\*\*|\{\s*$)';
foldingStopMarker = '(\*\*/|^\s*\})';
patterns = (
{ name = 'support.class.haxe.flash';
match = '(flash.)?\b(Accessibility|Boot|Button|Camera|Color|ContextMenu|ContextMenuItem|ExtendedKey|Key|Lib|LoadVars|LocalConnection|Microphone|Mouse|MovieClip|MovieClipLoader|NetConnection|NetStream|PrintJob|Selection|SelectionListener|SharedObject|Sound|Stage|System|TextField|TextFormat|TextSnapshot|Video|XMLRequest|XMLSocket)\b';
},
{ name = 'support.class.haxe.flash.display';
match = '(flash.display.)?\b(BitmapData)\b';
},
{ name = 'support.class.haxe.flash.external';
match = '(flash.external.)?\b(ExternalInterface)\b';
},
{ name = 'support.class.haxe.flash.filters';
match = '\b(BevelFilter|BitmapFilter|BlurFilter|ColorMatrixFilter|ConvolutionFilter|DisplacementMapFilter|DropShadowFilter|GlowFilter|GradientBevelFilter|GradientGlowFilter)\b';
},
{ name = 'support.class.haxe.flash.geom';
match = '(flash.geom.)?\b(ColorTransform|Matrix|Point|Rectangle|Transform)\b';
},
{ name = 'support.class.haxe.flash.net';
match = '\b(FileReference|FileReferenceList)\b';
},
{ name = 'support.class.haxe.flash.system';
match = '(flash.system.)?\b(Capabilities||IME|Security)\b';
},
{ name = 'support.class.haxe.flash.text';
match = '\b(StyleSheet|TextRenderer)\b';
},
{ name = 'support.class.haxe.flash9';
match = '\b(Boot|Error|Lib|Vector)\b';
},
{ name = 'support.class.haxe.flash9.accessibility';
match = '\b(Accessibility|AccessibilityImplementation|AccessibilityProperties)\b';
},
{ name = 'support.class.haxe.flash9.display';
match = '(flash.display.)?\b(AVM1Movie|ActionScriptVersion|Bitmap|BitmapData|BitmapDataChannel|BlendMode|CapsStyle|DisplayObject|DisplayObjectContainer|FrameLabel|GradientType|Graphics|GraphicsBitmapFill|GraphicsEndFill|GraphicsGradientFill|GraphicsPath|GraphicsPathCommand|GraphicsPathWinding|GraphicsShaderFill|GraphicsSolidFill|GraphicsStroke|GraphicsTrianglePath|IBitmapDrawable|IGraphicsData|IGraphicsFill|IGraphicsPath|IGraphicsStroke|InteractiveObject|InterpolationMethod|JointStyle|LineScaleMode|Loader|LoaderInfo|MorphShape|MovieClip|PixelSnapping|SWFVersion|Scene|Shader|ShaderData|ShaderInput|ShaderJob|ShaderParameter|ShaderParameterType|ShaderPrecision|Shape|SimpleButton|SpreadMethod|Sprite|Stage|StageAlign|StageDisplayStage|StageQuality|StageScaleMode|TriangleCulling)\b';
},
{ name = 'support.class.haxe.flash9.errors';
match = '\b(EOFError|IOError|IllegalOperationError|InvalidSWFError|MemoryError|ScriptTimeoutError|StackOverflowError)\b';
},
{ name = 'support.class.haxe.flash9.events';
match = '\b(ActivityEvent|AsyncErrorEvent|ContextMenuEvent|DataEvent|ErrorEvent|Event|EventDispatcher|EventPhase|FocusEvent|FullScreenEvent|HTTPStatusEvent|IEventDispatcher|IMEEvent|IOErrorEvent|KeyboardEvent|MouseEvent|NetFilterEvent|NetStatusEvent|ProgressEvent|SamplesCallbackEvent|SecurityErrorEvent|ShaderEvent|StatusEvent|SyncEvent|TextEvent|TimerEvent|WeakFunctionClosure|WeakMethodClosure)\b';
},
{ name = 'support.class.haxe.flash9.external';
match = '\b(ExternalInterface)\b';
},
{ name = 'support.class.haxe.flash9.filters';
match = '\b(BevelFilter|BitmapFilter|BitmapFilterQuality|BitmapFilterType|BlurFilter|ColorMatrixFilter|ConvolutionFilter|DisplacementMapFilter|DisplacementMapFilterMode|DropShadowFilter|GlowFilter|GradientBevelFilter|GradientGlowFilter|ShaderFilter)\b';
},
{ name = 'support.class.haxe.flash9.geom';
match = '\b(ColorTransform|Matrix|Matrix3D|Orientation3D|PerspectiveProjection|Point|Rectangle|Transform|Utils3D|Vector3D)\b';
},
{ name = 'support.class.haxe.flash9.media';
match = '\b(Camera|ID3Info|Microphone|Sound|SoundChannel|SoundCodec|SoundLoaderContext|SoundMixer|SoundTransform|Video)\b';
},
{ name = 'support.class.haxe.flash9.net';
match = '\b(DynamicPropertyOutput|FileFilter|FileReference|FileReferenceList|IDynamicPropertyOutput|IDynamicPropertyWriter|LocalConnection|NetConnection|NetStream|NetStreamInfo|NetStreamPlayOptions|NetStreamPlayTransitions|ObjectEncoding|Responder|SharedObject|SharedObjectFlushStatus|Socket|URLLoader|URLLoaderDataFormat|URLRequest|URLRequestHeader|URLRequestMethod|URLStream|URLVariables|XMLSocket)\b';
},
{ name = 'support.class.haxe.flash9.printing';
match = '\b(PrintJob|PrintJobOptions|PrintJobOrientation)\b';
},
{ name = 'support.class.haxe.flash9.sampler';
match = '\b(Api|DeleteObjectSample|NewObjectSample|Sample|StackFrame)\b';
},
{ name = 'support.class.haxe.flash9.system';
match = '\b(ApplicationDomain|Capabilities|FSCommand|IME|IMEConversionMode|JPEGLoaderContext|LoaderContext|Security|SecurityDomain|SecurityPanel|System)\b';
},
{ name = 'support.class.haxe.flash9.text';
match = '\b(AntiAliasType|CSMSettings|Font|FontStyle|FontType|GridFitType|StaticText|StyleSheet|TextColorType|TextDisplayMode|TextExtent|TextField|TextFieldAutoSize|TextFieldType|TextFormat|TextFormatAlign|TextFormatDisplay|TextLineMetrics|TextRenderer|TextRun|TextSnapshot)\b';
},
{ name = 'support.class.haxe.flash9.text.engine';
match = '\b(BreakOpportunity|ContentElement|DigitCase|DigitWidth|EastAsianJustifier|ElementFormat|FontDescription|FontLookup|FontMetrics|FontPosture|FontWeight|GlyphRotation|GraphicElement|GroupElement|JustificationStyle|Kerning|LigatureLevel|LineJustification|SpaceJustifier|TabAlignment|TabStop|TextBaseline|TextBlock|TextElement|TextJustifier|TextLine|TextLineCreationResult|TextLineMirrorRegion|TextLineValidity|TextRotation|TypographicCase)\b';
},
{ name = 'support.class.haxe.flash9.trace';
match = '\b(Trace)\b';
},
{ name = 'support.class.haxe.flash9.ui';
match = '\b(ContextMenu|ContextMenuBuiltInItems|ContextMenuClipboardItems|ContextMenuItem|KeyLocation|Keyboard|Mouse|MouseCursor)\b';
},
{ name = 'support.class.haxe.flash9.utils';
match = '\b(ByteArray|Dictionary|Endian|IDataInput|IDataOutput|IExternalizable|Namespace|ObjectInput|ObjectOutput|Proxy|QName|SetIntervalTimer|Timer|TypedDictionary)\b';
},
{ name = 'support.class.haxe.flash9.xml';
match = '\b(XML|XMLDocument|XMLList|XMLNode|XMLNodeType|XMLParser|XMLTag)\b';
},
{ name = 'support.class.haxe';
match = '\b(Array|ArrayAccess|Bool|Class|Date|DateTools|Dynamic|EReg|Enum|Float|Hash|Int|IntHash|IntIter|Iterable|Iterator|Lambda|List|Math|Null|Reflect|Std|String|StringBuf|StringTools|Type|UInt|ValueType|Void|Xml|XmlType)\b';
},
{ name = 'support.class.haxe.haxe';
match = '\b(FastCell|FastList|Firebug|Http|Int32|Log|Md5|PosInfos|Public|Resource|Serializer|Stack|StackItem|Template|Timer|TimerQueue|TypeResolver|Unserializer)\b';
},
{ name = 'support.class.haxe.io';
match = '\b(Bytes|BytesBuffer|BytesData|BytesInput|BytesOutput|Eof|Error|Input|Output|StringInput)\b';
},
{ name = 'support.class.haxe.haxe.remoting';
match = '\b(AMFConnection|AsyncAdapter|AsyncConnection|AsyncDebugConnection|AsyncProxy|Connection|Context|ContextAll|DelayedConnection|ExternalConnection|FlashJsConnection|HttpAsyncConnection|HttpConnection|LocalConnection|Proxy|Socket|SocketConnection|SocketProtocol|SocketWrapper|SyncSocketConnection)\b';
},
{ name = 'support.class.haxe.haxe.rtti';
match = '\b(CType|ClassField|Classdef|EnumField|Enumdef|Generic|Infos|Path|PathParams|Platforms|Rights|TypeApi|TypeInfos|TypeParams|TypeRoot|TypeTree|Typedef|XmlParser)\b';
},
{ name = 'support.class.haxe.haxe.unit';
match = '\b(TestCase|TestResult|TestRunner|TestStatus)\b';
},
{ name = 'support.class.haxe.haxe.xml';
match = '\b(Attrib|Check|Fast|Filter|Proxy|Rule)\b';
},
{ name = 'support.class.haxe.js';
match = '\b(Anchor|Body|Boot|Button|Checkbox|Document|Dom|Event|FileUpload|Form|FormElement|Frame|Frameset|Hidden|History|HtmlCollection|HtmlDom|IFrame|Image|Lib|Link|Location|MetaDom|Navigator|Option|Password|Radio|Reset|SWFObject|Screen|Select|Selection|Style|StyleSheet|Submit|Text|Textarea|Window|XMLHttpRequest|XMLSocket)\b';
},
{ name = 'support.class.haxe.neko';
match = '\b(Boot|FileKind|FileStat|FileSystem|Lib|Random|Sys|Utf8|Web)\b';
},
{ name = 'support.class.haxe.neko.db';
match = '\b(Connection|Manager|MySql|Object|ResultSet|Sqlite|Transaction)\b';
},
{ name = 'support.class.haxe.neko.io';
match = '\b(File|FileHandle|FileInput|FileOutput|FileSeek|Path|Process)\b';
},
{ name = 'support.class.haxe.neko.net';
match = '\b(Host|Poll|ProxyDetect|Proxysettings|ServerLoop|Socket|SocketHandle|SocketInput|SocketOutput|ThreadRemotingServer|ThreadServer)\b';
},
{ name = 'support.class.haxe.neko.vm';
match = '\b(Deque|Gc|Loader|LoaderHandle|Lock|Module|ModuleHandle|Mutex|Thread|ThreadHandle|Tls|Ui)\b';
},
{ name = 'support.class.haxe.neko.zip';
match = '\b(CRC32|Compress|Flush|Reader|Uncompress|Writer|ZipEntry)\b';
},
{ name = 'support.class.haxe.php';
match = '\b(Boot|CacheLimiter|Exception|FileKind|FileStat|FileSystem|HException|IniHash|Lib|Session|Sys|Utf8|Web)\b';
},
{ name = 'support.class.haxe.php.db';
match = '\b(Connection|DBase|Field|FieldType|Manager|Mysql|Object|ResultSet|Sqlite)\b';
},
{ name = 'support.class.haxe.php.io';
match = '\b(File|FileHandle|FileInput|FileOutput|FileSeek|Path|Process)\b';
},
{ name = 'support.class.haxe.php.net';
match = '\b(Host|Socket|SocketDomain|SocketHandle|SocketInput|SocketOutput|Process)\b';
},
{ name = 'support.class.haxe.tools.haxedoc';
match = '\b(HtmlPrinter|Main)\b';
},
{ name = 'support.class.haxe.tools.haxelib';
match = '\b(Answer|Datas|Developer|Main|Progress|ProgressIn|Project|ProjectInfos|ProjectManager|Remoting_SiteApi|Site|SiteApi|SiteDb|SiteProxy|User|UserInfos|Version|VersionInfos|VersionManager|XmlInfos)\b';
},
{ name = 'support.class.haxe.tools.hxinst';
match = '\b(Main|Progress)\b';
},
{ name = 'support.function.haxe';
match = '\b(trace|this|super|untyped)\b';
},
{ name = 'support.constant.haxe';
match = '\b__(a|arguments__|construct__|dollar__new|js__|keys__|new__|s|typeof__)\b';
},
{ name = 'keyword.control.haxe';
match = '\b(case|cast|catch|default|dynamic|do|else|for|get|if|in|new|set|switch|throw|try|type|while|return|break|continue|extern|dynamic|implements|inline|override|private|public|static|import|package|var)\b';
},
{ name = 'storage.type.haxe';
match = '\b(Bool|Float|String|Void|Dynamic|Int|UInt|T)\b';
},
{ name = 'constant.language.haxe';
match = '\b(null|true|false)\b';
},
{ name = 'constant.numeric.haxe';
match = '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b';
},
{ name = 'string.quoted.double.haxe';
begin = '"';
end = '"';
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.haxe'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.haxe'; }; };
patterns = (
{ name = 'constant.character.escape.haxe';
match = '\\.';
},
);
},
{ name = 'string.quoted.single.haxe';
begin = "'";
end = "'";
beginCaptures = { 0 = { name = 'punctuation.definition.string.begin.haxe'; }; };
endCaptures = { 0 = { name = 'punctuation.definition.string.end.haxe'; }; };
patterns = (
{ name = 'constant.character.escape.haxe';
match = '\\.';
},
);
},
{ name = 'comment.block.haxe';
begin = '/\*';
end = '\*/';
captures = { 0 = { name = 'punctuation.definition.comment.haxe'; }; };
},
{ name = 'comment.line.double-slash.haxe';
match = '(//).*$\n?';
captures = { 1 = { name = 'punctuation.definition.comment.haxe'; }; };
},
{ name = 'keyword.operator.haxe';
match = '\b(instanceof|is|typeof)\b';
},
{ name = 'keyword.operator.symbolic.haxe';
match = '[-!%&*+=/?:]';
},
{ name = 'meta.preprocessor.haxe';
match = '^[ \t]*(#)[a-zA-Z]+';
captures = { 1 = { name = 'punctuation.definition.preprocessor.haxe'; }; };
},
{ name = 'meta.function.haxe';
begin = '\b(function)\s+([a-zA-Z_]\w*(?:\w|>|<|,)*)\s*(\()';
end = '\)';
captures = {
1 = { name = 'storage.type.function.haxe'; };
2 = { name = 'entity.name.function.haxe'; };
3 = { name = 'punctuation.definition.parameters.begin.haxe'; };
};
endCaptures = { 0 = { name = 'punctuation.definition.parameters.end.haxe'; }; };
patterns = (
{ name = 'variable.parameter.function.haxe';
match = '[^,)\n]+';
},
);
},
{ name = 'meta.class.haxe';
match = '\b(class|enum|interface)\s+([a-zA-Z_](?:\w|>|<|,)*)(?:\s+(extends|implements)\s+([a-zA-Z_](?:\w|\.)*)\s*,?)*';
captures = {
1 = { name = 'storage.type.class.haxe'; };
2 = { name = 'entity.name.type.class.haxe'; };
3 = { name = 'storage.modifier.extends.haxe'; };
4 = { name = 'entity.other.inherited-class.haxe'; };
};
},
{ name = 'meta.typedef.haxe';
match = '\b(typedef)\s+([a-zA-Z_]\w*)\s*=';
captures = {
1 = { name = 'storage.type.typedef.haxe'; };
2 = { name = 'entity.name.type.class.haxe'; };
};
},
{ name = 'keyword.function.haxe';
match = '\b(function)\b';
},
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment