├── .gitattributes ├── .gitignore ├── DBPrefsWindowController.h ├── DBPrefsWindowController.m ├── English.lproj ├── InfoPlist.strings ├── MainMenu-Document.xib ├── MainMenu.xib └── MyDocument.xib ├── ErrorPopoverView.xib ├── FRAFontTransformer.h ├── FRAFontTransformer.m ├── Fragaria Document Based App-Info.plist ├── Fragaria copy-Info.plist ├── Fragaria-Info.plist ├── Fragaria.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── FragariaAppDelegate.h ├── FragariaAppDelegate.m ├── Fragaria_Document-Info.plist ├── Fragaria_Prefix.pch ├── General.png ├── ICUMatcher.h ├── ICUMatcher.m ├── ICUPattern.h ├── ICUPattern.m ├── LICENSE-2.0.txt ├── MGSBreakpointDelegate.h ├── MGSExtraInterfaceController.h ├── MGSExtraInterfaceController.m ├── MGSFragaria-Info.plist ├── MGSFragaria.h ├── MGSFragaria.m ├── MGSFragariaFontsAndColoursPrefsViewController.h ├── MGSFragariaFontsAndColoursPrefsViewController.m ├── MGSFragariaFramework.h ├── MGSFragariaPreferences.h ├── MGSFragariaPreferences.m ├── MGSFragariaPrefsViewController.h ├── MGSFragariaPrefsViewController.m ├── MGSFragariaTextEditingPrefsViewController.h ├── MGSFragariaTextEditingPrefsViewController.m ├── MGSGlyphGenerator.h ├── MGSGlyphGenerator.m ├── MGSPreferencesController.h ├── MGSPreferencesController.m ├── MGSPreferencesFontsAndColours.xib ├── MGSPreferencesTextEditing.xib ├── MGSSyntaxController.h ├── MGSSyntaxController.m ├── MGSTextMenuController.h ├── MGSTextMenuController.m ├── MyDocument.h ├── MyDocument.m ├── NSScanner+Fragaria.h ├── NSScanner+Fragaria.m ├── NSStringICUAdditions.h ├── NSStringICUAdditions.m ├── Preferences.xib ├── README.md ├── SMLAutoCompleteDelegate.h ├── SMLBasicPerformer.h ├── SMLBasicPerformer.m ├── SMLCommandResult.xib ├── SMLDetab.xib ├── SMLEntab.xib ├── SMLErrorPopOver.h ├── SMLErrorPopOver.m ├── SMLGoToLine.xib ├── SMLGutterTextView.h ├── SMLGutterTextView.m ├── SMLLayoutManager.h ├── SMLLayoutManager.m ├── SMLLineNumbers.h ├── SMLLineNumbers.m ├── SMLOpenPanelAccessoryView.xib ├── SMLRegularExpressionHelp.xib ├── SMLStandardHeader.h ├── SMLSyntaxColouring.h ├── SMLSyntaxColouring.m ├── SMLSyntaxColouringDelegate.h ├── SMLSyntaxDefinition.h ├── SMLSyntaxError.h ├── SMLSyntaxError.m ├── SMLTextPerformer.h ├── SMLTextPerformer.m ├── SMLTextView.h ├── SMLTextView.m ├── Syntax Definitions ├── actionscript.plist ├── actionscript3.plist ├── active4d.plist ├── ada.plist ├── ampl.plist ├── apache.plist ├── applescript.plist ├── asm-mips.plist ├── asm-x86.plist ├── asp-js.plist ├── asp-vb.plist ├── aspdotnet-cs.plist ├── aspdotnet-vb.plist ├── awk.plist ├── batch.plist ├── c.plist ├── cobol.plist ├── coffeescript.plist ├── coldfusion.plist ├── cpp.plist ├── csharp.plist ├── csound.plist ├── css.plist ├── d.plist ├── dylan.plist ├── eiffel.plist ├── erl.plist ├── eztpl.plist ├── f-script.plist ├── fortran.plist ├── freefem.plist ├── gedcom.plist ├── gnuassembler.plist ├── graphviz.plist ├── haskell.plist ├── header.plist ├── html.plist ├── idl.plist ├── java.plist ├── javafx.plist ├── javascript.plist ├── jsp.plist ├── latex.plist ├── lilypond.plist ├── lisp.plist ├── logtalk.plist ├── lsl.plist ├── lua.plist ├── matlab.plist ├── mel.plist ├── metapost.plist ├── metaslang.plist ├── mysql.plist ├── nemerle.plist ├── none.plist ├── nrnhoc.plist ├── objectivec.plist ├── objectivecaml.plist ├── ox.plist ├── pascal.plist ├── pdf.plist ├── perl.plist ├── php.plist ├── plist.plist ├── postscript.plist ├── prolog.plist ├── python.plist ├── r.plist ├── rhtml.plist ├── ruby.plist ├── scala.plist ├── sgml.plist ├── shell.plist ├── sml.plist ├── sql.plist ├── standard.plist ├── stata.plist ├── supercollider.plist ├── tcltk.plist ├── torquescript.plist ├── udo.plist ├── vb.plist ├── verilog.plist ├── vhdl.plist └── xml.plist ├── SyntaxDefinitions.plist ├── TODO.md ├── editor-breakpoint-0.png ├── editor-breakpoint-1.png ├── editor-breakpoint-2.png ├── editor-breakpoint.png ├── editor-warning.png ├── icu ├── LICENSE.html └── unicode │ ├── parseerr.h │ ├── platform.h │ ├── putil.h │ ├── uconfig.h │ ├── udraft.h │ ├── uiter.h │ ├── umachine.h │ ├── uregex.h │ ├── urename.h │ ├── ustring.h │ ├── utf.h │ ├── utf16.h │ ├── utf8.h │ ├── utf_old.h │ ├── utypes.h │ └── uversion.h └── main.m /.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -crlf -diff -merge 2 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | build/* 3 | *.pbxuser 4 | !default.pbxuser 5 | *.mode1v3 6 | !default.mode1v3 7 | *.mode2v3 8 | !default.mode2v3 9 | *.perspectivev3 10 | !default.perspectivev3 11 | *.xcworkspace 12 | !default.xcworkspace 13 | xcuserdata/ 14 | profile 15 | *.moved-aside 16 | 17 | ## Ignore incredibly annoying .DS_Store files 18 | .DS_Store 19 | -------------------------------------------------------------------------------- /DBPrefsWindowController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBPrefsWindowController.h 3 | // 4 | // Created by Dave Batton 5 | // http://www.Mere-Mortal-Software.com/blog/ 6 | // 7 | // Documentation for this class is available here: 8 | // http://www.mere-mortal-software.com/blog/details.php?d=2007-03-11 9 | // 10 | // Copyright 2007. Some rights reserved. 11 | // This work is licensed under a Creative Commons license: 12 | // http://creativecommons.org/licenses/by/3.0/ 13 | // 14 | // 11 March 2007 : Initial 1.0 release 15 | // 15 March 2007 : Version 1.1 16 | // Resizing is now handled along with the cross-fade by 17 | // the NSViewAnimation routine. 18 | // Cut the fade time in half to speed up the window resize. 19 | // -setupToolbar is now called each time the window opens so 20 | // you can configure it differently each time if you want. 21 | // Holding down the shift key will now slow down the animation. 22 | // This can be disabled by using the new -setShiftSlowsAnimation: 23 | // method. 24 | // 23 March 2007 : Version 1.1.1 25 | // The initial first responder now gets set when the view is 26 | // swapped so that the user can tab to the objects displayed 27 | // in the window. 28 | // Also added a work-around to Cocoa's insistance on drawing 29 | // a focus ring around the first toolbar icon when going from 30 | // a view with a focusable item to a view without a focusable item. 31 | // 32 | // 31 May 2007 : Version 1.1.2 33 | // The window's title bar and toolbar heights are now calculated at 34 | // runtime, rather than being hard-coded. 35 | // Fixed a redraw problem and a window placement problem associated 36 | // with large preference windows. 37 | // Added some code to supress compiler warnings from unused parameters. 38 | // Fixed a couple of objects that weren't being properly released. 39 | // 40 | 41 | 42 | #import 43 | 44 | 45 | @interface DBPrefsWindowController : NSWindowController { 46 | NSMutableArray *toolbarIdentifiers; 47 | NSMutableDictionary *toolbarViews; 48 | NSMutableDictionary *toolbarItems; 49 | 50 | BOOL _crossFade; 51 | BOOL _shiftSlowsAnimation; 52 | 53 | NSView *contentSubview; 54 | NSViewAnimation *viewAnimation; 55 | NSString *titlePrefix; 56 | } 57 | 58 | @property (copy) NSString *titlePrefix; 59 | 60 | + (id)sharedPrefsWindowController; 61 | + (NSString *)nibName; 62 | 63 | - (void)setupToolbar; 64 | - (void)addView:(NSView *)view label:(NSString *)label; 65 | - (void)addView:(NSView *)view label:(NSString *)label image:(NSImage *)image; 66 | 67 | - (BOOL)crossFade; 68 | - (void)setCrossFade:(BOOL)fade; 69 | - (BOOL)shiftSlowsAnimation; 70 | - (void)setShiftSlowsAnimation:(BOOL)slows; 71 | 72 | - (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate; 73 | - (void)crossFadeView:(NSView *)oldView withView:(NSView *)newView; 74 | - (NSRect)frameForView:(NSView *)view; 75 | 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ErrorPopoverView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 1070 5 | 11E53 6 | 3084 7 | 1138.47 8 | 569.00 9 | 10 | com.apple.InterfaceBuilder.CocoaPlugin 11 | 3084 12 | 13 | 14 | NSCustomObject 15 | NSCustomView 16 | 17 | 18 | com.apple.InterfaceBuilder.CocoaPlugin 19 | 20 | 21 | PluginDependencyRecalculationVersion 22 | 23 | 24 | 25 | 26 | SequencerPopoverHandler 27 | 28 | 29 | FirstResponder 30 | 31 | 32 | NSApplication 33 | 34 | 35 | 36 | 268 37 | {291, 126} 38 | 39 | 40 | 41 | NSView 42 | 43 | 44 | 45 | 46 | 47 | 48 | view 49 | 50 | 51 | 52 | 11 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 60 | 61 | 62 | 63 | 64 | -2 65 | 66 | 67 | File's Owner 68 | 69 | 70 | -1 71 | 72 | 73 | First Responder 74 | 75 | 76 | -3 77 | 78 | 79 | Application 80 | 81 | 82 | 1 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | com.apple.InterfaceBuilder.CocoaPlugin 91 | com.apple.InterfaceBuilder.CocoaPlugin 92 | com.apple.InterfaceBuilder.CocoaPlugin 93 | com.apple.InterfaceBuilder.CocoaPlugin 94 | 95 | 96 | 97 | 98 | 99 | 11 100 | 101 | 102 | 103 | 104 | SequencerPopoverHandler 105 | NSViewController 106 | 107 | IBProjectSource 108 | ./Classes/SequencerPopoverHandler.h 109 | 110 | 111 | 112 | 113 | 0 114 | IBCocoaFramework 115 | YES 116 | 3 117 | YES 118 | 119 | 120 | -------------------------------------------------------------------------------- /FRAFontTransformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Fraise version 3.7 - Based on Smultron by Peter Borg 3 | Written by Jean-François Moy - jeanfrancois.moy@gmail.com 4 | Find the latest version at http://github.com/jfmoy/Fraise 5 | 6 | Copyright 2010 Jean-François Moy 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import 16 | 17 | 18 | @interface FRAFontTransformer : NSValueTransformer { 19 | 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FRAFontTransformer.m: -------------------------------------------------------------------------------- 1 | /* 2 | Fraise version 3.7 - Based on Smultron by Peter Borg 3 | Written by Jean-François Moy - jeanfrancois.moy@gmail.com 4 | Find the latest version at http://github.com/jfmoy/Fraise 5 | 6 | Copyright 2010 Jean-François Moy 7 | 8 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 13 | */ 14 | 15 | #import "FRAFontTransformer.h" 16 | 17 | @implementation FRAFontTransformer 18 | 19 | + (Class)transformedValueClass 20 | { 21 | return [NSString class]; 22 | } 23 | 24 | 25 | + (BOOL)allowsReverseTransformation 26 | { 27 | return NO; 28 | } 29 | 30 | 31 | - (id)transformedValue:(id)value 32 | { 33 | NSFont *font = [NSUnarchiver unarchiveObjectWithData:value]; 34 | 35 | return [NSString stringWithFormat:@"%@ - %.0fpt", [font fontName], [font pointSize]]; 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Fragaria Document Based App-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | ???? 13 | 14 | CFBundleTypeName 15 | MyDocumentType 16 | CFBundleTypeOSTypes 17 | 18 | ???? 19 | 20 | CFBundleTypeRole 21 | Editor 22 | LSTypeIsPackage 23 | 24 | NSDocumentClass 25 | MyDocument 26 | NSPersistentStoreTypeKey 27 | Binary 28 | 29 | 30 | CFBundleExecutable 31 | ${EXECUTABLE_NAME} 32 | CFBundleIdentifier 33 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundlePackageType 37 | APPL 38 | CFBundleShortVersionString 39 | 1.0 40 | CFBundleSignature 41 | ???? 42 | CFBundleVersion 43 | 1 44 | LSMinimumSystemVersion 45 | ${MACOSX_DEPLOYMENT_TARGET} 46 | NSMainNibFile 47 | MainMenu-Document 48 | NSPrincipalClass 49 | NSApplication 50 | 51 | 52 | -------------------------------------------------------------------------------- /Fragaria copy-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.mugginsoft.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Fragaria-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.mugginsoft.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0.1 25 | LSMinimumSystemVersion 26 | ${MACOSX_DEPLOYMENT_TARGET} 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /Fragaria.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FragariaAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // FragariaAppDelegate.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 30/04/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class SMLTextView; 12 | @class MGSFragaria; 13 | 14 | @interface FragariaAppDelegate : NSObject { 15 | NSWindow *window; 16 | IBOutlet NSView *editView; 17 | MGSFragaria *fragaria; 18 | BOOL isEdited; 19 | } 20 | 21 | - (IBAction)showPreferencesWindow:(id)sender; 22 | - (IBAction)copyToPasteBoard:(id)sender; 23 | - (IBAction)reloadString:(id)sender; 24 | @property (assign) IBOutlet NSWindow *window; 25 | 26 | - (void)setSyntaxDefinition:(NSString *)name; 27 | - (NSString *)syntaxDefinition; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Fragaria_Document-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleDocumentTypes 8 | 9 | 10 | CFBundleTypeExtensions 11 | 12 | ???? 13 | 14 | CFBundleTypeIconFile 15 | 16 | CFBundleTypeName 17 | DocumentType 18 | CFBundleTypeOSTypes 19 | 20 | ???? 21 | 22 | CFBundleTypeRole 23 | Editor 24 | NSDocumentClass 25 | MyDocument 26 | 27 | 28 | CFBundleExecutable 29 | ${EXECUTABLE_NAME} 30 | CFBundleIconFile 31 | 32 | CFBundleIdentifier 33 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 34 | CFBundleInfoDictionaryVersion 35 | 6.0 36 | CFBundleName 37 | ${PRODUCT_NAME} 38 | CFBundlePackageType 39 | APPL 40 | CFBundleShortVersionString 41 | 1 42 | CFBundleSignature 43 | ???? 44 | CFBundleVersion 45 | 1 46 | LSMinimumSystemVersion 47 | ${MACOSX_DEPLOYMENT_TARGET} 48 | NSMainNibFile 49 | MainMenu-Document 50 | NSPrincipalClass 51 | NSApplication 52 | 53 | 54 | -------------------------------------------------------------------------------- /Fragaria_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Fragaria' target in the 'Fragaria' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /General.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/General.png -------------------------------------------------------------------------------- /ICUMatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICUMatcher.h 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/29/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ICUPattern; 11 | 12 | /*! 13 | @class ICUMatcher 14 | @abstract ICUMatcher provides matching functionality for regular expression matching. 15 | @discussion This class is based off of the C++ ICU RegexMatcher class. For examples of how to use the matcher, see the NSString category included in this project. 16 | */ 17 | @interface ICUMatcher : NSObject { 18 | ICUPattern *pattern; 19 | } 20 | 21 | /*! 22 | @method matcherWithPattern:overString: 23 | @abstract Returns a matcher that can match the given pattern over the given string. 24 | @discussion 25 | */ 26 | +(ICUMatcher *)matcherWithPattern:(ICUPattern *)p overString:(NSString *)stringToSearchOver; 27 | 28 | /*! 29 | @method initWithPattern:overString: 30 | @abstract Initializes a matcher that can match the given patter over the given string. 31 | @discussion 32 | */ 33 | -(ICUMatcher *)initWithPattern:(ICUPattern *)p overString:(NSString *)stringToSearchOver; 34 | 35 | /*! 36 | @method findNext 37 | @abstract Finds the next occurrence of the pattern in the input string. 38 | @discussion Use group and rangeOfMatch to extract the match. 39 | */ 40 | -(BOOL)findNext; 41 | 42 | /*! 43 | @method findFromIndex: 44 | @abstract Resets the pattern and performs a match from the specified index. 45 | @discussion Use group and rangeOfMatch to extract the match. 46 | */ 47 | -(BOOL)findFromIndex:(unsigned)idx; 48 | 49 | /*! 50 | @method group 51 | @abstract Returns the current match. 52 | @discussion Each match has one or more subexpressions associated with the match. This returns the entire match. 53 | */ 54 | -(NSString *)group; 55 | 56 | /*! 57 | @method groupAtIndex: 58 | @abstract Returns the given subexpression for the current match. 59 | @discussion group is equivalent to groupAtIndex:0. The subexpressions for a match are indexed from 1. 60 | */ 61 | -(NSString *)groupAtIndex:(unsigned)groupIndex; 62 | 63 | /*! 64 | @method numberOfGroups 65 | @abstract Returns the number of groups for the current match. 66 | @discussion Group 0 is the entire match and groups 1..n represent the groups for the subexpressions. 67 | */ 68 | -(unsigned)numberOfGroups; 69 | 70 | /*! 71 | @method lookingAt: 72 | @abstract Returns true if the pattern matches some prefix of the input string starting at the specified index. 73 | @discussion This method returns YES when some prefix of the substring matches the input string. 74 | */ 75 | -(BOOL)lookingAt:(unsigned)idx; 76 | 77 | /*! 78 | @method pattern 79 | @abstract Returns the pattern for this matcher. 80 | @discussion 81 | */ 82 | -(ICUPattern *)pattern; 83 | -(void)setPattern:(ICUPattern *)p; 84 | 85 | /*! 86 | @method matches 87 | @abstract Returns YES if the patterns matches the entire input string. 88 | @discussion 89 | */ 90 | -(BOOL)matches; 91 | 92 | /*! 93 | @method replaceAllWithString: 94 | @abstract Replaces all occurrences of the pattern with the replacement string and returns the resulting string. 95 | @discussion The replacement string can contain references to capture groups taking the form or $1, $2, etc. 96 | */ 97 | -(NSString *)replaceAllWithString:(NSString *)aReplacementString; 98 | 99 | /*! 100 | @method replaceFirstWithString: 101 | @abstract Replaces the first occurrence of the pattern with the given replacement string and returns the resulting string. 102 | @discussion The replacement string can contain references to capture groups taking the form or $1, $2, etc. 103 | */ 104 | -(NSString *)replaceFirstWithString:(NSString *)aReplacementString; 105 | 106 | /*! 107 | @method reset 108 | @abstract Resets any state associated with the matcher and its pattern. 109 | @discussion 110 | */ 111 | -(void)reset; 112 | 113 | /*! 114 | @method rangeOfMatch 115 | @abstract Returns the range of the input string that corresponds to the current match. 116 | @discussion 117 | */ 118 | -(NSRange)rangeOfMatch; 119 | 120 | /*! 121 | @method rangeOfMatchGroup: 122 | @abstract Returns the range of the input string that corresponds to the specified capture group of the current match. 123 | @discussion 124 | */ 125 | -(NSRange)rangeOfMatchGroup:(unsigned)groupNumber; 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /ICUPattern.h: -------------------------------------------------------------------------------- 1 | // 2 | // ICUPattern.h 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/19/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ICUMatcher; 12 | 13 | /** 14 | * flags. see http://icu.sourceforge.net/apiref/icu4c/uregex_8h.html#874989dfec4cbeb6baf4d1a51cb529ae 15 | */ 16 | extern const unsigned ICUCaseInsensitiveMatching; 17 | extern const unsigned ICUComments; 18 | extern const unsigned ICUDotMatchesAll; 19 | extern const unsigned ICUMultiline; 20 | extern const unsigned ICUUnicodeWordBoundaries; 21 | 22 | /*! 23 | @class ICUPattern 24 | @abstract A compiled regular expression. 25 | @discussion ICU provides a widely used Unicode 26 | regular expression library. This class can be roughly mapped to the ICU C++ Pattern class. Notes about ICU regular expressions can be found at the 27 | ICU User Guide. 28 | */ 29 | @interface ICUPattern: NSObject { 30 | void *re; 31 | void *textToSearch; 32 | unsigned flags; 33 | NSString *stringToSearch; 34 | } 35 | 36 | /*! 37 | @method patternWithString:flags: 38 | @abstract Returns an autoreleased pattern with the specified flags set. 39 | @discussion Flags are defined as the OR of the constants defined in the class. 40 | */ 41 | +(ICUPattern *)patternWithString:(NSString *)aPattern flags:(unsigned)flags; 42 | 43 | /*! 44 | @method patternWithString: 45 | @abstract Returns an autoreleased pattern with the default flags. 46 | @discussion Flags are given by 0. 47 | */ 48 | +(ICUPattern *)patternWithString:(NSString *)aPattern; 49 | 50 | /*! 51 | @method initWithString:flags: 52 | @abstract Returns a pattern with the specified flags set. 53 | @discussion Flags are defined as the OR of the constants defined in the class. 54 | */ 55 | -(id)initWithString:(NSString *)aPattern flags:(unsigned)flags; 56 | 57 | /*! 58 | @method initWithString: 59 | @abstract Returns a pattern with the specified flags set. 60 | @discussion Flags are defined as 0. 61 | */ 62 | -(id)initWithString:(NSString *)aPattern; 63 | 64 | /*! 65 | @method componentsSplitFromString: 66 | @abstract Splits the input string into fields delineated by the expression given by the pattern. 67 | @discussion Returns an empty array if the pattern is not found. 68 | */ 69 | -(NSArray *)componentsSplitFromString:(NSString *)stringToSplit; 70 | 71 | /*! 72 | @method matchesString: 73 | @abstract Returns YES if the pattern matches the entire input string. 74 | @discussion Returns YES if the pattern matches the entire input string. 75 | */ 76 | -(BOOL)matchesString:(NSString *)stringToMatchAgainst; 77 | 78 | /*! 79 | @method pattern 80 | @abstract Returns the string representing the regular expression of this pattern. 81 | @discussion Returns the string representing the regular expression of this pattern. 82 | */ 83 | -(NSString *)pattern; 84 | 85 | /*! 86 | @method setStringToSearch: 87 | @abstract Sets the string that is being searched by this pattern. 88 | @discussion This method also resets any internal state of the pattern. 89 | */ 90 | -(void)setStringToSearch:(NSString *)aStringToSearchOver; 91 | 92 | /*! 93 | @method stringToSearch 94 | @abstract Returns the string that is being searched over with the pattern. 95 | @discussion This method creates an NSString from the underlying UTF16 character array used by ICU. For large 96 | strings, this may be memory-intensive/time-consuming. Performance-critical applications may want to modify this 97 | class to suite their needs to reduce the number of NSString objects that are created. 98 | */ 99 | -(NSString *)stringToSearch; 100 | 101 | /*! 102 | @method reset 103 | @abstract Resets the pattern. 104 | @discussion Patterns maintain state about the current match and this method resets that state. 105 | */ 106 | -(void)reset; 107 | 108 | /*! 109 | @method re 110 | @abstract Returns the compiled ICU URegularExpression for this pattern. 111 | @discussion This method primarily exists to allow the ICUMatcher to access the pattern. 112 | */ 113 | -(void *)re; 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /MGSBreakpointDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSBreakpointDelegate.h 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 3/5/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol MGSBreakpointDelegate 12 | 13 | - (void) toggleBreakpointForFile:(NSString*)file onLine:(int)line; 14 | - (NSSet*) breakpointsForFile:(NSString*)file; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /MGSExtraInterfaceController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | 23 | @interface MGSExtraInterfaceController : NSObject { 24 | 25 | IBOutlet NSTextField *spacesTextFieldEntabWindow; 26 | IBOutlet NSTextField *spacesTextFieldDetabWindow; 27 | IBOutlet NSTextField *lineTextFieldGoToLineWindow; 28 | IBOutlet NSWindow *entabWindow; 29 | IBOutlet NSWindow *detabWindow; 30 | IBOutlet NSWindow *goToLineWindow; 31 | 32 | IBOutlet NSView *openPanelAccessoryView; 33 | IBOutlet NSPopUpButton *openPanelEncodingsPopUp; 34 | //IBOutlet NSView *printAccessoryView; 35 | 36 | IBOutlet NSWindow *commandResultWindow; 37 | IBOutlet NSTextView *commandResultTextView; 38 | 39 | IBOutlet NSWindow *projectWindow; 40 | IBOutlet NSPanel *regularExpressionsHelpPanel; 41 | } 42 | 43 | 44 | @property (readonly) IBOutlet NSView *openPanelAccessoryView; 45 | @property (readonly) IBOutlet NSPopUpButton *openPanelEncodingsPopUp; 46 | @property (readonly) IBOutlet NSWindow *commandResultWindow; 47 | @property (readonly) IBOutlet NSTextView *commandResultTextView; 48 | @property (readonly) IBOutlet NSWindow *projectWindow; 49 | 50 | - (void)displayEntab; 51 | - (void)displayDetab; 52 | - (IBAction)entabButtonEntabWindowAction:(id)sender; 53 | - (IBAction)detabButtonDetabWindowAction:(id)sender; 54 | - (IBAction)cancelButtonEntabDetabGoToLineWindowsAction:(id)sender; 55 | - (void)displayGoToLine; 56 | - (IBAction)goButtonGoToLineWindowAction:(id)sender; 57 | 58 | - (NSPopUpButton *)openPanelEncodingsPopUp; 59 | - (NSView *)openPanelAccessoryView; 60 | - (NSWindow *)commandResultWindow; 61 | - (NSTextView *)commandResultTextView; 62 | - (void)showCommandResultWindow; 63 | - (void)showRegularExpressionsHelpPanel; 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /MGSFragaria-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.mugginsoft.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | FMWK 15 | CFBundleShortVersionString 16 | 1.0.1 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /MGSFragaria.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MGSFragaria.h 3 | * Fragaria 4 | * 5 | * Created by Jonathan on 30/04/2010. 6 | * Copyright 2010 mugginsoft.com. All rights reserved. 7 | * 8 | */ 9 | 10 | // valid keys for 11 | // - (void)setObject:(id)object forKey:(id)key; 12 | // - (id)objectForKey:(id)key; 13 | 14 | // BOOL 15 | extern NSString * const MGSFOIsSyntaxColoured; 16 | extern NSString * const MGSFOShowLineNumberGutter; 17 | extern NSString * const MGSFOIsEdited; 18 | 19 | // string 20 | extern NSString * const MGSFOSyntaxDefinitionName; 21 | extern NSString * const MGSFODocumentName; 22 | 23 | // integer 24 | extern NSString * const MGSFOGutterWidth; 25 | 26 | // NSView * 27 | extern NSString * const ro_MGSFOTextView; // readonly 28 | extern NSString * const ro_MGSFOScrollView; // readonly 29 | extern NSString * const ro_MGSFOGutterScrollView; // readonly 30 | 31 | // NSObject 32 | extern NSString * const MGSFODelegate; 33 | extern NSString * const MGSFOBreakpointDelegate; 34 | extern NSString * const MGSFOAutoCompleteDelegate; 35 | extern NSString * const MGSFOSyntaxColouringDelegate; 36 | extern NSString * const ro_MGSFOLineNumbers; // readonly 37 | extern NSString * const ro_MGSFOSyntaxColouring; // readonly 38 | 39 | @class MGSExtraInterfaceController; 40 | 41 | #import "MGSFragariaPreferences.h" 42 | #import "MGSBreakpointDelegate.h" 43 | #import "SMLSyntaxError.h" 44 | #import "SMLSyntaxColouringDelegate.h" 45 | #import "SMLSyntaxDefinition.h" 46 | #import "MGSTextMenuController.h" 47 | 48 | @protocol MGSFragariaTextViewDelegate 49 | @optional 50 | - (void)mgsTextDidPaste:(NSNotification *)note; 51 | @end 52 | 53 | @interface MGSFragaria : NSObject 54 | { 55 | @private 56 | MGSExtraInterfaceController *extraInterfaceController; 57 | id docSpec; 58 | NSSet* objectGetterKeys; 59 | NSSet* objectSetterKeys; 60 | } 61 | 62 | @property (nonatomic, readonly) MGSExtraInterfaceController *extraInterfaceController; 63 | @property (nonatomic, strong) id docSpec; 64 | 65 | // class methods 66 | + (id)currentInstance; 67 | + (void)setCurrentInstance:(MGSFragaria *)anInstance; 68 | + (void)initializeFramework; 69 | + (id)createDocSpec; 70 | + (void)docSpec:(id)docSpec setString:(NSString *)string; 71 | + (void)docSpec:(id)docSpec setString:(NSString *)string options:(NSDictionary *)options; 72 | + (void)docSpec:(id)docSpec setAttributedString:(NSAttributedString *)string; 73 | + (void)docSpec:(id)docSpec setAttributedString:(NSAttributedString *)string options:(NSDictionary *)options; 74 | + (NSString *)stringForDocSpec:(id)docSpec; 75 | + (NSAttributedString *)attributedStringForDocSpec:(id)docSpec; 76 | + (NSAttributedString *)attributedStringWithTemporaryAttributesAppliedForDocSpec:(id)docSpec; 77 | 78 | // instance methods 79 | - (id)initWithObject:(id)object; 80 | - (void)setObject:(id)object forKey:(id)key; 81 | - (id)objectForKey:(id)key; 82 | - (void)embedInView:(NSView *)view; 83 | - (void)setString:(NSString *)aString; 84 | - (void)setString:(NSString *)aString options:(NSDictionary *)options; 85 | - (void)setAttributedString:(NSAttributedString *)aString; 86 | - (void)setAttributedString:(NSAttributedString *)aString options:(NSDictionary *)options; 87 | - (NSAttributedString *)attributedString; 88 | - (NSAttributedString *)attributedStringWithTemporaryAttributesApplied; 89 | - (NSString *)string; 90 | - (NSTextView *)textView; 91 | - (MGSTextMenuController *)textMenuController; 92 | - (void)setSyntaxColoured:(BOOL)value; 93 | - (BOOL)isSyntaxColoured; 94 | - (void)setShowsLineNumbers:(BOOL)value; 95 | - (BOOL)showsLineNumbers; 96 | - (void)reloadString; 97 | - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)text options:(NSDictionary *)options; 98 | - (void)setSyntaxErrors:(NSArray *)errors; 99 | - (NSArray *)syntaxErrors; 100 | + (NSImage *)imageNamed:(NSString *)name; 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /MGSFragariaFontsAndColoursPrefsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaFontsAndColoursPrefsViewController.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 14/09/2012. 6 | // 7 | // 8 | 9 | #import 10 | #import "MGSFragariaPrefsViewController.h" 11 | 12 | @interface MGSFragariaFontsAndColoursPrefsViewController : MGSFragariaPrefsViewController 13 | 14 | - (IBAction)setFontAction:(id)sender; 15 | - (void)changeFont:(id)sender; 16 | @end 17 | -------------------------------------------------------------------------------- /MGSFragariaFontsAndColoursPrefsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaFontsAndColoursPrefsViewController.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 14/09/2012. 6 | // 7 | // 8 | 9 | #import "MGSFragaria.h" 10 | #import "MGSFragariaFramework.h" 11 | 12 | @interface MGSFragariaFontsAndColoursPrefsViewController () 13 | 14 | @end 15 | 16 | @implementation MGSFragariaFontsAndColoursPrefsViewController 17 | 18 | /* 19 | 20 | - init 21 | 22 | */ 23 | - (id)init { 24 | self = [super initWithNibName:@"MGSPreferencesFontsAndColours" bundle:[NSBundle bundleForClass:[self class]]]; 25 | if (self) { 26 | 27 | } 28 | return self; 29 | } 30 | 31 | /* 32 | 33 | - setFontAction: 34 | 35 | */ 36 | - (IBAction)setFontAction:(id)sender 37 | { 38 | #pragma unused(sender) 39 | 40 | NSFontManager *fontManager = [NSFontManager sharedFontManager]; 41 | NSData *fontData = [[[NSUserDefaultsController sharedUserDefaultsController] values] valueForKey:MGSFragariaPrefsTextFont]; 42 | NSFont *font = [NSUnarchiver unarchiveObjectWithData:fontData]; 43 | [fontManager setSelectedFont:font isMultiple:NO]; 44 | [fontManager orderFrontFontPanel:nil]; 45 | 46 | } 47 | 48 | /* 49 | 50 | - changeFont: 51 | 52 | */ 53 | - (void)changeFont:(id)sender 54 | { 55 | 56 | /* changeFont: is sent up the responder chain by the fontManager so we have to call this 57 | method from say the preferences window controller which has been configured as the window delegate */ 58 | NSFontManager *fontManager = sender; 59 | NSFont *panelFont = [fontManager convertFont:[fontManager selectedFont]]; 60 | [SMLDefaults setValue:[NSArchiver archivedDataWithRootObject:panelFont] forKey:MGSFragariaPrefsTextFont]; 61 | } 62 | @end 63 | -------------------------------------------------------------------------------- /MGSFragariaFramework.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MGSFragariaFramework.h 3 | * Fragaria 4 | * 5 | * Created by Jonathan on 06/05/2010. 6 | * Copyright 2010 mugginsoft.com. All rights reserved. 7 | * 8 | */ 9 | #import "SMLStandardHeader.h" 10 | #import "SMLSyntaxColouring.h" 11 | #import "SMLTextView.h" 12 | #import "SMLLayoutManager.h" 13 | #import "SMLLineNumbers.h" 14 | #import "SMLGutterTextView.h" 15 | #import "SMLTextPerformer.h" 16 | #import "MGSExtraInterfaceController.h" 17 | #import "SMLBasicPerformer.h" 18 | #import "MGSTextMenuController.h" 19 | #import "ICUPattern.h" 20 | #import "ICUMatcher.h" 21 | #import "NSStringICUAdditions.h" 22 | #import "MGSPreferencesController.h" 23 | #import "MGSSyntaxController.h" 24 | #import "NSScanner+Fragaria.h" 25 | #import "MGSFragariaPreferences.h" 26 | #import "MGSGlyphGenerator.h" 27 | #import "MGSFragariaPreferences.h" 28 | #import "SMLErrorPopOver.h" 29 | #import "SMLAutoCompleteDelegate.h" 30 | -------------------------------------------------------------------------------- /MGSFragariaPreferences.h: -------------------------------------------------------------------------------- 1 | /* 2 | * MGSFragariaPreferences.h 3 | * Fragaria 4 | * 5 | * Created by Jonathan on 06/05/2010. 6 | * Copyright 2010 mugginsoft.com. All rights reserved. 7 | * 8 | */ 9 | 10 | // Fragraria preference keys by type 11 | 12 | // color data 13 | // [NSArchiver archivedDataWithRootObject:[NSColor whiteColor]] 14 | extern NSString * const MGSFragariaPrefsCommandsColourWell; 15 | extern NSString * const MGSFragariaPrefsCommentsColourWell; 16 | extern NSString * const MGSFragariaPrefsInstructionsColourWell; 17 | extern NSString * const MGSFragariaPrefsKeywordsColourWell; 18 | extern NSString * const MGSFragariaPrefsAutocompleteColourWell; 19 | extern NSString * const MGSFragariaPrefsVariablesColourWell; 20 | extern NSString * const MGSFragariaPrefsStringsColourWell; 21 | extern NSString * const MGSFragariaPrefsAttributesColourWell; 22 | extern NSString * const MGSFragariaPrefsBackgroundColourWell; 23 | extern NSString * const MGSFragariaPrefsTextColourWell; 24 | extern NSString * const MGSFragariaPrefsGutterTextColourWell; 25 | extern NSString * const MGSFragariaPrefsInvisibleCharactersColourWell; 26 | extern NSString * const MGSFragariaPrefsHighlightLineColourWell; 27 | extern NSString * const MGSFragariaPrefsNumbersColourWell; 28 | 29 | // bool 30 | extern NSString * const MGSFragariaPrefsColourNumbers; 31 | extern NSString * const MGSFragariaPrefsColourCommands; 32 | extern NSString * const MGSFragariaPrefsColourComments; 33 | extern NSString * const MGSFragariaPrefsColourInstructions; 34 | extern NSString * const MGSFragariaPrefsColourKeywords; 35 | extern NSString * const MGSFragariaPrefsColourAutocomplete; 36 | extern NSString * const MGSFragariaPrefsColourVariables; 37 | extern NSString * const MGSFragariaPrefsColourStrings; 38 | extern NSString * const MGSFragariaPrefsColourAttributes; 39 | extern NSString * const MGSFragariaPrefsShowFullPathInWindowTitle; 40 | extern NSString * const MGSFragariaPrefsShowLineNumberGutter; 41 | extern NSString * const MGSFragariaPrefsSyntaxColourNewDocuments; 42 | extern NSString * const MGSFragariaPrefsLineWrapNewDocuments; 43 | extern NSString * const MGSFragariaPrefsIndentNewLinesAutomatically; 44 | extern NSString * const MGSFragariaPrefsOnlyColourTillTheEndOfLine; 45 | extern NSString * const MGSFragariaPrefsShowMatchingBraces; 46 | extern NSString * const MGSFragariaPrefsShowInvisibleCharacters; 47 | extern NSString * const MGSFragariaPrefsIndentWithSpaces; 48 | extern NSString * const MGSFragariaPrefsColourMultiLineStrings; 49 | extern NSString * const MGSFragariaPrefsAutocompleteSuggestAutomatically; 50 | extern NSString * const MGSFragariaPrefsAutocompleteIncludeStandardWords; 51 | extern NSString * const MGSFragariaPrefsAutoSpellCheck; 52 | extern NSString * const MGSFragariaPrefsAutoGrammarCheck; 53 | extern NSString * const MGSFragariaPrefsSmartInsertDelete; 54 | extern NSString * const MGSFragariaPrefsAutomaticLinkDetection; 55 | extern NSString * const MGSFragariaPrefsAutomaticQuoteSubstitution; 56 | extern NSString * const MGSFragariaPrefsUseTabStops; 57 | extern NSString * const MGSFragariaPrefsHighlightCurrentLine; 58 | extern NSString * const MGSFragariaPrefsAutomaticallyIndentBraces; 59 | extern NSString * const MGSFragariaPrefsAutoInsertAClosingParenthesis; 60 | extern NSString * const MGSFragariaPrefsAutoInsertAClosingBrace; 61 | extern NSString * const MGSFragariaPrefsShowPageGuide; 62 | 63 | // integer 64 | extern NSString * const MGSFragariaPrefsGutterWidth; 65 | extern NSString * const MGSFragariaPrefsTabWidth; 66 | extern NSString * const MGSFragariaPrefsIndentWidth; 67 | extern NSString * const MGSFragariaPrefsShowPageGuideAtColumn; 68 | extern NSString * const MGSFragariaPrefsSpacesPerTabEntabDetab; 69 | 70 | // float 71 | extern NSString * const MGSFragariaPrefsAutocompleteAfterDelay; 72 | 73 | // font data 74 | // [NSArchiver archivedDataWithRootObject:[NSFont fontWithName:@"Menlo" size:11]] 75 | extern NSString * const MGSFragariaPrefsTextFont; 76 | 77 | // string 78 | extern NSString * const MGSFragariaPrefsSyntaxColouringPopUpString; 79 | 80 | #import "MGSFragariaPrefsViewController.h" 81 | #import "MGSFragariaFontsAndColoursPrefsViewController.h" 82 | #import "MGSFragariaTextEditingPrefsViewController.h" 83 | 84 | @interface MGSFragariaPreferences : NSObject { 85 | 86 | MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; 87 | MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; 88 | } 89 | + (void)initializeValues; 90 | + (MGSFragariaPreferences *)sharedInstance; 91 | - (void)changeFont:(id)sender; 92 | - (void)revertToStandardSettings:(id)sender; 93 | 94 | @property (readonly) MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; 95 | @property (readonly) MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; 96 | 97 | @end 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /MGSFragariaPrefsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaPrefsViewController.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 22/10/2012. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface MGSFragariaPrefsViewController : NSViewController 12 | - (BOOL)commitEditingAndDiscard:(BOOL)discard; 13 | @end 14 | -------------------------------------------------------------------------------- /MGSFragariaPrefsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaPrefsViewController.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 22/10/2012. 6 | // 7 | // 8 | 9 | #import "MGSFragariaPrefsViewController.h" 10 | 11 | @interface MGSFragariaPrefsViewController () 12 | 13 | @end 14 | 15 | @implementation MGSFragariaPrefsViewController 16 | 17 | /* 18 | 19 | - commitEditingAndDiscard: 20 | 21 | */ 22 | - (BOOL)commitEditingAndDiscard:(BOOL)discard 23 | { 24 | BOOL commit = YES; 25 | 26 | // commit edits, discarding changes on error 27 | if (![[NSUserDefaultsController sharedUserDefaultsController] commitEditing]) { 28 | if (discard) [[NSUserDefaultsController sharedUserDefaultsController] discardEditing]; 29 | commit = NO; 30 | } 31 | 32 | return commit; 33 | } 34 | 35 | #pragma mark - 36 | #pragma mark NSTabViewDelegate 37 | 38 | /* 39 | 40 | - tabView:shouldSelectTabViewItem: 41 | 42 | */ 43 | - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem 44 | { 45 | #pragma unused(tabView) 46 | #pragma unused(tabViewItem) 47 | BOOL select = YES; 48 | 49 | // if we have un committed edits then disallow tab item selection 50 | if (![self commitEditingAndDiscard:NO]) { 51 | select = NO; 52 | } 53 | 54 | return select; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /MGSFragariaTextEditingPrefsViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaTextEditingPrefsViewController.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 14/09/2012. 6 | // 7 | // 8 | 9 | #import 10 | #import "MGSFragariaPrefsViewController.h" 11 | 12 | @interface MGSFragariaTextEditingPrefsViewController : MGSFragariaPrefsViewController { 13 | NSImage *toolbarImage; 14 | } 15 | 16 | - (IBAction)changeGutterWidth:(id)sender; 17 | @end 18 | -------------------------------------------------------------------------------- /MGSFragariaTextEditingPrefsViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MGSFragariaTextEditingPrefsViewController.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 14/09/2012. 6 | // 7 | // 8 | 9 | #import "MGSFragariaTextEditingPrefsViewController.h" 10 | #import "MGSFragariaFramework.h" 11 | 12 | @interface MGSFragariaTextEditingPrefsViewController () 13 | 14 | @end 15 | 16 | @implementation MGSFragariaTextEditingPrefsViewController 17 | 18 | /* 19 | 20 | - init 21 | 22 | */ 23 | - (id)init { 24 | self = [super initWithNibName:@"MGSPreferencesTextEditing" bundle:[NSBundle bundleForClass:[self class]]]; 25 | if (self) { 26 | 27 | } 28 | return self; 29 | } 30 | 31 | /* 32 | 33 | - changeGutterWidth: 34 | 35 | */ 36 | - (IBAction)changeGutterWidth:(id)sender { 37 | #pragma unused(sender) 38 | 39 | /*NSEnumerator *documentEnumerator = [[[FRACurrentProject documentsArrayController] arrangedObjects] objectEnumerator]; 40 | for (id document in documentEnumerator) { 41 | [FRAInterface updateGutterViewForDocument:document]; 42 | [[document valueForKey:ro_MGSFOLineNumbers] updateLineNumbersCheckWidth:YES recolour:YES]; 43 | }*/ 44 | } 45 | 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /MGSGlyphGenerator.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSGlyphGenerator.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 23/09/2012. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface MGSGlyphGenerator : NSGlyphGenerator { 12 | id _destination; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /MGSGlyphGenerator.m: -------------------------------------------------------------------------------- 1 | // 2 | // MGSGlyphGenerator.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 23/09/2012. 6 | // 7 | // 8 | 9 | #import "MGSGlyphGenerator.h" 10 | 11 | @implementation MGSGlyphGenerator 12 | 13 | /* 14 | 15 | - generateGlyphsForGlyphStorage:desiredNumberOfCharacters:glyphIndex:characterIndex: 16 | 17 | */ 18 | - (void)generateGlyphsForGlyphStorage:(id )glyphStorage 19 | desiredNumberOfCharacters:(NSUInteger)nChars 20 | glyphIndex:(NSUInteger *)glyphIndex 21 | characterIndex:(NSUInteger *)charIndex 22 | { 23 | NSGlyphGenerator *instance = [NSGlyphGenerator sharedGlyphGenerator]; 24 | 25 | _destination = glyphStorage; 26 | [instance generateGlyphsForGlyphStorage:self desiredNumberOfCharacters:nChars glyphIndex:glyphIndex characterIndex:charIndex]; 27 | _destination = nil; 28 | } 29 | 30 | /* 31 | 32 | - insertGlyphs:length:forStartingGlyphAtIndex:characterIndex: 33 | 34 | see https://svn.r-project.org/R-packages/trunk/Mac-GUI/RScriptEditorGlyphGenerator.m 35 | 36 | */ 37 | - (void)insertGlyphs:(const NSGlyph *)glyphs 38 | length:(NSUInteger)length 39 | forStartingGlyphAtIndex:(NSUInteger)glyphIndex 40 | characterIndex:(NSUInteger)charIndex 41 | { 42 | 43 | // this is calling the layoutmanager method so glyph substitution can be performed there also 44 | [_destination insertGlyphs:glyphs 45 | length:length 46 | forStartingGlyphAtIndex:glyphIndex 47 | characterIndex:charIndex]; 48 | } 49 | 50 | /* 51 | 52 | - attributedString 53 | 54 | */ 55 | - (NSAttributedString *)attributedString 56 | { 57 | return [_destination attributedString]; 58 | } 59 | 60 | /* 61 | 62 | - layoutOptions 63 | 64 | */ 65 | - (NSUInteger)layoutOptions 66 | { 67 | return [_destination layoutOptions]; 68 | } 69 | 70 | /* 71 | 72 | - setIntAttribute:value:forGlyphAtIndex: 73 | 74 | */ 75 | - (void)setIntAttribute:(NSInteger)attributeTag value:(NSInteger)val forGlyphAtIndex:(NSUInteger)glyphIndex 76 | { 77 | [_destination setIntAttribute:attributeTag value:val forGlyphAtIndex:glyphIndex]; 78 | } 79 | @end 80 | -------------------------------------------------------------------------------- /MGSPreferencesController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSPreferencesController.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 30/04/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MGSFragariaPreferences.h" 11 | #import "DBPrefsWindowController.h" 12 | 13 | @interface MGSPreferencesController : DBPrefsWindowController { 14 | IBOutlet NSView *generalView; 15 | MGSFragariaFontsAndColoursPrefsViewController *fontsAndColoursPrefsViewController; 16 | MGSFragariaTextEditingPrefsViewController *textEditingPrefsViewController; 17 | NSString *toolbarIdentifier; 18 | NSString *generalIdentifier; 19 | NSString *textIdentifier; 20 | NSString *fontIdentifier; 21 | 22 | } 23 | - (IBAction)revertToStandardSettings:(id)sender; 24 | @end 25 | -------------------------------------------------------------------------------- /MGSPreferencesController.m: -------------------------------------------------------------------------------- 1 | // 2 | // MGSPreferencesController.m 3 | // KosmicEditor 4 | // 5 | // Created by Jonathan on 30/04/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import "MGSFragariaFramework.h" 10 | 11 | @interface MGSPreferencesController() 12 | - (BOOL)commitEditingAndDiscard:(BOOL)discard; 13 | @end 14 | 15 | @implementation MGSPreferencesController 16 | 17 | #pragma mark - 18 | #pragma mark Instance methods 19 | 20 | /* 21 | 22 | -initWithWindow: is the designated initializer for NSWindowController. 23 | 24 | */ 25 | - (id)initWithWindow:(NSWindow *)window 26 | { 27 | #pragma unused(window) 28 | 29 | self = [super initWithWindow:window]; 30 | if (self) { 31 | 32 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowWillClose:) name:NSWindowWillCloseNotification object:window]; 33 | 34 | } 35 | return self; 36 | } 37 | 38 | 39 | /* 40 | 41 | - showWindow: 42 | 43 | */ 44 | - (void)showWindow:(id)sender 45 | { 46 | // load view controllers 47 | textEditingPrefsViewController = [MGSFragariaPreferences sharedInstance].textEditingPrefsViewController; 48 | 49 | fontsAndColoursPrefsViewController = [MGSFragariaPreferences sharedInstance].fontsAndColoursPrefsViewController; 50 | 51 | [super showWindow:sender]; 52 | } 53 | 54 | /* 55 | 56 | - setupToolbar 57 | 58 | */ 59 | - (void)setupToolbar 60 | { 61 | generalIdentifier = NSLocalizedString(@"General", @"Preferences tab name"); 62 | textIdentifier = NSLocalizedString(@"Text Editing", @"Preferences tab name"); 63 | fontIdentifier = NSLocalizedString(@"Fonts & Colours", @"Preferences tab name"); 64 | 65 | [self addView:generalView label:generalIdentifier]; 66 | 67 | [self addView:textEditingPrefsViewController.view label:textIdentifier image:[NSImage imageNamed:@"General.png"]]; 68 | 69 | [self addView:fontsAndColoursPrefsViewController.view label:fontIdentifier image:[NSImage imageNamed:@"General.png"]]; 70 | 71 | } 72 | 73 | /* 74 | 75 | - changeFont: 76 | 77 | */ 78 | - (void)changeFont:(id)sender 79 | { 80 | /* NSFontManager will send this method up the responder chain */ 81 | [fontsAndColoursPrefsViewController changeFont:sender]; 82 | } 83 | 84 | /* 85 | 86 | - revertToStandardSettings: 87 | 88 | */ 89 | - (void)revertToStandardSettings:(id)sender 90 | { 91 | [[MGSFragariaPreferences sharedInstance] revertToStandardSettings:sender]; 92 | } 93 | 94 | /* 95 | 96 | - commitEditingAndDiscard: 97 | 98 | */ 99 | - (BOOL)commitEditingAndDiscard:(BOOL)discard 100 | { 101 | BOOL commit = YES; 102 | 103 | if ([toolbarIdentifier isEqual:textIdentifier]) { 104 | if (![textEditingPrefsViewController commitEditingAndDiscard:discard]) { 105 | commit = NO; 106 | } 107 | } else if ([toolbarIdentifier isEqual:fontIdentifier]) { 108 | if (![fontsAndColoursPrefsViewController commitEditingAndDiscard:discard]) { 109 | commit = NO; 110 | } 111 | 112 | } else { 113 | 114 | // commit edits, discarding changes on error 115 | if (![[NSUserDefaultsController sharedUserDefaultsController] commitEditing]) { 116 | if (discard) [[NSUserDefaultsController sharedUserDefaultsController] discardEditing]; 117 | commit = NO; 118 | } 119 | } 120 | 121 | return commit; 122 | } 123 | 124 | /* 125 | 126 | - windowWillClose 127 | 128 | */ 129 | - (void)windowWillClose:(NSNotification *)notification 130 | { 131 | if ([notification object] != [self window]) { 132 | return; 133 | } 134 | 135 | // commit editing, discard any uncommitted changes 136 | [self commitEditingAndDiscard:YES]; 137 | } 138 | 139 | 140 | /* 141 | 142 | - displayViewForIdentifier:animate: 143 | 144 | */ 145 | - (void)displayViewForIdentifier:(NSString *)identifier animate:(BOOL)animate 146 | { 147 | // look for uncommitted changes 148 | if (![self commitEditingAndDiscard:NO] && toolbarIdentifier) { 149 | 150 | // we have uncommited changes, reselect the tool bar item 151 | [[[self window] toolbar] setSelectedItemIdentifier:toolbarIdentifier]; 152 | } else { 153 | [super displayViewForIdentifier:identifier animate:animate]; 154 | } 155 | 156 | toolbarIdentifier = identifier; 157 | } 158 | 159 | @end 160 | -------------------------------------------------------------------------------- /MGSSyntaxController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MGSSyntaxController.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 01/05/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface MGSSyntaxController : NSObject { 13 | 14 | NSArray *syntaxDefinitionNames; 15 | NSMutableDictionary *syntaxDefinitions; 16 | } 17 | 18 | + (instancetype)sharedInstance; 19 | + (NSString *)standardSyntaxDefinitionName; 20 | - (NSArray *)syntaxDefinitionNames; 21 | - (void)insertSyntaxDefinitions; 22 | - (NSDictionary *)syntaxDictionaryWithName:(NSString *)name; 23 | - (NSDictionary *)syntaxDefinitionWithExtension:(NSString *)extension; 24 | - (NSString *)syntaxDefinitionNameWithExtension:(NSString *)extension; 25 | 26 | @property (strong, nonatomic,readonly) NSArray *syntaxDefinitionNames; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /MGSTextMenuController.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | @interface MGSTextMenuController : NSObject 23 | { 24 | //NSArray *availableEncodingsArray; 25 | 26 | IBOutlet NSMenu *textEncodingMenu; 27 | IBOutlet NSMenu *reloadTextWithEncodingMenu; 28 | IBOutlet NSMenu *syntaxDefinitionMenu; 29 | } 30 | 31 | + (MGSTextMenuController *)sharedInstance; 32 | 33 | - (void)buildEncodingsMenus; 34 | - (void)buildSyntaxDefinitionsMenu; 35 | 36 | - (void)changeEncodingAction:(id)sender; 37 | 38 | - (IBAction)removeNeedlessWhitespaceAction:(id)sender; 39 | - (IBAction)detabAction:(id)sender; 40 | - (IBAction)entabAction:(id)sender; 41 | - (void)performEntab; 42 | - (void)performDetab; 43 | - (IBAction)shiftLeftAction:(id)sender; 44 | - (IBAction)shiftRightAction:(id)sender; 45 | - (IBAction)toLowercaseAction:(id)sender; 46 | - (IBAction)toUppercaseAction:(id)sender; 47 | - (IBAction)capitaliseAction:(id)sender; 48 | - (IBAction)goToLineAction:(id)sender; 49 | - (void)performGoToLine:(NSInteger)lineToGoTo; 50 | - (IBAction)closeTagAction:(id)sender; 51 | - (IBAction)toggleBreakpointAction:(id)sender; 52 | - (IBAction)commentOrUncommentAction:(id)sender; 53 | - (IBAction)emptyDummyAction:(id)sender; 54 | - (IBAction)removeLineEndingsAction:(id)sender; 55 | - (IBAction)changeLineEndingsAction:(id)sender; 56 | - (IBAction)interchangeAdjacentCharactersAction:(id)sender; 57 | - (IBAction)prepareForXMLAction:(id)sender; 58 | 59 | - (IBAction)changeSyntaxDefinitionAction:(id)sender; 60 | @end 61 | -------------------------------------------------------------------------------- /MyDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // MyDocument.h 3 | // Fragaria Document 4 | // 5 | // Created by Jonathan on 24/07/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @class MGSFragaria; 13 | 14 | @interface MyDocument : NSDocument { 15 | IBOutlet NSView *editView; 16 | MGSFragaria *fragaria; 17 | BOOL isEdited; 18 | } 19 | 20 | - (void)setSyntaxDefinition:(NSString *)name; 21 | - (NSString *)syntaxDefinition; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /NSScanner+Fragaria.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSScanner+Fragaria.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 12/08/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSScanner (Fragaria) 13 | - (void)mgs_setScanLocation:(NSUInteger)idx; 14 | @end 15 | -------------------------------------------------------------------------------- /NSScanner+Fragaria.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSScanner+Fragaria.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 12/08/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import "NSScanner+Fragaria.h" 10 | 11 | 12 | @implementation NSScanner (Fragaria) 13 | 14 | /* 15 | 16 | mgs_setScanLocation: 17 | 18 | */ 19 | - (void)mgs_setScanLocation:(NSUInteger)idx 20 | { 21 | /* 22 | 23 | NSScanner raises if the index is beyond the end of the string. 24 | 25 | */ 26 | NSUInteger maxIndex = [[self string] length]; 27 | if (idx > maxIndex) { 28 | NSLog(@"Invalid scan location %lu > max of %lu", (long)idx, (long)maxIndex); 29 | idx = maxIndex; 30 | } 31 | 32 | [self setScanLocation:idx]; 33 | } 34 | @end 35 | -------------------------------------------------------------------------------- /NSStringICUAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSStringICUAdditions.h 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/19/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import 10 | @class ICUPattern; 11 | 12 | @interface NSString (NSStringICUAdditions) 13 | 14 | /*! 15 | @method nativeUTF16Encoding 16 | @abstract The native UTF16 encoding on the given machine. 17 | @discussion The native UTF16 encoding on the given machine. 18 | */ 19 | +(NSStringEncoding)nativeUTF16Encoding; 20 | 21 | /*! 22 | @method stringWithICUString: 23 | @abstract Create an NSString from a UTF16 encoded string. 24 | @discussion Create an NSString from a UTF16 encoded string. 25 | */ 26 | +(NSString *)stringWithICUString:(void *)utf16EncodedString; 27 | 28 | /*! 29 | @method UTF16String 30 | @abstract Returns a UTF16 encoded string in the native encoding. 31 | @discussion This string has a retain policy equivalent to UTF8String. In 32 | other words, if you want to keep this string around beyond the given autorelease 33 | context, you need to copy the returned string. 34 | */ 35 | -(void *)UTF16String; 36 | 37 | 38 | /*! 39 | @method copyUTF16String 40 | @abstract returns a copy 41 | @discussion Returns a UTF16 encoded string in the native encoding. The returned 42 | buffer must eventually be freed. 43 | */ 44 | -(void *)copyUTF16String; 45 | 46 | /*! 47 | @method findPattern: 48 | @abstract Finds the given expression and and groups. 49 | @discussion Returns the match and any grouped matches in the returned 50 | array. The first element of the array is the entire match and subsequent 51 | elements are the groups in the order the matches occur. 52 | */ 53 | -(NSArray *)findPattern:(NSString *)aRegex; 54 | 55 | /*! 56 | @method componentsSeparatedByPattern: 57 | @abstract Returns the components separated by the given pattern. 58 | @discussion Break a string into components where components separated 59 | by occurrences of the given pattern. 60 | */ 61 | -(NSArray *)componentsSeparatedByPattern:(NSString *)aRegex; 62 | 63 | /*! 64 | @method replaceOccurrencesOfPattern:withString: 65 | @abstract Replace occurrences of the pattern with the replacement text. 66 | @discussion Replace occurrences of the pattern with the replacement text. 67 | The replacement text may contain backrerferences. 68 | */ 69 | -(NSString *)replaceOccurrencesOfPattern:(NSString *)aPattern withString:(NSString *)replacementText; 70 | 71 | /*! 72 | @method matchesPattern: 73 | @abstract Returns YES if the string matches the entire pattern. 74 | @discussion Returns YES if the string matches the entire pattern. 75 | */ 76 | -(BOOL)matchesPattern:(NSString *)aRegex; 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /NSStringICUAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSStringICUAdditions.m 3 | // CocoaICU 4 | // 5 | // Created by Aaron Evans on 11/19/06. 6 | // Copyright 2006 Aaron Evans. All rights reserved. 7 | // 8 | 9 | #import "NSStringICUAdditions.h" 10 | #import "ICUPattern.h" 11 | #import "ICUMatcher.h" 12 | 13 | struct URegularExpression; 14 | /** 15 | * Structure representing a compiled regular rexpression, plus the results 16 | * of a match operation. 17 | * @draft ICU 3.0 18 | */ 19 | typedef struct URegularExpression URegularExpression; 20 | 21 | #define U_HIDE_DRAFT_API 1 22 | #define U_DISABLE_RENAMING 1 23 | #import 24 | #import 25 | 26 | @interface NSString (NSStringICUPrivateAdditions) 27 | 28 | @end 29 | 30 | @implementation NSString (NSStringICUAdditions) 31 | 32 | -(NSString *)replaceOccurrencesOfPattern:(NSString *)aPattern withString:(NSString *)replacementText { 33 | ICUPattern *p = [ICUPattern patternWithString:aPattern]; 34 | ICUMatcher *m = [ICUMatcher matcherWithPattern:p overString:self]; 35 | return [m replaceAllWithString:replacementText]; 36 | } 37 | 38 | -(BOOL)matchesPattern:(NSString *)aRegex { 39 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 40 | ICUMatcher *m = [ICUMatcher matcherWithPattern:p overString:self]; 41 | return [m matches]; 42 | } 43 | 44 | -(NSArray *)findPattern:(NSString *)aRegex { 45 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 46 | ICUMatcher *matcher = [ICUMatcher matcherWithPattern:p overString:self]; 47 | NSMutableArray *foundGroups = [NSMutableArray array]; 48 | 49 | [matcher findFromIndex:0]; 50 | unsigned i; 51 | for(i=0;i<=[matcher numberOfGroups];i++) 52 | [foundGroups addObject:[matcher groupAtIndex:i]]; 53 | 54 | return [NSArray arrayWithArray:foundGroups]; 55 | } 56 | 57 | -(NSArray *)componentsSeparatedByPattern:(NSString *)aRegex { 58 | ICUPattern *p = [ICUPattern patternWithString:aRegex]; 59 | return [p componentsSplitFromString:self]; 60 | } 61 | 62 | +(NSString *)stringWithICUString:(void *)utf16EncodedString { 63 | return [[NSString alloc] initWithBytes:utf16EncodedString 64 | length:u_strlen(utf16EncodedString)*sizeof(UChar) 65 | encoding:[self nativeUTF16Encoding]]; 66 | } 67 | 68 | +(NSStringEncoding)nativeUTF16Encoding { 69 | CFStringEncoding stringEncoding; 70 | #if __BIG_ENDIAN__ 71 | stringEncoding = kCFStringEncodingUTF16BE; 72 | #elif __LITTLE_ENDIAN__ 73 | stringEncoding = kCFStringEncodingUTF16LE; 74 | #endif 75 | 76 | return CFStringConvertEncodingToNSStringEncoding(stringEncoding); 77 | } 78 | 79 | -(void *)UTF16String { 80 | NSUInteger length = [self length]; 81 | #warning this is not arc friendly I think 82 | UChar *utf16String = malloc((length+1)*sizeof(UChar)); //NSAllocateCollectable((length+1)*sizeof(UChar), 0); 83 | [self getCharacters:utf16String range:NSMakeRange(0, length)]; 84 | utf16String[length] = 0; 85 | return utf16String; 86 | } 87 | 88 | -(void *)copyUTF16String { 89 | NSUInteger length = [self length]; 90 | UChar *utf16String = malloc((length+1)*sizeof(UChar)); 91 | [self getCharacters:utf16String range:NSMakeRange(0, length)]; 92 | utf16String[length] = 0; 93 | return utf16String; 94 | } 95 | 96 | @end 97 | -------------------------------------------------------------------------------- /SMLAutoCompleteDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLAutoCompleteDelegate.h 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 4/12/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @protocol SMLAutoCompleteDelegate 12 | 13 | - (NSArray*) completions; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SMLBasicPerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | 23 | @interface SMLBasicPerformer : NSObject { 24 | 25 | NSNumberFormatter *thousandFormatter; 26 | NSMutableDictionary *fetchRequests; 27 | } 28 | 29 | + (SMLBasicPerformer *)sharedInstance; 30 | 31 | - (void)insertFetchRequests; 32 | - (NSArray *)fetchAll:(NSString *)key; 33 | - (void)removeAllItemsFromMenu:(NSMenu *)menu; 34 | - (void)insertSortOrderNumbersForArrayController:(NSArrayController *)arrayController; 35 | - (NSString *)thousandFormatedStringFromNumber:(NSNumber *)number; 36 | - (NSString *)copyResolveAliasInPath:(NSString *)path; 37 | 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /SMLBasicPerformer.m: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import "MGSFragaria.h" 21 | #import "MGSFragariaFramework.h" 22 | 23 | @implementation SMLBasicPerformer 24 | 25 | static id sharedInstance = nil; 26 | 27 | #pragma mark - 28 | #pragma mark Class methods 29 | 30 | 31 | /* 32 | 33 | + sharedInstance 34 | 35 | */ 36 | + (SMLBasicPerformer *)sharedInstance 37 | { 38 | if (sharedInstance == nil) { 39 | sharedInstance = [[self alloc] init]; 40 | } 41 | 42 | return sharedInstance; 43 | } 44 | 45 | #pragma mark - 46 | #pragma mark Instance methods 47 | 48 | /* 49 | 50 | - init 51 | 52 | */ 53 | - (id)init 54 | { 55 | if (sharedInstance == nil) { 56 | self = [super init]; 57 | sharedInstance = self; 58 | 59 | thousandFormatter = [[NSNumberFormatter alloc] init]; 60 | [thousandFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; 61 | [thousandFormatter setFormat:@"#,##0"]; 62 | } 63 | return sharedInstance; 64 | } 65 | 66 | #pragma mark - 67 | #pragma mark Data fetching 68 | 69 | /* 70 | 71 | - insertFetchRequests 72 | 73 | */ 74 | - (void)insertFetchRequests 75 | { 76 | 77 | // in Smultron this would build a dictionary of CoreData fetches 78 | fetchRequests = [[NSMutableDictionary alloc] init]; 79 | } 80 | 81 | 82 | /* 83 | 84 | - fetchAll: 85 | 86 | */ 87 | - (NSArray *)fetchAll:(NSString *)key 88 | { 89 | 90 | // in Smultron this would initiate a given fetch 91 | return [fetchRequests valueForKey:key]; 92 | } 93 | 94 | #pragma mark - 95 | #pragma mark Utiltity methods 96 | 97 | 98 | /* 99 | 100 | - removeAllItemsFromMenu: 101 | 102 | */ 103 | - (void)removeAllItemsFromMenu:(NSMenu *)menu 104 | { 105 | NSArray *array = [menu itemArray]; 106 | for (id item in array) { 107 | [menu removeItem:item]; 108 | } 109 | } 110 | 111 | /* 112 | 113 | - newUUID 114 | 115 | */ 116 | - (NSString *)newUUID 117 | { 118 | CFUUIDRef uuid = CFUUIDCreate(NULL); 119 | CFStringRef uuidString = CFUUIDCreateString(NULL, uuid); 120 | CFRelease(uuid); 121 | 122 | return CFBridgingRelease(uuidString); 123 | } 124 | 125 | /* 126 | 127 | - insertSortOrderNumbersForArrayController 128 | 129 | */ 130 | - (void)insertSortOrderNumbersForArrayController:(NSArrayController *)arrayController 131 | { 132 | NSArray *array = [arrayController arrangedObjects]; 133 | NSInteger idx = 0; 134 | for (id item in array) { 135 | [item setValue:[NSNumber numberWithInteger:idx] forKey:@"sortOrder"]; 136 | idx++; 137 | } 138 | } 139 | 140 | /* 141 | 142 | - thousandFormatedStringFromNumber: 143 | 144 | */ 145 | - (NSString *)thousandFormatedStringFromNumber:(NSNumber *)number 146 | { 147 | return [thousandFormatter stringFromNumber:number]; 148 | } 149 | 150 | 151 | /* 152 | 153 | - resolveAliasInPath: 154 | 155 | */ 156 | - (NSString *)copyResolveAliasInPath:(NSString *)path 157 | { 158 | NSString *resolvedPath = nil; 159 | CFURLRef url = CFURLCreateWithFileSystemPath(NULL, (CFStringRef)path, kCFURLPOSIXPathStyle, NO); 160 | 161 | if (url != NULL) { 162 | FSRef fsRef; 163 | if (CFURLGetFSRef(url, &fsRef)) { 164 | Boolean targetIsFolder, wasAliased; 165 | if (FSResolveAliasFile (&fsRef, true, &targetIsFolder, &wasAliased) == noErr && wasAliased) { 166 | CFURLRef resolvedURL = CFURLCreateFromFSRef(NULL, &fsRef); 167 | if (resolvedURL != NULL) { 168 | resolvedPath = (NSString*)CFBridgingRelease(CFURLCopyFileSystemPath(resolvedURL, kCFURLPOSIXPathStyle)); 169 | CFRelease(resolvedURL); 170 | } 171 | } 172 | } 173 | CFRelease(url); 174 | } 175 | 176 | if (resolvedPath==nil) { 177 | return path; 178 | } 179 | 180 | return CFBridgingRelease(CFBridgingRetain(resolvedPath)); 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /SMLErrorPopOver.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLErrorPopOver.h 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 4/11/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface SMLErrorPopOver : NSObject 12 | 13 | // Pass an array of strings to this function to open up the popover window. Window will be centered in the view that is passed to this function. 14 | + (void) showErrorDescriptions:(NSArray*)errors relativeToView:(NSView*) view; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SMLErrorPopOver.m: -------------------------------------------------------------------------------- 1 | // 2 | // SMLErrorPopOver.m 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 4/11/13. 6 | // 7 | // 8 | 9 | #import "SMLErrorPopOver.h" 10 | 11 | #define kSMLErrorPopOverErrorSpacing 16 12 | 13 | @implementation SMLErrorPopOver 14 | 15 | + (CGFloat) widthOfString:(NSString *)string withFont:(NSFont *)font { 16 | NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil]; 17 | return [[[NSAttributedString alloc] initWithString:string attributes:attributes] size].width; 18 | } 19 | 20 | + (void) showErrorDescriptions:(NSArray*)errors relativeToView:(NSView*) view 21 | { 22 | // Add labels for each error 23 | int errNo = 0; 24 | int maxWidth = 0; 25 | int numErrors = (int)errors.count; 26 | int viewHeight = kSMLErrorPopOverErrorSpacing * numErrors; 27 | 28 | if (!numErrors) return; 29 | 30 | // Create view controller 31 | NSViewController* vc = [[NSViewController alloc] initWithNibName:@"ErrorPopoverView" bundle:[NSBundle bundleForClass:[self class]]]; 32 | 33 | // Create labels and add them to the view 34 | for (NSString* err in errors) 35 | { 36 | NSTextField *textField; 37 | 38 | NSFont* font = [NSFont systemFontOfSize:10]; 39 | 40 | int width = [self widthOfString:err withFont:font]; 41 | if (width > maxWidth) maxWidth = width; 42 | 43 | textField = [[NSTextField alloc] initWithFrame:NSMakeRect(0, viewHeight - (kSMLErrorPopOverErrorSpacing * (errNo + 1)), 1024, kSMLErrorPopOverErrorSpacing)]; 44 | [textField setStringValue:err.description]; 45 | [textField setBezeled:NO]; 46 | [textField setDrawsBackground:NO]; 47 | [textField setEditable:NO]; 48 | [textField setSelectable:NO]; 49 | [textField setFont:font]; 50 | 51 | [vc.view addSubview:textField]; 52 | 53 | errNo++; 54 | } 55 | 56 | [vc.view setFrameSize:NSMakeSize(maxWidth, viewHeight)]; 57 | 58 | // Open the popover 59 | NSPopover* popover = [[NSPopover alloc] init]; 60 | popover.behavior = NSPopoverBehaviorTransient; 61 | popover.contentSize = vc.view.bounds.size; 62 | popover.contentViewController = vc; 63 | popover.animates = YES; 64 | 65 | [popover showRelativeToRect:[view bounds] ofView:view preferredEdge:NSMinYEdge]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /SMLGutterTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | 23 | @interface SMLGutterTextView : NSTextView { 24 | NSImage* imgBreakpoint0; 25 | NSImage* imgBreakpoint1; 26 | NSImage* imgBreakpoint2; 27 | NSString* fileName; 28 | NSArray* breakpointLines; 29 | } 30 | 31 | @property (nonatomic,copy) NSString* fileName; 32 | @property (nonatomic,strong) NSArray* breakpointLines; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /SMLLayoutManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | @interface SMLLayoutManager : NSLayoutManager { 23 | 24 | NSDictionary *defAttributes; 25 | NSString *tabCharacter; 26 | NSString *newLineCharacter; 27 | NSString *spaceCharacter; 28 | BOOL showInvisibleCharacters; 29 | NSGlyph *invisibleGlyphs; 30 | BOOL useGlyphSubstitutionForInvisibleGlyphs; 31 | BOOL drawInvisibleGlyphsUsingCoreText; 32 | NSMutableArray *lineRefs; 33 | } 34 | 35 | - (NSAttributedString *)attributedStringWithTemporaryAttributesApplied; 36 | 37 | @property BOOL showInvisibleCharacters; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /SMLLineNumbers.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | @class SMLTextView; 23 | 24 | @interface SMLLineNumbers : NSObject { 25 | NSPoint zeroPoint; 26 | NSClipView *updatingLineNumbersForClipView; 27 | NSDictionary *attributes; 28 | id document; 29 | } 30 | 31 | - (id)initWithDocument:(id)theDocument; 32 | - (void)viewBoundsDidChange:(NSNotification *)notification; 33 | - (void)updateLineNumbersCheckWidth:(BOOL)checkWidth recolour:(BOOL)recolour; 34 | - (void)updateLineNumbersForClipView:(NSClipView *)clipView checkWidth:(BOOL)checkWidth recolour:(BOOL)recolour; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /SMLSyntaxColouring.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | #import "MGSFragaria.h" 22 | #import "SMLTextView.h" 23 | #import "SMLAutoCompleteDelegate.h" 24 | 25 | @class SMLLayoutManager; 26 | @class ICUPattern; 27 | @class ICUMatcher; 28 | 29 | @interface SMLSyntaxColouring : NSObject { 30 | 31 | id document; 32 | 33 | SMLLayoutManager *firstLayoutManager; 34 | 35 | NSInteger lastCursorLocation; 36 | 37 | NSDictionary *commandsColour, *commentsColour, *instructionsColour, *keywordsColour, *autocompleteWordsColour, 38 | *stringsColour, *variablesColour, *attributesColour, *lineHighlightColour, *numbersColour; 39 | 40 | NSSet *keywords; 41 | NSSet *autocompleteWords; 42 | NSArray *keywordsAndAutocompleteWords; 43 | 44 | NSString *beginCommand; 45 | NSString *endCommand; 46 | NSString *beginInstruction; 47 | NSString *endInstruction; 48 | NSString *firstString; 49 | NSString *secondString; 50 | NSString *firstSingleLineComment, *secondSingleLineComment; 51 | NSString *beginFirstMultiLineComment, *endFirstMultiLineComment, *beginSecondMultiLineComment, *endSecondMultiLineComment; 52 | NSString *functionDefinition, *removeFromFunction; 53 | 54 | NSMutableArray *singleLineComments; 55 | NSMutableArray *multiLineComments; 56 | 57 | unichar firstStringUnichar; 58 | unichar secondStringUnichar; 59 | 60 | BOOL reactToChanges; 61 | BOOL keywordsCaseSensitive; 62 | BOOL recolourKeywordIfAlreadyColoured; 63 | BOOL syntaxErrorsAreDirty; 64 | BOOL syntaxDefinitionAllowsColouring; 65 | 66 | NSCharacterSet *attributesCharacterSet; 67 | NSCharacterSet *beginVariableCharacterSet; 68 | NSCharacterSet *endVariableCharacterSet; 69 | NSCharacterSet *letterCharacterSet, *keywordStartCharacterSet, *keywordEndCharacterSet; 70 | NSCharacterSet *numberCharacterSet; 71 | NSCharacterSet *nameCharacterSet; 72 | unichar decimalPointCharacter; 73 | NSArray *syntaxErrors; 74 | 75 | ICUPattern *firstStringPattern; 76 | ICUPattern *secondStringPattern; 77 | ICUMatcher *firstStringMatcher; 78 | ICUMatcher *secondStringMatcher; 79 | NSUndoManager *undoManager; 80 | 81 | NSTimer *autocompleteWordsTimer; 82 | 83 | NSRange lastLineHighlightRange; 84 | id docSpec; 85 | 86 | } 87 | 88 | @property BOOL reactToChanges; 89 | @property (strong) NSUndoManager *undoManager; 90 | @property (nonatomic, strong) NSArray* syntaxErrors; 91 | 92 | - (id)initWithDocument:(id)document; 93 | - (void)pageRecolourTextView:(SMLTextView *)textView; 94 | - (void)pageRecolour; 95 | - (void)applySyntaxDefinition; 96 | - (void)pageRecolourTextView:(SMLTextView *)textView options:(NSDictionary *)options; 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /SMLSyntaxColouringDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLSyntaxColouringDelegate.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 14/04/2013. 6 | // 7 | // 8 | 9 | #import 10 | 11 | // syntax colouring information dictionary keys 12 | extern NSString *SMLSyntaxGroup; 13 | extern NSString *SMLSyntaxGroupID; 14 | extern NSString *SMLSyntaxWillColour; 15 | extern NSString *SMLSyntaxAttributes; 16 | extern NSString *SMLSyntaxInfo; 17 | 18 | // syntax colouring group names 19 | extern NSString *SMLSyntaxGroupNumber; 20 | extern NSString *SMLSyntaxGroupCommand; 21 | extern NSString *SMLSyntaxGroupInstruction; 22 | extern NSString *SMLSyntaxGroupKeyword; 23 | extern NSString *SMLSyntaxGroupAutoComplete; 24 | extern NSString *SMLSyntaxGroupVariable; 25 | extern NSString *SMLSyntaxGroupFirstString; 26 | extern NSString *SMLSyntaxGroupSecondString; 27 | extern NSString *SMLSyntaxGroupAttribute; 28 | extern NSString *SMLSyntaxGroupSingleLineComment; 29 | extern NSString *SMLSyntaxGroupMultiLineComment; 30 | extern NSString *SMLSyntaxGroupSecondStringPass2; 31 | 32 | // syntax colouring group IDs 33 | enum { 34 | kSMLSyntaxGroupNumber = 0, 35 | kSMLSyntaxGroupCommand = 1, 36 | kSMLSyntaxGroupInstruction = 2, 37 | kSMLSyntaxGroupKeyword = 3, 38 | kSMLSyntaxGroupAutoComplete = 4, 39 | kSMLSyntaxGroupVariable = 5, 40 | kSMLSyntaxGroupSecondString = 6, 41 | kSMLSyntaxGroupFirstString = 7, 42 | kSMLSyntaxGroupAttribute = 8, 43 | kSMLSyntaxGroupSingleLineComment = 9, 44 | kSMLSyntaxGroupMultiLineComment = 10, 45 | kSMLSyntaxGroupSecondStringPass2 = 11 46 | }; 47 | typedef NSInteger SMLSyntaxGroupInteger; 48 | 49 | @protocol SMLSyntaxColouringDelegate 50 | 51 | /* 52 | 53 | Use these methods to partially customise or overridde the syntax colouring. 54 | 55 | Arguments used in the delegate methods 56 | ====================================== 57 | 58 | document: Fragaria document spec 59 | block: block to colour string. the arguments are a colour info dictionary and the range to be coloured 60 | string: document string. This is supplied as a convenience. The string can also be retrieved from the document. 61 | range: range of string to colour. 62 | info: an information dictionary 63 | 64 | Info dictionary keys 65 | ====================== 66 | 67 | SMLSyntaxGroup: NSString describing the group being coloured. 68 | SMLSyntaxGroupID: NSNumber identyfying the group being coloured. 69 | SMLSyntaxWillColour: NSNumber containing a BOOL indicating whether the caller will colour the string. 70 | SMLSyntaxAttributes: NSDictionary of NSAttributed string attributes used to colour the string. 71 | SMLSyntaxInfo: NSDictionary containing Fragaria syntax definition. 72 | 73 | Syntax Info dictionary keys 74 | =========================== 75 | 76 | For key values see SMLSyntaxDefinition.h 77 | 78 | Delegate calling 79 | ================ 80 | 81 | The delegate will receive messages in the following sequence: 82 | 83 | // query delegate if should colour this document 84 | doColouring = fragariaDocument:shouldColourWithBlock:string:range:info 85 | if !doColouring quit colouring 86 | 87 | // send *ColourGroupWithBlock methods for each group defined by SMLSyntaxGroupInteger 88 | foreach group 89 | 90 | // query delegate if should colour this group 91 | doColouring = fragariaDocument:shouldColourGroupWithBlock:string:range:info 92 | 93 | if doColouring 94 | 95 | colour the group 96 | 97 | // inform delegate group was coloured 98 | fragariaDocument:didColourGroupWithBlock:string:range:info 99 | 100 | end if 101 | end 102 | 103 | // inform delegate document was coloured 104 | fragariaDocument:willDidWithBlock:string:range:info 105 | 106 | Colouring the string 107 | ==================== 108 | 109 | Each delegate method includes a block that can can be called with a dictionary of attributes and a range to affect colouring. 110 | 111 | */ 112 | - (BOOL)fragariaDocument:(id)document shouldColourWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; 113 | - (BOOL)fragariaDocument:(id)document shouldColourGroupWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; 114 | - (void)fragariaDocument:(id)document didColourGroupWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; 115 | - (void)fragariaDocument:(id)document didColourWithBlock:(BOOL (^)(NSDictionary *, NSRange))block string:(NSString *)string range:(NSRange)range info:(NSDictionary *)info; 116 | @end 117 | -------------------------------------------------------------------------------- /SMLSyntaxDefinition.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLSyntaxDefinition.h 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 16/04/2013. 6 | // 7 | // 8 | 9 | #import 10 | 11 | // syntax definition dictionary keys 12 | extern NSString *SMLSyntaxDefinitionAllowSyntaxColouring ; 13 | extern NSString *SMLSyntaxDefinitionKeywords; 14 | extern NSString *SMLSyntaxDefinitionAutocompleteWords; 15 | extern NSString *SMLSyntaxDefinitionRecolourKeywordIfAlreadyColoured ; 16 | extern NSString *SMLSyntaxDefinitionKeywordsCaseSensitive ; 17 | extern NSString *SMLSyntaxDefinitionBeginCommand; 18 | extern NSString *SMLSyntaxDefinitionEndCommand; 19 | extern NSString *SMLSyntaxDefinitionBeginInstruction; 20 | extern NSString *SMLSyntaxDefinitionEndInstruction ; 21 | extern NSString *SMLSyntaxDefinitionBeginVariable; 22 | extern NSString *SMLSyntaxDefinitionEndVariable; 23 | extern NSString *SMLSyntaxDefinitionFirstString; 24 | extern NSString *SMLSyntaxDefinitionSecondString; 25 | extern NSString *SMLSyntaxDefinitionFirstSingleLineComment; 26 | extern NSString *SMLSyntaxDefinitionSecondSingleLineComment; 27 | extern NSString *SMLSyntaxDefinitionBeginFirstMultiLineComment; 28 | extern NSString *SMLSyntaxDefinitionEndFirstMultiLineComment ; 29 | extern NSString *SMLSyntaxDefinitionBeginSecondMultiLineComment; 30 | extern NSString *SMLSyntaxDefinitionEndSecondMultiLineComment; 31 | extern NSString *SMLSyntaxDefinitionFunctionDefinition; 32 | extern NSString *SMLSyntaxDefinitionRemoveFromFunction ; 33 | extern NSString *SMLSyntaxDefinitionExcludeFromKeywordStartCharacterSet; 34 | extern NSString *SMLSyntaxDefinitionExcludeFromKeywordEndCharacterSet; 35 | extern NSString *SMLSyntaxDefinitionIncludeInKeywordStartCharacterSet; 36 | extern NSString *SMLSyntaxDefinitionIncludeInKeywordEndCharacterSet; 37 | -------------------------------------------------------------------------------- /SMLSyntaxError.h: -------------------------------------------------------------------------------- 1 | // 2 | // SMLSyntaxError.h 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 4/9/13. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface SMLSyntaxError : NSObject 12 | { 13 | NSString* description; 14 | int line; 15 | int character; 16 | NSString* code; 17 | int length; 18 | } 19 | 20 | @property (nonatomic,copy) NSString* description; 21 | @property (nonatomic,assign) int line; 22 | @property (nonatomic,assign) int character; 23 | @property (nonatomic,copy) NSString* code; 24 | @property (nonatomic,assign) int length; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /SMLSyntaxError.m: -------------------------------------------------------------------------------- 1 | // 2 | // SMLSyntaxError.m 3 | // Fragaria 4 | // 5 | // Created by Viktor Lidholt on 4/9/13. 6 | // 7 | // 8 | 9 | #import "SMLSyntaxError.h" 10 | 11 | @implementation SMLSyntaxError 12 | 13 | @synthesize line, character, code, length, description; 14 | 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /SMLTextPerformer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | 23 | @interface SMLTextPerformer : NSObject { 24 | 25 | NSString *darkSideLineEnding; 26 | NSString *macLineEnding; 27 | NSString *unixLineEnding; 28 | 29 | NSString *newLineSymbolString; 30 | } 31 | 32 | + (SMLTextPerformer *)sharedInstance; 33 | 34 | - (NSString *)convertLineEndings:(NSString *)stringToConvert inDocument:(id)document; 35 | 36 | - (NSStringEncoding)guessEncodingFromData:(NSData *)textData; 37 | 38 | - (NSString *)replaceAllNewLineCharactersWithSymbolInString:(NSString *)theTextString; 39 | 40 | - (NSString *)removeAllLineEndingsInString:(NSString *)string; 41 | 42 | 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /SMLTextView.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | MGSFragaria 4 | Written by Jonathan Mitchell, jonathan@mugginsoft.com 5 | Find the latest version at https://github.com/mugginsoft/Fragaria 6 | 7 | Smultron version 3.6b1, 2009-09-12 8 | Written by Peter Borg, pgw3@mac.com 9 | Find the latest version at http://smultron.sourceforge.net 10 | 11 | Copyright 2004-2009 Peter Borg 12 | 13 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at 14 | 15 | http://www.apache.org/licenses/LICENSE-2.0 16 | 17 | Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 18 | */ 19 | 20 | #import 21 | 22 | @class MGSFragaria; 23 | 24 | @interface SMLTextView : NSTextView { 25 | @private 26 | NSInteger lineHeight; 27 | NSPoint startPoint; 28 | NSPoint startOrigin; 29 | CGFloat pageGuideX; 30 | NSColor *pageGuideColour; 31 | 32 | BOOL showPageGuide; 33 | 34 | NSCursor *colouredIBeamCursor; 35 | 36 | MGSFragaria *fragaria; 37 | BOOL lineWrap; 38 | } 39 | 40 | @property (strong) NSCursor *colouredIBeamCursor; 41 | @property (strong) MGSFragaria *fragaria; 42 | @property (nonatomic) BOOL lineWrap; 43 | 44 | - (void)setDefaults; 45 | 46 | - (void)setTextDefaults; 47 | 48 | - (NSInteger)lineHeight; 49 | 50 | - (void)setTabWidth; 51 | 52 | - (void)setPageGuideValues; 53 | - (void)updateIBeamCursor; 54 | 55 | - (void)setString:(NSString *)text options:(NSDictionary *)options; 56 | - (void)setAttributedString:(NSAttributedString *)text; 57 | - (void)setAttributedString:(NSAttributedString *)text options:(NSDictionary *)options; 58 | - (void)updateLineWrap; 59 | - (void)replaceCharactersInRange:(NSRange)range withString:(NSString *)text options:(NSDictionary *)options; 60 | @end 61 | -------------------------------------------------------------------------------- /Syntax Definitions/ada.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | -- 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(function|procedure)\s+\w* 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abort 44 | abs 45 | abstract 46 | accept 47 | access 48 | aliased 49 | all 50 | and 51 | array 52 | at 53 | begin 54 | body 55 | constant 56 | declare 57 | delay 58 | delta 59 | digits 60 | do 61 | else 62 | elsif 63 | end 64 | entry 65 | exception 66 | exit 67 | for 68 | function 69 | generic 70 | goto 71 | in 72 | is 73 | limited 74 | mod 75 | new 76 | not 77 | null 78 | of 79 | or 80 | others 81 | out 82 | package 83 | pragma 84 | private 85 | procedure 86 | protected 87 | raise 88 | range 89 | rem 90 | record 91 | renames 92 | requeue 93 | return 94 | reverse 95 | separate 96 | subtype 97 | tagged 98 | task 99 | terminate 100 | then 101 | type 102 | until 103 | use 104 | when 105 | while 106 | with 107 | xor 108 | case 109 | loop 110 | if 111 | 112 | autocompleteWords 113 | 114 | 115 | 116 | 117 | -------------------------------------------------------------------------------- /Syntax Definitions/ampl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | ` 7 | endCommand 8 | ' 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | # 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | or 45 | if 46 | then 47 | else 48 | exists 49 | forall 50 | in 51 | not 52 | purge union diff 53 | symbol 54 | symdif 55 | inter cross setof by 56 | less 57 | sum 58 | prod 59 | min 60 | max 61 | abs 62 | acos acosh alias asin asinsh atan atan2 atanh ceil cos exp floor log log10 precision round sin sinh sqrt tan tanh trunc Beta Cauchy Exponential Gamma Irand224 Normal Normal01 Poisson Uniform set setof param var arc minimize maximize subject let to node binary integer check card next nextw prev prevw first last member match within ord ord0 circular ordered reversed init init0 lb lb0 lb1 lb2 lrc lslack rc slack ub ub0 ub1 ub2 urc uslack val body dinit dinit0 dual lb lbs ldual lslack slack ub ubs udual uslack 63 | 64 | autocompleteWords 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /Syntax Definitions/asm-mips.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autocompleteWords 6 | 7 | beginCommand 8 | 9 | beginFirstMultiLineComment 10 | */ 11 | beginInstruction 12 | 13 | beginSecondMultiLineComment 14 | 15 | beginVariable 16 | 17 | endCommand 18 | 19 | endFirstMultiLineComment 20 | /* 21 | endInstruction 22 | 23 | endSecondMultiLineComment 24 | 25 | endVariable 26 | 27 | firstSingleLineComment 28 | # 29 | firstString 30 | " 31 | functionDefinition 32 | 33 | includeInKeywordStartCharacterSet 34 | . 35 | keywords 36 | 37 | ABS 38 | ADD 39 | ADDI 40 | ADDIU 41 | ADDU 42 | DIV 43 | DIVU 44 | MULOU 45 | MULO 46 | MULT 47 | MULTU 48 | NEG 49 | NOP 50 | REMU 51 | REM 52 | SEQ 53 | SGEU 54 | SGE 55 | SGTU 56 | SGT 57 | SLEU 58 | SLE 59 | SLT 60 | SLTI 61 | SLTIU 62 | SLTU 63 | SNE 64 | SUB 65 | SUBU 66 | AND 67 | ANDI 68 | NOR 69 | NOT 70 | OR 71 | ORI 72 | XOR 73 | XORI 74 | ROL 75 | ROR 76 | SLL 77 | SLLV 78 | SRA 79 | SRAV 80 | SRL 81 | SRLV 82 | LB 83 | LBU 84 | LD 85 | LH 86 | LHU 87 | LW 88 | SB 89 | SD 90 | SH 91 | SW 92 | LA 93 | LI 94 | LUI 95 | MFHI 96 | MFLO 97 | MOVE 98 | MTHI 99 | MTLO 100 | B 101 | BEQ 102 | BEQZ 103 | BGE 104 | BGEU 105 | BGEZ 106 | BGEZAL 107 | BGT 108 | BGTU 109 | BGTZ 110 | BLE 111 | BLEU 112 | BLEZ 113 | BLT 114 | BLTU 115 | BLTZ 116 | BLTZAL 117 | BNE 118 | BNEZ 119 | J 120 | JAL 121 | JALR 122 | JR 123 | MFC0 124 | MTC0 125 | BREAK 126 | SYSCALL 127 | 128 | keywordsCaseSensitive 129 | 130 | recolourKeywordIfAlreadyColoured 131 | 132 | removeFromFunction 133 | 134 | secondSingleLineComment 135 | 136 | secondString 137 | ' 138 | 139 | 140 | -------------------------------------------------------------------------------- /Syntax Definitions/awk.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | # 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*function\s+\w.*$ 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | break 44 | close 45 | continue 46 | delete 47 | do 48 | else 49 | exit 50 | fflush 51 | for 52 | huge 53 | if 54 | in 55 | function 56 | next 57 | nextfile 58 | print 59 | printf 60 | return 61 | while 62 | atan2 63 | cos 64 | exp 65 | gensub 66 | getline 67 | gsub 68 | index 69 | int 70 | length 71 | log 72 | match 73 | rand 74 | sin 75 | split 76 | sprintf 77 | sqrt 78 | srand 79 | sub 80 | substr 81 | system 82 | tolower 83 | toupper 84 | BEGIN 85 | END 86 | $0 87 | ARGC 88 | ARGIND 89 | ARGV 90 | CONVFMT 91 | ENVIRON 92 | ERRNO 93 | FIELDWIDTHS 94 | FILENAME 95 | FNR 96 | FS 97 | IGNORECASE 98 | NF 99 | NR 100 | OFMT 101 | OFS 102 | ORS 103 | RLENGTH 104 | RS 105 | RSTART 106 | RT 107 | SUBSEP 108 | 109 | autocompleteWords 110 | 111 | 112 | 113 | 114 | -------------------------------------------------------------------------------- /Syntax Definitions/batch.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | @ 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | % 15 | endVariable 16 | \.\=\\\" 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | :: 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keyWordsCaseSensitive 38 | 39 | recolourKeyWordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | assoc 44 | call 45 | cd 46 | chdir 47 | cls 48 | cmd 49 | color 50 | copy 51 | date 52 | defined 53 | del 54 | dir 55 | dpath 56 | echo 57 | else 58 | endlocal 59 | erase 60 | errorlevel 61 | exit 62 | exist 63 | for 64 | ftype 65 | goto 66 | if 67 | md 68 | mkdir 69 | move 70 | not 71 | path 72 | pause 73 | popd 74 | prompt 75 | pushd 76 | rd 77 | rem 78 | rename 79 | ren 80 | rmdir 81 | set 82 | setlocal 83 | shift 84 | start 85 | time 86 | title 87 | type 88 | ver 89 | 90 | autocompleteWords 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /Syntax Definitions/c.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | char 44 | double 45 | enum 46 | float 47 | int 48 | long 49 | short 50 | signed 51 | struct 52 | typedef 53 | union 54 | unsigned 55 | void 56 | auto 57 | const 58 | extern 59 | register 60 | static 61 | volatile 62 | break 63 | case 64 | continue 65 | default 66 | do 67 | else 68 | for 69 | goto 70 | if 71 | return 72 | sizeof 73 | switch 74 | while 75 | asm 76 | asmlinkage 77 | far 78 | huge 79 | inline 80 | near 81 | pascal 82 | true 83 | false 84 | NULL 85 | #include 86 | #define 87 | #warning 88 | #error 89 | #ifdef 90 | #ifndef 91 | #endif 92 | #else 93 | 94 | autocompleteWords 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Syntax Definitions/cobol.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | * 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | ACCEPT 44 | ADD 45 | ADVANCING 46 | AFTER 47 | AND 48 | ASSIGN 49 | AUTHOR 50 | AT 51 | BY 52 | CALL 53 | CLOSE 54 | COMPUTE 55 | CONTENT 56 | CONTROL 57 | COPY 58 | CORRESPONDING 59 | DATA 60 | DELETE 61 | DISPLAY 62 | DIVIDE 63 | DIVISION 64 | END 65 | ENVIRONMENT 66 | ERROR 67 | EQUAL 68 | EOF 69 | EVALUATE 70 | EXAMINE 71 | EXIT 72 | FALSE 73 | FD 74 | FILE 75 | FILLER 76 | FROM 77 | FUNCTION 78 | GIVING 79 | GO 80 | GOTO 81 | GREATER 82 | HIGH 83 | ID 84 | IDENTIFICATION 85 | IF 86 | INDEXED 87 | INPUT 88 | INSPECT 89 | INVALID 90 | IS 91 | LINE 92 | LINKAGE 93 | KEY 94 | LOWER 95 | MOVE 96 | MULTIPLY 97 | NO 98 | NOT 99 | NUMVAL 100 | OMITTED 101 | OPEN 102 | ORGANIZATION 103 | OTHER 104 | OUTPUT 105 | PARAGRAPH 106 | PERFORM 107 | PIC 108 | PROCEDURE 109 | PROGRAM 110 | READ 111 | REPLACING 112 | RETURNING 113 | REWRITE 114 | RUN 115 | SEARCH 116 | SECTION 117 | SELECT 118 | SEQUENTIAL 119 | SET 120 | SIZE 121 | SORT 122 | START 123 | STATUS 124 | STORAGE 125 | STOP 126 | STRING 127 | SUB 128 | SUBSTRACT 129 | TALLYING 130 | THEN 131 | TO 132 | TRUE 133 | TRANSFORM 134 | UNTIL 135 | USAGE 136 | USING 137 | VARYING 138 | VALUES 139 | VALUE 140 | WHEN 141 | WORKING 142 | WRITE 143 | 144 | autocompleteWords 145 | 146 | 147 | 148 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /Syntax Definitions/coffeescript.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | # 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | ### 27 | endFirstMultiLineComment 28 | ### 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(->).* 35 | removeFromFunction 36 | -> 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | if 44 | else 45 | for 46 | in 47 | while 48 | do 49 | loop 50 | until 51 | continue 52 | break 53 | try 54 | catch 55 | switch 56 | when 57 | then 58 | new 59 | return 60 | delete 61 | true 62 | false 63 | throw 64 | typeof 65 | parseFloat 66 | parseInt 67 | Date 68 | document 69 | window 70 | Math 71 | RegExp 72 | Screen 73 | this 74 | Window 75 | alert 76 | eval 77 | focus 78 | setInterval 79 | setTimeout 80 | history 81 | indexOf 82 | innerHeight 83 | innerWidth 84 | join 85 | length 86 | location 87 | locationbar 88 | match 89 | NaN 90 | toString 91 | toUpperCase 92 | encodeURI 93 | encodeURIComponent 94 | URL 95 | 96 | autocompleteWords 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Syntax Definitions/cpp.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | and_eq 45 | asm 46 | auto 47 | bitand 48 | bitor 49 | bool 50 | break 51 | case 52 | catch 53 | char 54 | class 55 | compl 56 | const 57 | const_cast 58 | continue 59 | default 60 | delete 61 | do 62 | double 63 | dynamic_cast 64 | else 65 | enum 66 | explicit 67 | export 68 | extern 69 | false 70 | float 71 | for 72 | friend 73 | goto 74 | if 75 | inline 76 | int 77 | long 78 | mutable 79 | namespace 80 | new 81 | not 82 | not_eq 83 | operator 84 | or 85 | or_eq 86 | private 87 | protected 88 | public 89 | register 90 | reinterpret_cast 91 | return 92 | short 93 | signed 94 | sizeof 95 | static 96 | static_cast 97 | struct 98 | switch 99 | template 100 | this 101 | throw 102 | true 103 | try 104 | typedef 105 | typeid 106 | typename 107 | union 108 | unsigned 109 | using 110 | virtual 111 | void 112 | volatile 113 | wchar_t 114 | while 115 | xor 116 | xor_eq 117 | NULL 118 | #include 119 | 120 | autocompleteWords 121 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /Syntax Definitions/csharp.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstract 44 | as 45 | base 46 | break 47 | case 48 | catch 49 | class 50 | checked 51 | continue 52 | default 53 | delegate 54 | do 55 | else 56 | enum 57 | event 58 | explicit 59 | extern 60 | false 61 | for 62 | foreach 63 | finally 64 | fixed 65 | goto 66 | if 67 | implicit 68 | in 69 | interface 70 | internal 71 | is 72 | lock 73 | namespace 74 | new 75 | null 76 | operator 77 | out 78 | override 79 | params 80 | private 81 | protected 82 | public 83 | readonly 84 | ref 85 | return 86 | sealed 87 | sizeof 88 | stackalloc 89 | static 90 | struct 91 | switch 92 | this 93 | throw 94 | true 95 | try 96 | typeof 97 | unchecked 98 | unsafe 99 | using 100 | virtual 101 | while 102 | #if 103 | #else 104 | #elif 105 | #endif 106 | #define 107 | #undef 108 | #warning 109 | #error 110 | #line 111 | bool 112 | byte 113 | char 114 | const 115 | decimal 116 | double 117 | float 118 | int 119 | long 120 | object 121 | uint 122 | ushort 123 | ulong 124 | sbyte 125 | short 126 | string 127 | void 128 | 129 | autocompleteWords 130 | 131 | 132 | 133 | -------------------------------------------------------------------------------- /Syntax Definitions/d.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autocompleteWords 6 | 7 | beginCommand 8 | 9 | beginFirstMultiLineComment 10 | /+ 11 | beginInstruction 12 | 13 | beginSecondMultiLineComment 14 | /* 15 | beginVariable 16 | 17 | endCommand 18 | 19 | endFirstMultiLineComment 20 | +/ 21 | endInstruction 22 | 23 | endSecondMultiLineComment 24 | */ 25 | endVariable 26 | 27 | firstSingleLineComment 28 | // 29 | firstString 30 | " 31 | functionDefinition 32 | 33 | removeFromFunction 34 | 35 | keywords 36 | 37 | abstract 38 | alias 39 | align 40 | asm 41 | auto 42 | body 43 | break 44 | case 45 | cast 46 | catch 47 | class 48 | const 49 | continue 50 | default 51 | delegate 52 | delete 53 | deprecated 54 | do 55 | else 56 | enum 57 | export 58 | false 59 | final 60 | finally 61 | for 62 | foreach 63 | function 64 | goto 65 | if 66 | in 67 | inout 68 | interface 69 | invariant 70 | new 71 | null 72 | override 73 | out 74 | private 75 | protected 76 | public 77 | return 78 | static 79 | struct 80 | super 81 | switch 82 | synchronized 83 | this 84 | throw 85 | true 86 | try 87 | template 88 | typedef 89 | union 90 | volatile 91 | while 92 | with 93 | module 94 | import 95 | void 96 | bit 97 | byte 98 | ubyte 99 | short 100 | ushort 101 | int 102 | uint 103 | long 104 | ulong 105 | cent 106 | ucent 107 | float 108 | double 109 | real 110 | ireal 111 | ifloat 112 | idouble 113 | creal 114 | cfloat 115 | cdouble 116 | char 117 | wchar 118 | dchar 119 | printf 120 | extern 121 | C 122 | D 123 | Windows 124 | Pascal 125 | debug 126 | assert 127 | version 128 | DigitalMars 129 | X86 130 | Win32 131 | linux 132 | LittleEndian 133 | BigEndian 134 | D_InlineAsm 135 | none 136 | unittest 137 | 138 | keywordsCaseSensitive 139 | 140 | recolourKeywordIfAlreadyColoured 141 | 142 | secondSingleLineComment 143 | 144 | secondString 145 | ' 146 | 147 | 148 | -------------------------------------------------------------------------------- /Syntax Definitions/dylan.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | < 15 | endVariable 16 | > 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | afterwards 44 | above 45 | abstract 46 | below 47 | begin 48 | block 49 | by 50 | case 51 | class 52 | cleanup 53 | concrete 54 | constant 55 | create 56 | define 57 | domain 58 | else 59 | elseif 60 | end 61 | exception 62 | exclude 63 | export 64 | finally 65 | for 66 | from 67 | function 68 | functional 69 | generic 70 | handler 71 | if 72 | import 73 | in 74 | inherited 75 | inline 76 | instance 77 | interface 78 | library 79 | let 80 | local 81 | macro 82 | method 83 | open 84 | otherwise 85 | primary 86 | rename 87 | sealed 88 | select 89 | sideways 90 | signal 91 | singleton 92 | slot 93 | subclass 94 | then 95 | to 96 | unless 97 | until 98 | use 99 | variable 100 | virtual 101 | when 102 | while 103 | 104 | autocompleteWords 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /Syntax Definitions/eiffel.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | -- 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | indexing 44 | class 45 | inherit 46 | creation 47 | feature 48 | rename 49 | redefine 50 | undefine 51 | select 52 | export 53 | local 54 | deferred 55 | do 56 | is 57 | once 58 | alias 59 | external 60 | rescue 61 | debug 62 | if 63 | inspect 64 | from 65 | else 66 | elseif 67 | when 68 | until 69 | loop 70 | then 71 | obsolete 72 | end 73 | check 74 | ensure 75 | require 76 | variant 77 | invariant 78 | create 79 | 80 | autocompleteWords 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /Syntax Definitions/erl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | % 25 | beginFirstMultiLineComment 26 | % 27 | endFirstMultiLineComment 28 | % 29 | beginSecondMultiLineComment 30 | % 31 | endSecondMultiLineComment 32 | % 33 | functionDefinition 34 | ^[a-z]+.*\(.*\)\s*-> 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | module 44 | include 45 | compile 46 | author 47 | vsn 48 | behavior 49 | behaviour 50 | define 51 | record 52 | after 53 | and 54 | andalso 55 | band 56 | begin 57 | bnot 58 | bor 59 | bsi 60 | bsr 61 | case 62 | catch 63 | cond 64 | div 65 | end 66 | fun 67 | if 68 | let 69 | not 70 | of 71 | or 72 | orelse 73 | query 74 | receive 75 | rem 76 | try 77 | when 78 | xor 79 | 80 | autocompleteWords 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /Syntax Definitions/f-script.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | ' 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | " 27 | endFirstMultiLineComment 28 | " 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^(-|\+).*\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | self 44 | super 45 | do: 46 | to: 47 | count 48 | at 49 | insert 50 | put 51 | removeAt 52 | true 53 | false 54 | YES 55 | NO 56 | nil 57 | with: 58 | inject: 59 | into: 60 | ifFalse 61 | ifTrue 62 | whileTrue 63 | whileFalse 64 | asSortedCollection: 65 | collect: 66 | select: 67 | reject: 68 | allSatisfy: 69 | GSMime 70 | GSXML 71 | NSAffineTransform 72 | NSAriver 73 | NSArray 74 | NSAttributedString 75 | NSAutoreleasePool 76 | NSBundle 77 | NSByteOrder 78 | NSCalendarDate 79 | NSaracterSet 80 | NSClassDescription 81 | NSCoder 82 | NSComparisonPredicate 83 | NSCompoundPredicate 84 | NSConnection 85 | NSData 86 | NSDateFormatter 87 | NSDate 88 | NSDebug 89 | NSDecimal 90 | NSDecimalNumber 91 | NSDictionary 92 | NSDistantObject 93 | NSDistributedLock 94 | NSDistributedNotificationCenter 95 | NSEnumerator 96 | NSError 97 | NSErrorRecoveryAttempting 98 | NSException 99 | NSExpression 100 | NSFileHandle 101 | NSFileManager 102 | NSFormatter 103 | NSGeometry 104 | NSHashTable 105 | NSHost 106 | NSHTTPCookie 107 | NSHTTPCookieStorage 108 | NSIndexPath 109 | NSIndexSet 110 | NSInvocation 111 | NSKeyedAriver 112 | NSKeyValueCoding 113 | NSKeyValueObserving 114 | NSLock 115 | NSMapTable 116 | NSMethodSignature 117 | NSNetServices 118 | NSNotification 119 | NSNotificationQueue 120 | NSNull 121 | NSNumberFormatter 122 | NSObjCRuntime 123 | NSObject 124 | NSPaUtilities 125 | NSPortCoder 126 | NSPort 127 | NSPortMessage 128 | NSPortNameServer 129 | NSPredicate 130 | NSProcessInfo 131 | NSPropertyList 132 | NSProtocolecker 133 | NSProxy 134 | NSRange 135 | NSRunLoop 136 | NSScanner 137 | NSSerialization 138 | NSSet 139 | NSSortDescriptor 140 | NSSpellServer 141 | NSStream 142 | NSString 143 | NSTask 144 | NSRead 145 | NSTimer 146 | NSTimeZone 147 | NSUndoManager 148 | NSURLAuenticationallenge 149 | NSURLCae 150 | NSURLConnection 151 | NSURLCredential 152 | NSURLCredentialStorage 153 | NSURLDownload 154 | NSURLError 155 | NSURL 156 | NSURLHandle 157 | NSURLProtectionSpace 158 | NSURLProtocol 159 | NSURLRequest 160 | NSURLResponse 161 | NSUserDefaults 162 | NSUtilities 163 | NSValue 164 | NSValueTransformer 165 | NSXMLParser 166 | NSZone 167 | 168 | autocompleteWords 169 | 170 | 171 | 172 | -------------------------------------------------------------------------------- /Syntax Definitions/freefem.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | firstSingleLineComment 20 | // 21 | secondSingleLineComment 22 | 23 | beginFirstMultiLineComment 24 | /* 25 | endFirstMultiLineComment 26 | */ 27 | beginSecondMultiLineComment 28 | 29 | endSecondMultiLineComment 30 | 31 | functionDefinition 32 | ^\s*.*\(.*\)\n?\s*{ 33 | removeFromFunction 34 | 35 | keywordsCaseSensitive 36 | 37 | recolourKeywordIfAlreadyColoured 38 | 39 | keywords 40 | 41 | adaptmesh 42 | Cmatrix 43 | R3 44 | bool 45 | border 46 | break 47 | buildmesh 48 | cin 49 | complex 50 | continue 51 | cout 52 | element 53 | else 54 | end 55 | fespace 56 | for 57 | func 58 | if 59 | ifstream 60 | include 61 | int 62 | intalledge 63 | load 64 | macro 65 | matrix 66 | mesh 67 | movemesh 68 | ofstream 69 | namespace 70 | plot 71 | problem 72 | real 73 | return 74 | savemesh 75 | solve 76 | string 77 | vertex 78 | varf 79 | while 80 | int1d 81 | int2d 82 | on 83 | square 84 | dx 85 | dy 86 | convect 87 | jump 88 | mean 89 | wait 90 | ps 91 | solver 92 | CG 93 | LU 94 | UMFPACK 95 | factorize 96 | init 97 | endl 98 | x 99 | y 100 | z 101 | pi 102 | i 103 | sin 104 | cos 105 | tan 106 | atan 107 | asin 108 | acos 109 | cotan 110 | sinh 111 | cosh 112 | tanh 113 | cotanh 114 | exp 115 | log 116 | log10 117 | sqrt 118 | abs 119 | max 120 | min 121 | nbvx 122 | label 123 | region 124 | value 125 | set 126 | fill 127 | true 128 | false 129 | trunc 130 | triangulate 131 | splitmesh 132 | savemesh 133 | region 134 | readmesh 135 | randreal1 136 | randreal2 137 | randreal3 138 | randint31 139 | randint32 140 | randres53 141 | polar 142 | pow 143 | on 144 | 145 | autocompleteWords 146 | 147 | 148 | 149 | -------------------------------------------------------------------------------- /Syntax Definitions/java.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(static|public|private|protected|internal).*\(.*\).*\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstract 44 | break 45 | case 46 | catch 47 | continue 48 | default 49 | do 50 | else 51 | extends 52 | final 53 | finally 54 | for 55 | if 56 | implements 57 | instanceof 58 | native 59 | new 60 | private 61 | protected 62 | public 63 | return 64 | static 65 | switch 66 | synchronized 67 | throw 68 | throws 69 | transient 70 | try 71 | volatile 72 | while 73 | package 74 | import 75 | boolean 76 | byte 77 | char 78 | class 79 | double 80 | float 81 | int 82 | interface 83 | long 84 | short 85 | void 86 | assert 87 | strictfp 88 | false 89 | null 90 | super 91 | this 92 | true 93 | goto 94 | const 95 | enum 96 | 97 | autocompleteWords 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /Syntax Definitions/javafx.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | after 44 | as 45 | attribute 46 | before 47 | bind 48 | Boolean 49 | break 50 | catch 51 | class 52 | continue 53 | delete 54 | do 55 | else 56 | extends 57 | finally 58 | first 59 | for 60 | foreach 61 | format 62 | from 63 | function 64 | import 65 | if 66 | in 67 | indexof 68 | insert 69 | instanceof 70 | Integer 71 | into 72 | inverse 73 | last 74 | later 75 | lazy 76 | new 77 | Number 78 | on 79 | operation 80 | return 81 | reverse 82 | select 83 | sizeof 84 | String 85 | then 86 | this 87 | throw 88 | trigger 89 | try 90 | var 91 | where 92 | while 93 | 94 | autocompleteWords 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /Syntax Definitions/latex.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | { 7 | endCommand 8 | } 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | \ 15 | endVariable 16 | {}()[],?.;/:+=><~ 17 | firstString 18 | $ 19 | secondString 20 | 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | \\((sub)*section|part|chapter|paragraph){[^}]*} 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | \begin{document} 44 | \end{document} 45 | 46 | autocompleteWords 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /Syntax Definitions/nemerle.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | # 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | keywordsCaseSensitive 34 | 35 | recolourKeywordIfAlreadyColoured 36 | 37 | keywords 38 | 39 | abstract 40 | def 41 | extern 42 | internal 43 | mutable 44 | new 45 | override 46 | partial 47 | public 48 | private 49 | protected 50 | sealed 51 | static 52 | virtual 53 | volatile 54 | macro 55 | namespace 56 | using 57 | array 58 | byte 59 | decimal 60 | double 61 | float 62 | int 63 | list 64 | long 65 | null 66 | sbyte 67 | short 68 | string 69 | uint 70 | ulong 71 | ushort 72 | void 73 | _ 74 | as 75 | assert 76 | base 77 | catch 78 | checked 79 | do 80 | else 81 | false 82 | finally 83 | for 84 | foreach 85 | fun 86 | get 87 | if 88 | ignore 89 | implements 90 | in 91 | is 92 | lock 93 | match 94 | null 95 | out 96 | params 97 | ref 98 | set 99 | syntax 100 | this 101 | throw 102 | true 103 | try 104 | typeof 105 | unchecked 106 | unless 107 | when 108 | where 109 | while 110 | with 111 | class 112 | enum 113 | delegate 114 | event 115 | interface 116 | module 117 | struct 118 | type 119 | variant 120 | 121 | autocompleteWords 122 | 123 | 124 | functionDefinition 125 | class 126 | 127 | -------------------------------------------------------------------------------- /Syntax Definitions/none.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | allowSyntaxColouring 42 | 43 | keywords 44 | 45 | autocompleteWords 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Syntax Definitions/objectivecaml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | (* 27 | endFirstMultiLineComment 28 | *) 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | as 45 | assert 46 | asr 47 | begin 48 | class 49 | constraint 50 | do 51 | done 52 | downto 53 | else 54 | end 55 | exception 56 | external 57 | false 58 | for 59 | fun 60 | function 61 | functor 62 | if 63 | in 64 | include 65 | inherit 66 | initializer 67 | land 68 | lazy 69 | let 70 | lor 71 | lsl 72 | lsr 73 | lxor 74 | match 75 | method 76 | mod 77 | module 78 | mutable 79 | new 80 | object 81 | of 82 | open 83 | or 84 | private 85 | rec 86 | sig 87 | struct 88 | then 89 | to 90 | true 91 | try 92 | type 93 | val 94 | virtual 95 | when 96 | while 97 | with 98 | 99 | autocompleteWords 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /Syntax Definitions/pascal.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | { 27 | endFirstMultiLineComment 28 | } 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*\w*(function|procedure)\s+\w\(.*\).*;$ 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | array 45 | asm 46 | case 47 | const 48 | div 49 | do 50 | downto 51 | else 52 | file 53 | for 54 | function 55 | goto 56 | if 57 | in 58 | label 59 | mod 60 | nil 61 | not 62 | of 63 | operator 64 | or 65 | packed 66 | procedure 67 | program 68 | record 69 | repeat 70 | set 71 | then 72 | to 73 | type 74 | unit 75 | until 76 | uses 77 | var 78 | while 79 | with 80 | xor 81 | at 82 | automated 83 | break 84 | continue 85 | dispinterface 86 | dispose 87 | exit 88 | false 89 | finalization 90 | initialization 91 | library 92 | new 93 | published 94 | resourcestring 95 | self 96 | true 97 | as 98 | bindable 99 | constructor 100 | destructor 101 | except 102 | export 103 | finally 104 | import 105 | implementation 106 | inherited 107 | inline 108 | interface 109 | is 110 | module 111 | on 112 | only 113 | otherwise 114 | private 115 | property 116 | protected 117 | public 118 | qualified 119 | raise 120 | restricted 121 | shl 122 | shr 123 | threadvar 124 | try 125 | Integer 126 | Cardinal 127 | ShortInt 128 | SmallInt 129 | LongInt 130 | Int64 131 | Byte 132 | Word 133 | LongWord 134 | Char 135 | AnsiChar 136 | WideChar 137 | Boolean 138 | ByteBool 139 | WordBool 140 | LongBool 141 | Single 142 | Double 143 | Extended 144 | Comp 145 | Currency 146 | Real 147 | Real48 148 | String 149 | ShortString 150 | AnsiString 151 | WideString 152 | Pointer 153 | Variant 154 | File 155 | Text 156 | FIXME 157 | TODO 158 | ### 159 | 160 | autocompleteWords 161 | 162 | 163 | 164 | 165 | -------------------------------------------------------------------------------- /Syntax Definitions/pdf.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | / 15 | endVariable 16 | ()><[]{}/% 17 | firstString 18 | 19 | secondString 20 | 21 | firstSingleLineComment 22 | % 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | endobj 44 | endstream 45 | f 46 | false 47 | n 48 | null 49 | obj 50 | R 51 | startxref 52 | stream 53 | trailer 54 | true 55 | xref 56 | 57 | autocompleteWords 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /Syntax Definitions/plist.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | <? 11 | endInstruction 12 | ?> 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | key 47 | string 48 | real 49 | integer 50 | date 51 | true 52 | false 53 | data 54 | array 55 | dict 56 | 57 | 58 | -------------------------------------------------------------------------------- /Syntax Definitions/scala.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | def 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstract 44 | case 45 | catch 46 | class 47 | def 48 | do 49 | else 50 | extends 51 | false 52 | final 53 | finally 54 | for 55 | if 56 | implicit 57 | import 58 | match 59 | new 60 | null 61 | object 62 | override 63 | package 64 | private 65 | protected 66 | requires 67 | return 68 | sealed 69 | super 70 | this 71 | throw 72 | trait 73 | try 74 | true 75 | type 76 | val 77 | var 78 | while 79 | with 80 | yield 81 | 82 | autocompleteWords 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /Syntax Definitions/sgml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | 44 | autocompleteWords 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Syntax Definitions/shell.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | ` 7 | endCommand 8 | ´ 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | $ 15 | endVariable 16 | (){}=;:[] 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | # 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*(function)?\s?\w*(\(\))?\s?\n?\s*\{ 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | if 44 | then 45 | elif 46 | else 47 | fi 48 | case 49 | in 50 | ;; 51 | esac 52 | while 53 | for 54 | do 55 | done 56 | continue 57 | local 58 | return 59 | 60 | autocompleteWords 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Syntax Definitions/sml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | (* 27 | endFirstMultiLineComment 28 | *) 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | abstype 44 | and 45 | andalso 46 | as 47 | case 48 | do 49 | datatype 50 | else 51 | end 52 | eqtype 53 | exception 54 | false 55 | fn 56 | fun 57 | functor 58 | handle 59 | if 60 | in 61 | include 62 | infix 63 | infixr 64 | let 65 | local 66 | nonfix 67 | of 68 | op 69 | open 70 | orelse 71 | raise 72 | rec 73 | sharing 74 | sig 75 | signature 76 | struct 77 | structure 78 | then 79 | true 80 | type 81 | val 82 | where 83 | with 84 | withtype 85 | while 86 | unit 87 | int 88 | real 89 | char 90 | string 91 | substring 92 | word 93 | ref 94 | array 95 | vector 96 | bool 97 | list 98 | option 99 | order 100 | 101 | autocompleteWords 102 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /Syntax Definitions/standard.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | allowSyntaxColouring 42 | 43 | keywords 44 | 45 | autocompleteWords 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /Syntax Definitions/supercollider.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | | 11 | endInstruction 12 | | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | ar 45 | arg 46 | case 47 | classvar 48 | collect 49 | do 50 | dup 51 | false 52 | if 53 | inf 54 | kr 55 | new 56 | nil 57 | or 58 | protect 59 | switch 60 | this 61 | true 62 | super 63 | try 64 | var 65 | while 66 | 67 | autocompleteWords 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /Syntax Definitions/torquescript.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autocompleteWords 6 | 7 | beginCommand 8 | 9 | beginFirstMultiLineComment 10 | /* 11 | beginInstruction 12 | 13 | beginSecondMultiLineComment 14 | 15 | beginVariable 16 | $% 17 | endCommand 18 | 19 | endFirstMultiLineComment 20 | */ 21 | endInstruction 22 | 23 | endSecondMultiLineComment 24 | 25 | endVariable 26 | ./*+-()=; 27 | firstSingleLineComment 28 | // 29 | firstString 30 | " 31 | functionDefinition 32 | ^\s*\w*function\s+.* 33 | keywords 34 | 35 | break 36 | case 37 | continue 38 | datablock 39 | default 40 | else 41 | function 42 | if 43 | for 44 | new 45 | or 46 | package 47 | return 48 | switch 49 | switch$ 50 | while 51 | yes 52 | no 53 | on 54 | off 55 | true 56 | false 57 | 58 | keywordsCaseSensitive 59 | 60 | recolourKeywordIfAlreadyColoured 61 | 62 | removeFromFunction 63 | function 64 | secondSingleLineComment 65 | 66 | secondString 67 | ' 68 | 69 | 70 | -------------------------------------------------------------------------------- /Syntax Definitions/vb.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | ' 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | 27 | endFirstMultiLineComment 28 | 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*\w*(function|sub)\s+.* 35 | removeFromFunction 36 | function 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | if 44 | then 45 | else 46 | elseif 47 | select 48 | case 49 | for 50 | to 51 | step 52 | next 53 | each 54 | in 55 | do 56 | while 57 | until 58 | loop 59 | wend 60 | exit 61 | end 62 | function 63 | sub 64 | class 65 | property 66 | get 67 | let 68 | set 69 | byval 70 | byref 71 | const 72 | dim 73 | redim 74 | preserve 75 | as 76 | set 77 | with 78 | new 79 | public 80 | default 81 | private 82 | rem 83 | call 84 | execute 85 | eval 86 | on 87 | error 88 | goto 89 | resume 90 | option 91 | explicit 92 | erase 93 | randomize 94 | is 95 | mod 96 | and 97 | or 98 | not 99 | xor 100 | imp 101 | false 102 | true 103 | empty 104 | nothing 105 | null 106 | 107 | autocompleteWords 108 | 109 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /Syntax Definitions/verilog.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | 7 | endCommand 8 | 9 | beginInstruction 10 | 11 | endInstruction 12 | 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | 21 | firstSingleLineComment 22 | // 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | /* 27 | endFirstMultiLineComment 28 | */ 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | ^\s*.*\(.*\)\n?\s*\{ 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | and 44 | always 45 | assign 46 | attribute 47 | begin 48 | buf 49 | bufif0 50 | bufif1 51 | case 52 | cmos 53 | deassign 54 | default 55 | defparam 56 | disable 57 | else 58 | endattribute 59 | end 60 | endcase 61 | endfunction 62 | endprimitive 63 | endmodule 64 | endtable 65 | endtask 66 | event 67 | for 68 | force 69 | forever 70 | fork 71 | function 72 | highz0 73 | highz1 74 | if 75 | `include 76 | initial 77 | inout 78 | input 79 | integer 80 | join 81 | large 82 | medium 83 | module 84 | nand 85 | negedge 86 | nor 87 | not 88 | notif0 89 | notif1 90 | nmos 91 | or 92 | output 93 | parameter 94 | pmos 95 | posedge 96 | primitive 97 | pulldown 98 | pullup 99 | pull0 100 | pull1 101 | rcmos 102 | reg 103 | release 104 | repeat 105 | rnmos 106 | rpmos 107 | rtran 108 | rtranif0 109 | rtranif1 110 | scalared 111 | small 112 | specify 113 | specparam 114 | strong0 115 | strong1 116 | supply0 117 | supply1 118 | table 119 | task 120 | tran 121 | tranif0 122 | tranif1 123 | time 124 | tri 125 | triand 126 | trior 127 | trireg 128 | tri0 129 | tri1 130 | vectored 131 | wait 132 | wand 133 | weak0 134 | weak1 135 | while 136 | wire 137 | wor 138 | 139 | autocompleteWords 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /Syntax Definitions/vhdl.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | autocompleteWords 6 | 7 | beginCommand 8 | 9 | beginFirstMultiLineComment 10 | 11 | beginInstruction 12 | 13 | beginSecondMultiLineComment 14 | 15 | beginVariable 16 | 17 | endCommand 18 | 19 | endFirstMultiLineComment 20 | 21 | endInstruction 22 | 23 | endSecondMultiLineComment 24 | 25 | endVariable 26 | 27 | firstSingleLineComment 28 | -- 29 | firstString 30 | " 31 | functionDefinition 32 | ^\s*.*\(.*\)\n?\s*\{ 33 | keywords 34 | 35 | abs 36 | access 37 | after 38 | alias 39 | all 40 | and 41 | architecture 42 | array 43 | assert 44 | attribute 45 | begin 46 | block 47 | body 48 | buffer 49 | bus 50 | case 51 | component 52 | configuration 53 | constant 54 | disconnect 55 | downto 56 | else 57 | elsif 58 | end 59 | entity 60 | exit 61 | file 62 | for 63 | function 64 | generate 65 | generic 66 | group 67 | guarded 68 | if 69 | impure 70 | in 71 | inertial 72 | inout 73 | is 74 | label 75 | library 76 | linkage 77 | literal 78 | loop 79 | map 80 | mod 81 | nand 82 | new 83 | next 84 | nor 85 | not 86 | null 87 | of 88 | on 89 | open 90 | or 91 | others 92 | out 93 | package 94 | port 95 | postponed 96 | procedure 97 | process 98 | pure 99 | range 100 | record 101 | register 102 | reject 103 | rem 104 | report 105 | return 106 | rol 107 | ror 108 | select 109 | severity 110 | shared 111 | signal 112 | sla 113 | sll 114 | sra 115 | srl 116 | subtype 117 | then 118 | to 119 | transport 120 | type 121 | unaffected 122 | units 123 | until 124 | use 125 | variable 126 | wait 127 | when 128 | while 129 | with 130 | xnor 131 | xor 132 | 133 | keywordsCaseSensitive 134 | 135 | recolourKeywordIfAlreadyColoured 136 | 137 | removeFromFunction 138 | 139 | secondSingleLineComment 140 | 141 | secondString 142 | ' 143 | 144 | 145 | -------------------------------------------------------------------------------- /Syntax Definitions/xml.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | beginCommand 6 | < 7 | endCommand 8 | > 9 | beginInstruction 10 | <? 11 | endInstruction 12 | ?> 13 | beginVariable 14 | 15 | endVariable 16 | 17 | firstString 18 | " 19 | secondString 20 | ' 21 | firstSingleLineComment 22 | 23 | secondSingleLineComment 24 | 25 | beginFirstMultiLineComment 26 | <!-- 27 | endFirstMultiLineComment 28 | --> 29 | beginSecondMultiLineComment 30 | 31 | endSecondMultiLineComment 32 | 33 | functionDefinition 34 | 35 | removeFromFunction 36 | 37 | keywordsCaseSensitive 38 | 39 | recolourKeywordIfAlreadyColoured 40 | 41 | keywords 42 | 43 | CDATA 44 | EMPTY 45 | INCLUDE 46 | IGNORE 47 | NDATA 48 | #IMPLIED 49 | #PCDATA 50 | #REQUIRED 51 | 52 | autocompleteWords 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /TODO.md: -------------------------------------------------------------------------------- 1 | #Todo 2 | 3 | 1. Line numbering alignment has issues when scrolling to the end of long documents. The vlidholt repo seemed to offer an improvement (see SMLGUtterTextView) but I am not sure if it addresses the real root of the problem. 4 | 5 | 1. Syntax definitions conflate language keywords and function, class method names. Adding additional recolouring is not difficult but the syntax definitions would have to be carefully filtered for all languages. 6 | 7 | 1. Autocomplete keyword colouring. Autocomplete keywords can be specified and coloured separately to keywords. To me it seems that keywords should be defined by the language syntax. Autocomplete items should contain a list of available functions, names, constants and methods. At present, for most definitions, these items have been incorporated into the keyword list. Perhaps the name of this group is what has confused people in the past (it has certainly confused me). Another name? Perhaps ?. In my option true keywords should not autocomplete. 8 | 9 | 1. Scrolling causes a lot of recolouring. Something seems amiss here. Surely we should be able to cache our coloured range and only recolour when required. This seems like a fairly fundamental requirement. 10 | 11 | 1. Unit tests. Define strings. Colour them and validate the colouring. 12 | 13 | 1. Define source files in the bundle for each supported language type. These can be loaded in the example app to validate colouring. An NSStepper might be useful too. 14 | 15 | 1. Delegate colouring protocol seems useful. Perhaps it can be extended. 16 | 17 | 1. Would SMLTextView subclassing be beneficial? The client could pass in the required subclass name in the document spec. 18 | 19 | 1. Pull in syntax colouring changes from https://github.com/faceleg/Fragaria. This adds additional regex based colouring and support for Markdown. 20 | 21 | 1. Syntax definitions are currently loaded from the framework bundle. It would be useful if the client app could supply an externally defined syntax definition dictionary to provide custom language support. 22 | -------------------------------------------------------------------------------- /editor-breakpoint-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/editor-breakpoint-0.png -------------------------------------------------------------------------------- /editor-breakpoint-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/editor-breakpoint-1.png -------------------------------------------------------------------------------- /editor-breakpoint-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/editor-breakpoint-2.png -------------------------------------------------------------------------------- /editor-breakpoint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/editor-breakpoint.png -------------------------------------------------------------------------------- /editor-warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KosmicTask/Fragaria/a75e529c7fa5cfe4ec758e13df4d204b8a6a301c/editor-warning.png -------------------------------------------------------------------------------- /icu/LICENSE.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ICU License - ICU 1.8.1 and later 6 | 7 | 8 | 9 |

ICU License - ICU 1.8.1 and later

10 | 11 |

COPYRIGHT AND PERMISSION NOTICE

12 | 13 |

14 | Copyright (c) 1995-2006 International Business Machines Corporation and others 15 |

16 |

17 | All rights reserved. 18 |

19 |

20 | Permission is hereby granted, free of charge, to any person obtaining a copy 21 | of this software and associated documentation files (the "Software"), 22 | to deal in the Software without restriction, including without limitation 23 | the rights to use, copy, modify, merge, publish, distribute, and/or sell 24 | copies of the Software, and to permit persons 25 | to whom the Software is furnished to do so, provided that the above 26 | copyright notice(s) and this permission notice appear in all copies 27 | of the Software and that both the above copyright notice(s) and this 28 | permission notice appear in supporting documentation. 29 |

30 |

31 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 32 | INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 33 | PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL 34 | THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, 35 | OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 36 | RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 37 | NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE 38 | USE OR PERFORMANCE OF THIS SOFTWARE. 39 |

40 |

41 | Except as contained in this notice, the name of a copyright holder shall not be 42 | used in advertising or otherwise to promote the sale, use or other dealings in 43 | this Software without prior written authorization of the copyright holder. 44 |

45 | 46 |
47 |

48 | All trademarks and registered trademarks mentioned herein are the property of their respective owners. 49 |

50 | 51 | 52 | -------------------------------------------------------------------------------- /icu/unicode/parseerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | ********************************************************************** 3 | * Copyright (C) 1999-2004, International Business Machines 4 | * Corporation and others. All Rights Reserved. 5 | ********************************************************************** 6 | * Date Name Description 7 | * 03/14/00 aliu Creation. 8 | * 06/27/00 aliu Change from C++ class to C struct 9 | ********************************************************************** 10 | */ 11 | #ifndef PARSEERR_H 12 | #define PARSEERR_H 13 | 14 | #include "unicode/utypes.h" 15 | 16 | 17 | /** 18 | * The capacity of the context strings in UParseError. 19 | * @stable ICU 2.0 20 | */ 21 | enum { U_PARSE_CONTEXT_LEN = 16 }; 22 | 23 | /** 24 | * A UParseError struct is used to returned detailed information about 25 | * parsing errors. It is used by ICU parsing engines that parse long 26 | * rules, patterns, or programs, where the text being parsed is long 27 | * enough that more information than a UErrorCode is needed to 28 | * localize the error. 29 | * 30 | *

The line, offset, and context fields are optional; parsing 31 | * engines may choose not to use to use them. 32 | * 33 | *

The preContext and postContext strings include some part of the 34 | * context surrounding the error. If the source text is "let for=7" 35 | * and "for" is the error (e.g., because it is a reserved word), then 36 | * some examples of what a parser might produce are the following: 37 | * 38 | *

39 |  * preContext   postContext
40 |  * ""           ""            The parser does not support context
41 |  * "let "       "=7"          Pre- and post-context only
42 |  * "let "       "for=7"       Pre- and post-context and error text
43 |  * ""           "for"         Error text only
44 |  * 
45 | * 46 | *

Examples of engines which use UParseError (or may use it in the 47 | * future) are Transliterator, RuleBasedBreakIterator, and 48 | * RegexPattern. 49 | * 50 | * @stable ICU 2.0 51 | */ 52 | typedef struct UParseError { 53 | 54 | /** 55 | * The line on which the error occured. If the parser uses this 56 | * field, it sets it to the line number of the source text line on 57 | * which the error appears, which will be be a value >= 1. If the 58 | * parse does not support line numbers, the value will be <= 0. 59 | * @stable ICU 2.0 60 | */ 61 | int32_t line; 62 | 63 | /** 64 | * The character offset to the error. If the line field is >= 1, 65 | * then this is the offset from the start of the line. Otherwise, 66 | * this is the offset from the start of the text. If the parser 67 | * does not support this field, it will have a value < 0. 68 | * @stable ICU 2.0 69 | */ 70 | int32_t offset; 71 | 72 | /** 73 | * Textual context before the error. Null-terminated. The empty 74 | * string if not supported by parser. 75 | * @stable ICU 2.0 76 | */ 77 | UChar preContext[U_PARSE_CONTEXT_LEN]; 78 | 79 | /** 80 | * The error itself and/or textual context after the error. 81 | * Null-terminated. The empty string if not supported by parser. 82 | * @stable ICU 2.0 83 | */ 84 | UChar postContext[U_PARSE_CONTEXT_LEN]; 85 | 86 | } UParseError; 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /icu/unicode/uconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | ********************************************************************** 3 | * Copyright (C) 2002-2004, International Business Machines 4 | * Corporation and others. All Rights Reserved. 5 | ********************************************************************** 6 | * file name: uconfig.h 7 | * encoding: US-ASCII 8 | * tab size: 8 (not used) 9 | * indentation:4 10 | * 11 | * created on: 2002sep19 12 | * created by: Markus W. Scherer 13 | */ 14 | 15 | #ifndef __UCONFIG_H__ 16 | #define __UCONFIG_H__ 17 | 18 | /*! 19 | * \file 20 | * \brief Switches for excluding parts of ICU library code modules. 21 | * 22 | * Allows to build partial, smaller libraries for special purposes. 23 | * By default, all modules are built. 24 | * The switches are fairly coarse, controlling large modules. 25 | * Basic services cannot be turned off. 26 | * 27 | * @stable ICU 2.4 28 | */ 29 | 30 | /** 31 | * \def UCONFIG_ONLY_COLLATION 32 | * This switch turns off modules that are not needed for collation. 33 | * 34 | * It does not turn off legacy conversion because that is necessary 35 | * for ICU to work on EBCDIC platforms (for the default converter). 36 | * If you want "only collation" and do not build for EBCDIC, 37 | * then you can #define UCONFIG_NO_LEGACY_CONVERSION 1 as well. 38 | * 39 | * @stable ICU 2.4 40 | */ 41 | #ifndef UCONFIG_ONLY_COLLATION 42 | # define UCONFIG_ONLY_COLLATION 0 43 | #endif 44 | 45 | #if UCONFIG_ONLY_COLLATION 46 | /* common library */ 47 | # define UCONFIG_NO_BREAK_ITERATION 1 48 | # define UCONFIG_NO_IDNA 1 49 | 50 | /* i18n library */ 51 | # if UCONFIG_NO_COLLATION 52 | # error Contradictory collation switches in uconfig.h. 53 | # endif 54 | # define UCONFIG_NO_FORMATTING 1 55 | # define UCONFIG_NO_TRANSLITERATION 1 56 | # define UCONFIG_NO_REGULAR_EXPRESSIONS 1 57 | #endif 58 | 59 | /* common library switches -------------------------------------------------- */ 60 | 61 | /** 62 | * \def UCONFIG_NO_CONVERSION 63 | * ICU will not completely build with this switch turned on. 64 | * This switch turns off all converters. 65 | * 66 | * @draft ICU 3.2 67 | */ 68 | #ifndef UCONFIG_NO_CONVERSION 69 | # define UCONFIG_NO_CONVERSION 0 70 | #endif 71 | 72 | #if UCONFIG_NO_CONVERSION 73 | # define UCONFIG_NO_LEGACY_CONVERSION 1 74 | #endif 75 | 76 | /** 77 | * \def UCONFIG_NO_LEGACY_CONVERSION 78 | * This switch turns off all converters except for 79 | * - Unicode charsets (UTF-7/8/16/32, CESU-8, SCSU, BOCU-1) 80 | * - US-ASCII 81 | * - ISO-8859-1 82 | * 83 | * Turning off legacy conversion is not possible on EBCDIC platforms 84 | * because they need ibm-37 or ibm-1047 default converters. 85 | * 86 | * @stable ICU 2.4 87 | */ 88 | #ifndef UCONFIG_NO_LEGACY_CONVERSION 89 | # define UCONFIG_NO_LEGACY_CONVERSION 0 90 | #endif 91 | 92 | /** 93 | * \def UCONFIG_NO_NORMALIZATION 94 | * This switch turns off normalization. 95 | * It implies turning off several other services as well, for example 96 | * collation and IDNA. 97 | * 98 | * @stable ICU 2.6 99 | */ 100 | #ifndef UCONFIG_NO_NORMALIZATION 101 | # define UCONFIG_NO_NORMALIZATION 0 102 | #elif UCONFIG_NO_NORMALIZATION 103 | /* common library */ 104 | # define UCONFIG_NO_IDNA 1 105 | 106 | /* i18n library */ 107 | # if UCONFIG_ONLY_COLLATION 108 | # error Contradictory collation switches in uconfig.h. 109 | # endif 110 | # define UCONFIG_NO_COLLATION 1 111 | # define UCONFIG_NO_TRANSLITERATION 1 112 | #endif 113 | 114 | /** 115 | * \def UCONFIG_NO_BREAK_ITERATION 116 | * This switch turns off break iteration. 117 | * 118 | * @stable ICU 2.4 119 | */ 120 | #ifndef UCONFIG_NO_BREAK_ITERATION 121 | # define UCONFIG_NO_BREAK_ITERATION 0 122 | #endif 123 | 124 | /** 125 | * \def UCONFIG_NO_IDNA 126 | * This switch turns off IDNA. 127 | * 128 | * @stable ICU 2.6 129 | */ 130 | #ifndef UCONFIG_NO_IDNA 131 | # define UCONFIG_NO_IDNA 0 132 | #endif 133 | 134 | /* i18n library switches ---------------------------------------------------- */ 135 | 136 | /** 137 | * \def UCONFIG_NO_COLLATION 138 | * This switch turns off collation and collation-based string search. 139 | * 140 | * @stable ICU 2.4 141 | */ 142 | #ifndef UCONFIG_NO_COLLATION 143 | # define UCONFIG_NO_COLLATION 0 144 | #endif 145 | 146 | /** 147 | * \def UCONFIG_NO_FORMATTING 148 | * This switch turns off formatting and calendar/timezone services. 149 | * 150 | * @stable ICU 2.4 151 | */ 152 | #ifndef UCONFIG_NO_FORMATTING 153 | # define UCONFIG_NO_FORMATTING 0 154 | #endif 155 | 156 | /** 157 | * \def UCONFIG_NO_TRANSLITERATION 158 | * This switch turns off transliteration. 159 | * 160 | * @stable ICU 2.4 161 | */ 162 | #ifndef UCONFIG_NO_TRANSLITERATION 163 | # define UCONFIG_NO_TRANSLITERATION 0 164 | #endif 165 | 166 | /** 167 | * \def UCONFIG_NO_REGULAR_EXPRESSIONS 168 | * This switch turns off regular expressions. 169 | * 170 | * @stable ICU 2.4 171 | */ 172 | #ifndef UCONFIG_NO_REGULAR_EXPRESSIONS 173 | # define UCONFIG_NO_REGULAR_EXPRESSIONS 0 174 | #endif 175 | 176 | /** 177 | * \def UCONFIG_NO_SERVICE 178 | * This switch turns off service registration. 179 | * 180 | * @draft ICU 3.2 181 | */ 182 | #ifndef UCONFIG_NO_SERVICE 183 | # define UCONFIG_NO_SERVICE 0 184 | #endif 185 | 186 | #endif 187 | -------------------------------------------------------------------------------- /main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Fragaria 4 | // 5 | // Created by Jonathan on 30/04/2010. 6 | // Copyright 2010 mugginsoft.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | return NSApplicationMain(argc, (const char **) argv); 14 | } 15 | --------------------------------------------------------------------------------