From 034e510ba520050b92ef63a68bcd8ffe93189646 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 2 Feb 2015 21:24:22 +0100 Subject: [PATCH 1/8] Grammar for TXL from Sublime Text package --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 2 +- vendor/grammars/TXL | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) create mode 160000 vendor/grammars/TXL diff --git a/.gitmodules b/.gitmodules index ee7dad93..77fd2474 100644 --- a/.gitmodules +++ b/.gitmodules @@ -579,3 +579,6 @@ [submodule "vendor/grammars/JSyntax"] path = vendor/grammars/JSyntax url = https://github.com/bcj/JSyntax +[submodule "vendor/grammars/TXL"] + path = vendor/grammars/TXL + url = https://github.com/MikeHoffert/Sublime-Text-TXL-syntax diff --git a/grammars.yml b/grammars.yml index e9eddd79..0e8b5e01 100644 --- a/grammars.yml +++ b/grammars.yml @@ -106,6 +106,8 @@ vendor/grammars/SublimeBrainfuck: - source.bf vendor/grammars/SublimeXtend: - source.xtend +vendor/grammars/TXL/: +- source.txl vendor/grammars/Textmate-Gosu-Bundle: - source.gosu.2 vendor/grammars/VBDotNetSyntax: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index c492ed36..6598563e 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2921,7 +2921,7 @@ TXL: type: programming extensions: - .txl - tm_scope: none + tm_scope: source.txl ace_mode: text Tcl: diff --git a/vendor/grammars/TXL b/vendor/grammars/TXL new file mode 160000 index 00000000..c1c98dfa --- /dev/null +++ b/vendor/grammars/TXL @@ -0,0 +1 @@ +Subproject commit c1c98dfa86a8510532aee3df99181f9e0487fee8 From 8fe9ec05213ac177ef3e7a4e81ba2f80497cefa5 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 2 Feb 2015 21:37:24 +0100 Subject: [PATCH 2/8] Grammar for G-Code from Sublime Text package --- .gitmodules | 3 +++ grammars.yml | 6 ++++++ lib/linguist/languages.yml | 2 +- vendor/grammars/G-Code | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 160000 vendor/grammars/G-Code diff --git a/.gitmodules b/.gitmodules index 77fd2474..6857325f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -582,3 +582,6 @@ [submodule "vendor/grammars/TXL"] path = vendor/grammars/TXL url = https://github.com/MikeHoffert/Sublime-Text-TXL-syntax +[submodule "vendor/grammars/G-Code"] + path = vendor/grammars/G-Code + url = https://github.com/robotmaster/sublime-text-syntax-highlighting diff --git a/grammars.yml b/grammars.yml index 0e8b5e01..2b1d2c72 100644 --- a/grammars.yml +++ b/grammars.yml @@ -39,6 +39,12 @@ vendor/grammars/Docker.tmbundle: - source.dockerfile vendor/grammars/Elm.tmLanguage: - source.elm +vendor/grammars/G-Code/: +- source.LS +- source.MCPOST +- source.MOD +- source.apt +- source.gcode vendor/grammars/GDScript-sublime/: - source.gdscript vendor/grammars/Handlebars: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 6598563e..2be249ba 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -942,7 +942,7 @@ G-code: - .g - .gco - .gcode - tm_scope: none + tm_scope: source.gcode ace_mode: gcode GAMS: diff --git a/vendor/grammars/G-Code b/vendor/grammars/G-Code new file mode 160000 index 00000000..81e8b03e --- /dev/null +++ b/vendor/grammars/G-Code @@ -0,0 +1 @@ +Subproject commit 81e8b03e3dc71f2c8eddfb389dbda21a320f45c1 From 2044e191a2f42edbf3848a4f069b4d913a8f4b32 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 2 Feb 2015 21:48:27 +0100 Subject: [PATCH 3/8] Grammar for Grace from TextMate bundle --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 2 +- vendor/grammars/grace-tmbundle | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) create mode 160000 vendor/grammars/grace-tmbundle diff --git a/.gitmodules b/.gitmodules index 6857325f..5980861a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -585,3 +585,6 @@ [submodule "vendor/grammars/G-Code"] path = vendor/grammars/G-Code url = https://github.com/robotmaster/sublime-text-syntax-highlighting +[submodule "vendor/grammars/grace-tmbundle"] + path = vendor/grammars/grace-tmbundle + url = https://github.com/zmthy/grace-tmbundle diff --git a/grammars.yml b/grammars.yml index 2b1d2c72..ee83c6b0 100644 --- a/grammars.yml +++ b/grammars.yml @@ -227,6 +227,8 @@ vendor/grammars/gnuplot-tmbundle: - source.gnuplot vendor/grammars/go-tmbundle: - source.go +vendor/grammars/grace-tmbundle/: +- source.grace vendor/grammars/gradle.tmbundle: - source.groovy.gradle vendor/grammars/graphviz.tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 2be249ba..dddded97 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -1092,7 +1092,7 @@ Grace: type: programming extensions: - .grace - tm_scope: none + tm_scope: source.grace ace_mode: text Gradle: diff --git a/vendor/grammars/grace-tmbundle b/vendor/grammars/grace-tmbundle new file mode 160000 index 00000000..c342d35c --- /dev/null +++ b/vendor/grammars/grace-tmbundle @@ -0,0 +1 @@ +Subproject commit c342d35c76d6a7dd5cd91157ca5b39481ef59e96 From 8f70604466c9fd8890ddc23e5bf0b6958df78e03 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 2 Feb 2015 21:50:49 +0100 Subject: [PATCH 4/8] Grammar for Ox from Sublime Text package --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 2 +- vendor/grammars/sublime-text-ox | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) create mode 160000 vendor/grammars/sublime-text-ox diff --git a/.gitmodules b/.gitmodules index 5980861a..6aa15594 100644 --- a/.gitmodules +++ b/.gitmodules @@ -588,3 +588,6 @@ [submodule "vendor/grammars/grace-tmbundle"] path = vendor/grammars/grace-tmbundle url = https://github.com/zmthy/grace-tmbundle +[submodule "vendor/grammars/sublime-text-ox"] + path = vendor/grammars/sublime-text-ox + url = https://github.com/andreashetland/sublime-text-ox diff --git a/grammars.yml b/grammars.yml index ee83c6b0..d4b76122 100644 --- a/grammars.yml +++ b/grammars.yml @@ -457,6 +457,8 @@ vendor/grammars/sublime-sourcepawn: - source.sp vendor/grammars/sublime-tea: - source.tea +vendor/grammars/sublime-text-ox/: +- source.ox vendor/grammars/sublime_cobol: - source.acucobol - source.cobol diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index dddded97..8f15c38f 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -2096,7 +2096,7 @@ Ox: - .ox - .oxh - .oxo - tm_scope: none + tm_scope: source.ox ace_mode: text Oxygene: diff --git a/vendor/grammars/sublime-text-ox b/vendor/grammars/sublime-text-ox new file mode 160000 index 00000000..bdd03e09 --- /dev/null +++ b/vendor/grammars/sublime-text-ox @@ -0,0 +1 @@ +Subproject commit bdd03e09fabc0b54567136709cdd33d7641b0e19 From 3c34da8bd39466b77268cebbb57ca13cd467d768 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Tue, 3 Feb 2015 12:52:06 +0100 Subject: [PATCH 5/8] Sample for eC --- samples/eC/Designer.ec | 337 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 337 insertions(+) create mode 100644 samples/eC/Designer.ec diff --git a/samples/eC/Designer.ec b/samples/eC/Designer.ec new file mode 100644 index 00000000..38ca035f --- /dev/null +++ b/samples/eC/Designer.ec @@ -0,0 +1,337 @@ +import "ide" + +class Designer : DesignerBase +{ + ~Designer() + { + if(GetActiveDesigner() == this) + { + SetActiveDesigner(null); + } + if(classDesigner) + delete classDesigner; + } + + // *** DesignerBase Implementation *** + + void ModifyCode() + { + codeEditor.ModifyCode(); + } + + void UpdateProperties() + { + codeEditor.DesignerModifiedObject(); + } + + void CodeAddObject(Instance instance, ObjectInfo * object) + { + codeEditor.AddObject(instance, object); + } + + void SheetAddObject(ObjectInfo object) + { + codeEditor.sheet.AddObject(object, object.name, typeData, true); //className, true); + } + + void AddToolBoxClass(Class _class) + { + ((IDEWorkSpace)master).toolBox.AddControl(_class); + } + + void AddDefaultMethod(Instance instance, Instance classInstance) + { + Class _class = instance._class; + Method defaultMethod = null; + + for( ; _class; _class = _class.base) + { + Method method; + int minID = MAXINT; + for(method = (Method)_class.methods.first; method; method = (Method)((BTNode)method).next) + { + if(method.type == virtualMethod) + { + if(!method.dataType) + method.dataType = ProcessTypeString(method.dataTypeString, false); + if(method.vid < minID && (instance == classInstance || (method.dataType.thisClass && eClass_IsDerived(classInstance._class, method.dataType.thisClass.registered)))) + { + defaultMethod = method; + minID = method.vid; + } + } + } + if(defaultMethod) + break; + } + codeEditor.AddMethod(defaultMethod); + } + + bool ObjectContainsCode(ObjectInfo object) + { + // Confirmation if control contains code + if(object.instCode) + { + MembersInit members; + if(object.instCode.members) + { + for(members = object.instCode.members->first; members; members = members.next) + { + if(members.type == methodMembersInit) + { + //if(!Code_IsFunctionEmpty(members.function)) + { + return true; + } + } + } + } + } + return false; + } + + void DeleteObject(ObjectInfo object) + { + if(codeEditor) + codeEditor.DeleteObject(object); + } + + void RenameObject(ObjectInfo object, const char * name) + { + if(object && (name || !object.classDefinition)) + codeEditor.RenameObject(object, name); + } + + bool FindObject(Instance * object, const char * string) + { + ObjectInfo classObject; + for(classObject = codeEditor.classes.first; classObject; classObject = classObject.next) + { + ObjectInfo check; + if(classObject.name && !strcmp(string, classObject.name)) + { + *object = classObject.instance; + break; + } + for(check = classObject.instances.first; check; check = check.next) + { + if(check.name && !strcmp(string, check.name)) + { + *object = check.instance; + break; + } + } + if(check) + return true; + } + return false; + } + + void SelectObjectFromDesigner(ObjectInfo object) + { + codeEditor.SelectObjectFromDesigner(object); + } + + borderStyle = sizable; + isActiveClient = true; + hasVertScroll = true; + hasHorzScroll = true; + hasClose = true; + hasMaximize = true; + hasMinimize = true; + text = $"Designer"; + menu = Menu { }; + anchor = Anchor { left = 300, right = 150, top = 0, bottom = 0 }; + + ToolBox toolBox; + CodeEditor codeEditor; + + Menu fileMenu { menu, $"File", f }; + MenuItem fileSaveItem + { + fileMenu, $"Save", s, ctrlS; + bool NotifySelect(MenuItem selection, Modifiers mods) + { + return codeEditor.MenuFileSave(selection, mods); + } + }; + MenuItem fileSaveAsItem + { + fileMenu, $"Save As...", a; + bool NotifySelect(MenuItem selection, Modifiers mods) + { + return codeEditor.MenuFileSaveAs(selection, mods); + } + }; + bool debugClosing; + + bool OnClose(bool parentClosing) + { + if(!parentClosing) + { + if(codeEditor && codeEditor.inUseDebug && !debugClosing) + { + debugClosing = true; + closing = false; + if(CloseConfirmation(false)) + { + visible = false; + if(modifiedDocument) + OnFileModified({ modified = true }, null); + } + debugClosing = false; + return false; + } + if(codeEditor && !codeEditor.closing && !debugClosing) + { + if(!codeEditor.visible) + { + if(!codeEditor.Destroy(0)) + return false; + else + codeEditor = null; + } + else + { + visible = false; + return false; + } + } + } + return true; + } + + bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct) + { + if(active) + { + codeEditor.EnsureUpToDate(); + codeEditor.fixCaret = true; + /* + if(classDesigner) + classDesigner.Activate(); + */ + } + return true; + } + + bool OnKeyHit(Key key, unichar ch) + { + return codeEditor.sheet.OnKeyHit(key, ch); + } + + watch(modifiedDocument) + { + fileSaveItem.disabled = !modifiedDocument && codeEditor.fileName; + }; + + // *** METHODS ACCESSED FROM PROPERTY SHEET/TOOLBOX/CODE EDITOR *** + void Reset() + { + if(classDesigner) + { + classDesigner.Reset(); + classDesigner.SelectObject(null, null); + classDesigner.Destroy(0); + delete classDesigner; + } + } + + void FillToolBox() + { + if(this && classDesigner) + classDesigner.ListToolBoxClasses(this); + } + + void SelectObject(ObjectInfo object, Instance instance) + { + ClassDesignerBase classDesigner = this.classDesigner; +#ifdef _DEBUG + if(instance && instance._class.module.application != codeEditor.privateModule) + printf("warning: SelectObject: instance._class.module.application != codeEditor.privateModule\n"); +#endif + if(!classDesigner || !instance || classDesigner._class != (Class)eInstance_GetDesigner(instance)) + { + if(classDesigner) + { + classDesigner.SelectObject(null, null); + classDesigner.Destroy(0); + classDesigner = null; + delete this.classDesigner; + } + if(instance) + { + this.classDesigner = classDesigner = eInstance_New(eInstance_GetDesigner(instance)); + incref classDesigner; + //if(!classDesigner.parent) + { + classDesigner.parent = this; + classDesigner.anchor = Anchor { left = 0, right = 0, top = 0, bottom = 0 }; + } + classDesigner.Create(); + } + } + // Call class editor SelectObject + if(classDesigner) + classDesigner.SelectObject(object, instance); + } + + void AddObject() + { + // Call class editor AddObject + if(classDesigner) + classDesigner.AddObject(); + if(visible) + Activate(); + else + codeEditor.Activate(); + } + + void CreateObject(Instance instance, ObjectInfo object, bool isClass, Instance iclass) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + + // Call class editor CreateObject + if(designerClass) + designerClass.CreateObject(this, instance, object, isClass, iclass); + } + + void ::PostCreateObject(Instance instance, ObjectInfo object, bool isClass, Instance iclass) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + + // Call class editor PostCreateObject + if(designerClass) + designerClass.PostCreateObject(instance, object, isClass, iclass); + } + + void ::DroppedObject(Instance instance, ObjectInfo object, bool isClass, Instance iclass) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + + // Call class editor PostCreateObject + if(designerClass) + designerClass.DroppedObject(instance, object, isClass, iclass); + } + + void PrepareTestObject(Instance instance) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + if(designerClass) + designerClass.PrepareTestObject(this, instance); + } + + void ::DestroyObject(Instance instance) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + if(designerClass) + designerClass.DestroyObject(instance); + } + + void ::FixProperty(Property prop, Instance instance) + { + subclass(ClassDesignerBase) designerClass = eInstance_GetDesigner(instance); + if(designerClass) + designerClass.FixProperty(prop, instance); + } +} From 9fe9bf617f162eb2b40e67b6de00c3c28bb6d620 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Tue, 3 Feb 2015 12:52:35 +0100 Subject: [PATCH 6/8] Grammar for eC from TextMate bundle --- .gitmodules | 3 +++ grammars.yml | 2 ++ lib/linguist/languages.yml | 2 +- vendor/grammars/ec.tmbundle | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) create mode 160000 vendor/grammars/ec.tmbundle diff --git a/.gitmodules b/.gitmodules index 6aa15594..37489aa1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -591,3 +591,6 @@ [submodule "vendor/grammars/sublime-text-ox"] path = vendor/grammars/sublime-text-ox url = https://github.com/andreashetland/sublime-text-ox +[submodule "vendor/grammars/ec.tmbundle"] + path = vendor/grammars/ec.tmbundle + url = https://github.com/ecere/ec.tmbundle diff --git a/grammars.yml b/grammars.yml index d4b76122..9b757868 100644 --- a/grammars.yml +++ b/grammars.yml @@ -200,6 +200,8 @@ vendor/grammars/dylan.tmbundle: - source.makegen vendor/grammars/ebundles/Bundles/MSDOS batch file.tmbundle: - source.dosbatch +vendor/grammars/ec.tmbundle/: +- source.c.ec vendor/grammars/eiffel.tmbundle: - source.eiffel vendor/grammars/elixir-tmbundle: diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 8f15c38f..c5af5967 100644 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3331,7 +3331,7 @@ eC: extensions: - .ec - .eh - tm_scope: none + tm_scope: source.c.ec ace_mode: text edn: diff --git a/vendor/grammars/ec.tmbundle b/vendor/grammars/ec.tmbundle new file mode 160000 index 00000000..b8ec2d32 --- /dev/null +++ b/vendor/grammars/ec.tmbundle @@ -0,0 +1 @@ +Subproject commit b8ec2d32afcaaef5ed7471d80aa4e0cd8717944d From d7b97915145d01f73cacf3d9527e84ccc00c23e8 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Wed, 4 Feb 2015 19:47:23 +0100 Subject: [PATCH 7/8] Remove grammar for AutoHotkey --- .gitmodules | 3 --- grammars.yml | 2 -- vendor/grammars/AutoHotkey | 1 - 3 files changed, 6 deletions(-) delete mode 160000 vendor/grammars/AutoHotkey diff --git a/.gitmodules b/.gitmodules index 6aa15594..425a486e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -552,9 +552,6 @@ [submodule "vendor/grammars/liquid.tmbundle"] path = vendor/grammars/liquid.tmbundle url = https://github.com/bastilian/validcode-textmate-bundles -[submodule "vendor/grammars/AutoHotkey"] - path = vendor/grammars/AutoHotkey - url = https://github.com/ahkscript/AutoHotkey [submodule "vendor/grammars/ats.sublime"] path = vendor/grammars/ats.sublime url = https://github.com/steinwaywhw/ats-mode-sublimetext diff --git a/grammars.yml b/grammars.yml index d4b76122..2f539728 100644 --- a/grammars.yml +++ b/grammars.yml @@ -24,8 +24,6 @@ vendor/grammars/Agda.tmbundle: - source.agda vendor/grammars/Alloy.tmbundle: - source.alloy -vendor/grammars/AutoHotkey: -- source.ahk vendor/grammars/CLIPS-sublime: - source.clips vendor/grammars/ColdFusion: diff --git a/vendor/grammars/AutoHotkey b/vendor/grammars/AutoHotkey deleted file mode 160000 index 371f9b23..00000000 --- a/vendor/grammars/AutoHotkey +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 371f9b23071bf4f8df74bf162b5f4441ec6f0bb0 From 0479a8998226a7d30db43803b3a6a76b9155cbe6 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Wed, 4 Feb 2015 19:57:48 +0100 Subject: [PATCH 8/8] Update URL for AutoHotkey grammar --- .gitmodules | 3 +++ grammars.yml | 2 ++ vendor/grammars/AutoHotkey | 1 + 3 files changed, 6 insertions(+) create mode 160000 vendor/grammars/AutoHotkey diff --git a/.gitmodules b/.gitmodules index 425a486e..d0afdd65 100644 --- a/.gitmodules +++ b/.gitmodules @@ -588,3 +588,6 @@ [submodule "vendor/grammars/sublime-text-ox"] path = vendor/grammars/sublime-text-ox url = https://github.com/andreashetland/sublime-text-ox +[submodule "vendor/grammars/AutoHotkey"] + path = vendor/grammars/AutoHotkey + url = https://github.com/ahkscript/SublimeAutoHotkey diff --git a/grammars.yml b/grammars.yml index 2f539728..1c82a254 100644 --- a/grammars.yml +++ b/grammars.yml @@ -24,6 +24,8 @@ vendor/grammars/Agda.tmbundle: - source.agda vendor/grammars/Alloy.tmbundle: - source.alloy +vendor/grammars/AutoHotkey/: +- source.ahk vendor/grammars/CLIPS-sublime: - source.clips vendor/grammars/ColdFusion: diff --git a/vendor/grammars/AutoHotkey b/vendor/grammars/AutoHotkey new file mode 160000 index 00000000..9b42c86e --- /dev/null +++ b/vendor/grammars/AutoHotkey @@ -0,0 +1 @@ +Subproject commit 9b42c86e75a78e0f3c37d87476c1d943803fa76e