├── .gitignore ├── Extras ├── Final Report.pdf ├── Icons │ ├── v1 │ │ ├── icon0.png │ │ ├── icon1024.png │ │ ├── icon128.png │ │ ├── icon16.png │ │ ├── icon256.png │ │ ├── icon32.png │ │ ├── icon512.png │ │ ├── icon64.png │ │ └── toski icon 01.sketch │ └── v2 │ │ ├── Icon-1024.png │ │ ├── Icon-108@2x.png │ │ ├── Icon-128.png │ │ ├── Icon-128@2x.png │ │ ├── Icon-16.png │ │ ├── Icon-16@2x.png │ │ ├── Icon-20.png │ │ ├── Icon-20@2x.png │ │ ├── Icon-20@3x.png │ │ ├── Icon-24@2x.png │ │ ├── Icon-256.png │ │ ├── Icon-256@2x.png │ │ ├── Icon-27.5@2x.png │ │ ├── Icon-29.png │ │ ├── Icon-29@2x.png │ │ ├── Icon-29@3x.png │ │ ├── Icon-32.png │ │ ├── Icon-32@2x.png │ │ ├── Icon-40.png │ │ ├── Icon-40@2x.png │ │ ├── Icon-40@3x.png │ │ ├── Icon-44@2x.png │ │ ├── Icon-50@2x.png │ │ ├── Icon-512.png │ │ ├── Icon-512@2x.png │ │ ├── Icon-60@2x.png │ │ ├── Icon-60@3x.png │ │ ├── Icon-76.png │ │ ├── Icon-76@2x.png │ │ ├── Icon-83.5@2x.png │ │ ├── Icon-86@2x.png │ │ ├── Icon-98@2x.png │ │ ├── icon0.png │ │ └── toski icon 02.sketch └── Photos and Videos │ ├── Screen Shot 2017-05-08 at 2.37.00 AM.png │ ├── Screen Shot 2017-05-15 at 10.02.59 AM.png │ ├── Screen Shot 2017-05-15 at 10.11.51 AM.png │ ├── Screen Shot 2017-05-15 at 10.12.27 AM.png │ ├── Screen Shot 2019-06-19 at 3.58.52 PM.png │ ├── Screen Shot 2019-06-20 at 12.32.05 PM.png │ ├── Screen Shot 2019-06-20 at 12.32.32 PM.png │ ├── schemer-preview v0.1.gif │ ├── schemer-preview v0.1.mov │ ├── schemer-preview.gif │ ├── toski preview.mov │ ├── toski something.mov │ ├── toski.mov │ └── toski.mp4 ├── LICENSE ├── README.md └── Toski ├── Toski.xcodeproj ├── project.pbxproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ └── IDEWorkspaceChecks.plist └── Toski ├── AppDelegate.swift ├── Assets.xcassets ├── AppIcon.appiconset │ ├── Contents.json │ ├── Icon-1024.png │ ├── Icon-128.png │ ├── Icon-128@2x.png │ ├── Icon-16.png │ ├── Icon-16@2x.png │ ├── Icon-20@2x.png │ ├── Icon-20@3x.png │ ├── Icon-256.png │ ├── Icon-29.png │ ├── Icon-29@2x.png │ ├── Icon-29@3x.png │ ├── Icon-32.png │ ├── Icon-32@2x.png │ ├── Icon-40@2x.png │ ├── Icon-40@3x.png │ ├── Icon-512.png │ ├── Icon-512@2x.png │ ├── Icon-513.png │ ├── Icon-60@2x.png │ └── Icon-60@3x.png └── Contents.json ├── Base.lproj └── Main.storyboard ├── CodeField.swift ├── Info.plist ├── SchemeComm.swift ├── Schemer.entitlements ├── SourceCodePro-Regular.ttf ├── Syntaxr.swift ├── ViewController.swift └── startup.scm /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## User settings 6 | xcuserdata/ 7 | 8 | ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9) 9 | *.xcscmblueprint 10 | *.xccheckout 11 | 12 | ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4) 13 | build/ 14 | DerivedData/ 15 | *.moved-aside 16 | *.pbxuser 17 | !default.pbxuser 18 | *.mode1v3 19 | !default.mode1v3 20 | *.mode2v3 21 | !default.mode2v3 22 | *.perspectivev3 23 | !default.perspectivev3 24 | 25 | ## Xcode Patch 26 | *.xcodeproj/* 27 | !*.xcodeproj/project.pbxproj 28 | !*.xcodeproj/xcshareddata/ 29 | !*.xcworkspace/contents.xcworkspacedata 30 | /*.gcno -------------------------------------------------------------------------------- /Extras/Final Report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Final Report.pdf -------------------------------------------------------------------------------- /Extras/Icons/v1/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon0.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon1024.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon128.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon16.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon256.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon32.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon512.png -------------------------------------------------------------------------------- /Extras/Icons/v1/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/icon64.png -------------------------------------------------------------------------------- /Extras/Icons/v1/toski icon 01.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v1/toski icon 01.sketch -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-1024.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-108@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-108@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-128.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-128@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-16.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-16@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-20.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-20@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-20@3x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-24@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-24@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-256.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-256@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-27.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-27.5@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-29.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-29@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-29@3x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-32.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-32@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-40.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-40@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-40@3x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-44@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-44@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-50@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-50@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-512.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-512@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-60@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-60@3x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-76.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-76@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-83.5@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-86@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-86@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/Icon-98@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/Icon-98@2x.png -------------------------------------------------------------------------------- /Extras/Icons/v2/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/icon0.png -------------------------------------------------------------------------------- /Extras/Icons/v2/toski icon 02.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Icons/v2/toski icon 02.sketch -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2017-05-08 at 2.37.00 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2017-05-08 at 2.37.00 AM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.02.59 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.02.59 AM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.11.51 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.11.51 AM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.12.27 AM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2017-05-15 at 10.12.27 AM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2019-06-19 at 3.58.52 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2019-06-19 at 3.58.52 PM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2019-06-20 at 12.32.05 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2019-06-20 at 12.32.05 PM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/Screen Shot 2019-06-20 at 12.32.32 PM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/Screen Shot 2019-06-20 at 12.32.32 PM.png -------------------------------------------------------------------------------- /Extras/Photos and Videos/schemer-preview v0.1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/schemer-preview v0.1.gif -------------------------------------------------------------------------------- /Extras/Photos and Videos/schemer-preview v0.1.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/schemer-preview v0.1.mov -------------------------------------------------------------------------------- /Extras/Photos and Videos/schemer-preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/schemer-preview.gif -------------------------------------------------------------------------------- /Extras/Photos and Videos/toski preview.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/toski preview.mov -------------------------------------------------------------------------------- /Extras/Photos and Videos/toski something.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/toski something.mov -------------------------------------------------------------------------------- /Extras/Photos and Videos/toski.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/toski.mov -------------------------------------------------------------------------------- /Extras/Photos and Videos/toski.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Extras/Photos and Videos/toski.mp4 -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 - 2019 Blake Elias, Kenneth Friedman, Jared Pochtar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Toski 2 | A Prototype Debugging Tool for MIT Scheme 3 | 4 | ![Preview](https://github.com/kennethshawfriedman/Toski/blob/master/Extras/Photos%20and%20Videos/Screen%20Shot%202019-06-19%20at%203.58.52%20PM.png?raw=true) 5 | 6 | ## This repo contains: 7 | 8 | - Toski: The desktop IDE app project 9 | - Extras: containing supplemental files & images (no code) 10 | 11 | ## Requirements: 12 | 13 | Very simply, there are only two: the OS, and the language (dependencies considered harmful) 14 | 15 | - MacOS, running 10.10 or higher (OS X Yosemite or higher) 16 | - and because it's a Cocoa Mac App, XCode is required to build the app (but not to run it) 17 | - MIT-Scheme already installed. Follow installation instructions here: [MIT-Scheme from GNU][install]. The location of your installation *shouldn't* matter. 18 | 19 | ## How To Run 20 | 21 | Assuming you are on Mac running a modern version of MacOS (10.10 or higher), and you have mit-scheme installed: simply launch the app as you would any other GUI. 22 | 23 | You can download the fully built, GUI app here: [Schemer.app][release] 24 | 25 | [release]: https://github.com/kennethshawfriedman/Schemer/releases/latest 26 | 27 | ## Naming 28 | 29 | Toski is called Toski because Emacs is called Emacs. 30 | 31 | ## Building 32 | 33 | This project should build with any reasonably recent version of XCode (it was written and tested on XCode 10). 34 | 35 | _A note about stopping the Toski process_: Toski works by keeping an open pipe to an instance of MIT-Scheme. If you close the app normally, the pipe and the Scheme instance will stop. However, if you force-quit the app, or you use XCode to stop running a build of Toski, the MIT Scheme instance will continue running. Scheme will not like this, and it will start to use an unreasonable amount of CPU. If this happens, you can simply use Activity Monitor to force-quit processes that are called "mit-scheme-c". However the way to prevent this in the first place is to simply close out of the app, or Cmd-Q the app, instead of force-quitting it. -------------------------------------------------------------------------------- /Toski/Toski.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B91188511EBC3FAB003506C4 /* SchemeComm.swift in Sources */ = {isa = PBXBuildFile; fileRef = B91188501EBC3FAB003506C4 /* SchemeComm.swift */; }; 11 | B948769522BAB35400CB543F /* CodeField.swift in Sources */ = {isa = PBXBuildFile; fileRef = B948769422BAB35400CB543F /* CodeField.swift */; }; 12 | B95F695F1EB94D8A0074C915 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B95F695E1EB94D8A0074C915 /* AppDelegate.swift */; }; 13 | B95F69611EB94D8A0074C915 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B95F69601EB94D8A0074C915 /* ViewController.swift */; }; 14 | B95F69631EB94D8A0074C915 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B95F69621EB94D8A0074C915 /* Assets.xcassets */; }; 15 | B95F69661EB94D8A0074C915 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B95F69641EB94D8A0074C915 /* Main.storyboard */; }; 16 | B9C56FFB1EBEDD8A00876E1B /* SourceCodePro-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = B9C56FFA1EBEDD8A00876E1B /* SourceCodePro-Regular.ttf */; }; 17 | B9C56FFD1EC00F7200876E1B /* Syntaxr.swift in Sources */ = {isa = PBXBuildFile; fileRef = B9C56FFC1EC00F7200876E1B /* Syntaxr.swift */; }; 18 | B9D3A8EB1EC825BD003DA648 /* startup.scm in Resources */ = {isa = PBXBuildFile; fileRef = B9D3A8EA1EC825BD003DA648 /* startup.scm */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXFileReference section */ 22 | B91188501EBC3FAB003506C4 /* SchemeComm.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SchemeComm.swift; sourceTree = ""; }; 23 | B948769422BAB35400CB543F /* CodeField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodeField.swift; sourceTree = ""; }; 24 | B95F695B1EB94D8A0074C915 /* Toski.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Toski.app; sourceTree = BUILT_PRODUCTS_DIR; }; 25 | B95F695E1EB94D8A0074C915 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 26 | B95F69601EB94D8A0074C915 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 27 | B95F69621EB94D8A0074C915 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 28 | B95F69651EB94D8A0074C915 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 29 | B95F69671EB94D8A0074C915 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 30 | B9A322C622B9A6E800029728 /* Schemer.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Schemer.entitlements; sourceTree = ""; }; 31 | B9C56FFA1EBEDD8A00876E1B /* SourceCodePro-Regular.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SourceCodePro-Regular.ttf"; sourceTree = ""; }; 32 | B9C56FFC1EC00F7200876E1B /* Syntaxr.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Syntaxr.swift; sourceTree = ""; }; 33 | B9D3A8EA1EC825BD003DA648 /* startup.scm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = startup.scm; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | B95F69581EB94D8A0074C915 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXFrameworksBuildPhase section */ 45 | 46 | /* Begin PBXGroup section */ 47 | B95F69521EB94D890074C915 = { 48 | isa = PBXGroup; 49 | children = ( 50 | B95F695D1EB94D8A0074C915 /* Toski */, 51 | B95F695C1EB94D8A0074C915 /* Products */, 52 | ); 53 | sourceTree = ""; 54 | }; 55 | B95F695C1EB94D8A0074C915 /* Products */ = { 56 | isa = PBXGroup; 57 | children = ( 58 | B95F695B1EB94D8A0074C915 /* Toski.app */, 59 | ); 60 | name = Products; 61 | sourceTree = ""; 62 | }; 63 | B95F695D1EB94D8A0074C915 /* Toski */ = { 64 | isa = PBXGroup; 65 | children = ( 66 | B9A322C622B9A6E800029728 /* Schemer.entitlements */, 67 | B95F695E1EB94D8A0074C915 /* AppDelegate.swift */, 68 | B95F69601EB94D8A0074C915 /* ViewController.swift */, 69 | B948769422BAB35400CB543F /* CodeField.swift */, 70 | B9D3A8EA1EC825BD003DA648 /* startup.scm */, 71 | B9C56FFC1EC00F7200876E1B /* Syntaxr.swift */, 72 | B91188501EBC3FAB003506C4 /* SchemeComm.swift */, 73 | B95F69621EB94D8A0074C915 /* Assets.xcassets */, 74 | B95F69641EB94D8A0074C915 /* Main.storyboard */, 75 | B9C56FFA1EBEDD8A00876E1B /* SourceCodePro-Regular.ttf */, 76 | B95F69671EB94D8A0074C915 /* Info.plist */, 77 | ); 78 | path = Toski; 79 | sourceTree = ""; 80 | }; 81 | /* End PBXGroup section */ 82 | 83 | /* Begin PBXNativeTarget section */ 84 | B95F695A1EB94D8A0074C915 /* Toski */ = { 85 | isa = PBXNativeTarget; 86 | buildConfigurationList = B95F696A1EB94D8A0074C915 /* Build configuration list for PBXNativeTarget "Toski" */; 87 | buildPhases = ( 88 | B95F69571EB94D8A0074C915 /* Sources */, 89 | B95F69581EB94D8A0074C915 /* Frameworks */, 90 | B95F69591EB94D8A0074C915 /* Resources */, 91 | ); 92 | buildRules = ( 93 | ); 94 | dependencies = ( 95 | ); 96 | name = Toski; 97 | productName = Schemer; 98 | productReference = B95F695B1EB94D8A0074C915 /* Toski.app */; 99 | productType = "com.apple.product-type.application"; 100 | }; 101 | /* End PBXNativeTarget section */ 102 | 103 | /* Begin PBXProject section */ 104 | B95F69531EB94D890074C915 /* Project object */ = { 105 | isa = PBXProject; 106 | attributes = { 107 | LastSwiftUpdateCheck = 0830; 108 | LastUpgradeCheck = 1020; 109 | ORGANIZATIONNAME = "Kenneth Friedman"; 110 | TargetAttributes = { 111 | B95F695A1EB94D8A0074C915 = { 112 | CreatedOnToolsVersion = 8.3; 113 | DevelopmentTeam = F29E8CU7JT; 114 | LastSwiftMigration = 1020; 115 | ProvisioningStyle = Automatic; 116 | SystemCapabilities = { 117 | com.apple.HardenedRuntime = { 118 | enabled = 1; 119 | }; 120 | }; 121 | }; 122 | }; 123 | }; 124 | buildConfigurationList = B95F69561EB94D890074C915 /* Build configuration list for PBXProject "Toski" */; 125 | compatibilityVersion = "Xcode 3.2"; 126 | developmentRegion = en; 127 | hasScannedForEncodings = 0; 128 | knownRegions = ( 129 | en, 130 | Base, 131 | ); 132 | mainGroup = B95F69521EB94D890074C915; 133 | productRefGroup = B95F695C1EB94D8A0074C915 /* Products */; 134 | projectDirPath = ""; 135 | projectRoot = ""; 136 | targets = ( 137 | B95F695A1EB94D8A0074C915 /* Toski */, 138 | ); 139 | }; 140 | /* End PBXProject section */ 141 | 142 | /* Begin PBXResourcesBuildPhase section */ 143 | B95F69591EB94D8A0074C915 /* Resources */ = { 144 | isa = PBXResourcesBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | B95F69631EB94D8A0074C915 /* Assets.xcassets in Resources */, 148 | B9C56FFB1EBEDD8A00876E1B /* SourceCodePro-Regular.ttf in Resources */, 149 | B9D3A8EB1EC825BD003DA648 /* startup.scm in Resources */, 150 | B95F69661EB94D8A0074C915 /* Main.storyboard in Resources */, 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | /* End PBXResourcesBuildPhase section */ 155 | 156 | /* Begin PBXSourcesBuildPhase section */ 157 | B95F69571EB94D8A0074C915 /* Sources */ = { 158 | isa = PBXSourcesBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | B95F69611EB94D8A0074C915 /* ViewController.swift in Sources */, 162 | B9C56FFD1EC00F7200876E1B /* Syntaxr.swift in Sources */, 163 | B91188511EBC3FAB003506C4 /* SchemeComm.swift in Sources */, 164 | B948769522BAB35400CB543F /* CodeField.swift in Sources */, 165 | B95F695F1EB94D8A0074C915 /* AppDelegate.swift in Sources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXSourcesBuildPhase section */ 170 | 171 | /* Begin PBXVariantGroup section */ 172 | B95F69641EB94D8A0074C915 /* Main.storyboard */ = { 173 | isa = PBXVariantGroup; 174 | children = ( 175 | B95F69651EB94D8A0074C915 /* Base */, 176 | ); 177 | name = Main.storyboard; 178 | sourceTree = ""; 179 | }; 180 | /* End PBXVariantGroup section */ 181 | 182 | /* Begin XCBuildConfiguration section */ 183 | B95F69681EB94D8A0074C915 /* Debug */ = { 184 | isa = XCBuildConfiguration; 185 | buildSettings = { 186 | ALWAYS_SEARCH_USER_PATHS = NO; 187 | CLANG_ANALYZER_NONNULL = YES; 188 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 189 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 190 | CLANG_CXX_LIBRARY = "libc++"; 191 | CLANG_ENABLE_MODULES = YES; 192 | CLANG_ENABLE_OBJC_ARC = YES; 193 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 194 | CLANG_WARN_BOOL_CONVERSION = YES; 195 | CLANG_WARN_COMMA = YES; 196 | CLANG_WARN_CONSTANT_CONVERSION = YES; 197 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 198 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 199 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 200 | CLANG_WARN_EMPTY_BODY = YES; 201 | CLANG_WARN_ENUM_CONVERSION = YES; 202 | CLANG_WARN_INFINITE_RECURSION = YES; 203 | CLANG_WARN_INT_CONVERSION = YES; 204 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 205 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 206 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 207 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 208 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 209 | CLANG_WARN_STRICT_PROTOTYPES = YES; 210 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 211 | CLANG_WARN_UNREACHABLE_CODE = YES; 212 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 213 | CODE_SIGN_IDENTITY = "-"; 214 | COPY_PHASE_STRIP = NO; 215 | DEBUG_INFORMATION_FORMAT = dwarf; 216 | ENABLE_STRICT_OBJC_MSGSEND = YES; 217 | ENABLE_TESTABILITY = YES; 218 | GCC_C_LANGUAGE_STANDARD = gnu99; 219 | GCC_DYNAMIC_NO_PIC = NO; 220 | GCC_NO_COMMON_BLOCKS = YES; 221 | GCC_OPTIMIZATION_LEVEL = 0; 222 | GCC_PREPROCESSOR_DEFINITIONS = ( 223 | "DEBUG=1", 224 | "$(inherited)", 225 | ); 226 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 227 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 228 | GCC_WARN_UNDECLARED_SELECTOR = YES; 229 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 230 | GCC_WARN_UNUSED_FUNCTION = YES; 231 | GCC_WARN_UNUSED_VARIABLE = YES; 232 | MACOSX_DEPLOYMENT_TARGET = 10.10; 233 | MTL_ENABLE_DEBUG_INFO = YES; 234 | ONLY_ACTIVE_ARCH = YES; 235 | SDKROOT = macosx; 236 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 237 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 238 | }; 239 | name = Debug; 240 | }; 241 | B95F69691EB94D8A0074C915 /* Release */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_ANALYZER_NONNULL = YES; 246 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_MODULES = YES; 250 | CLANG_ENABLE_OBJC_ARC = YES; 251 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 252 | CLANG_WARN_BOOL_CONVERSION = YES; 253 | CLANG_WARN_COMMA = YES; 254 | CLANG_WARN_CONSTANT_CONVERSION = YES; 255 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 257 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 258 | CLANG_WARN_EMPTY_BODY = YES; 259 | CLANG_WARN_ENUM_CONVERSION = YES; 260 | CLANG_WARN_INFINITE_RECURSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 263 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 264 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 265 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 266 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 267 | CLANG_WARN_STRICT_PROTOTYPES = YES; 268 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 269 | CLANG_WARN_UNREACHABLE_CODE = YES; 270 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 271 | CODE_SIGN_IDENTITY = "-"; 272 | COPY_PHASE_STRIP = NO; 273 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 274 | ENABLE_NS_ASSERTIONS = NO; 275 | ENABLE_STRICT_OBJC_MSGSEND = YES; 276 | GCC_C_LANGUAGE_STANDARD = gnu99; 277 | GCC_NO_COMMON_BLOCKS = YES; 278 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 279 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 280 | GCC_WARN_UNDECLARED_SELECTOR = YES; 281 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 282 | GCC_WARN_UNUSED_FUNCTION = YES; 283 | GCC_WARN_UNUSED_VARIABLE = YES; 284 | MACOSX_DEPLOYMENT_TARGET = 10.10; 285 | MTL_ENABLE_DEBUG_INFO = NO; 286 | SDKROOT = macosx; 287 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 288 | }; 289 | name = Release; 290 | }; 291 | B95F696B1EB94D8A0074C915 /* Debug */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 295 | CODE_SIGN_IDENTITY = "Mac Developer"; 296 | COMBINE_HIDPI_IMAGES = YES; 297 | CURRENT_PROJECT_VERSION = 3; 298 | DEVELOPMENT_TEAM = F29E8CU7JT; 299 | ENABLE_HARDENED_RUNTIME = YES; 300 | INFOPLIST_FILE = Toski/Info.plist; 301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 302 | MARKETING_VERSION = 1.0.1; 303 | PRODUCT_BUNDLE_IDENTIFIER = com.kennethshawfriedman.Toski; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | SWIFT_VERSION = 5.0; 306 | }; 307 | name = Debug; 308 | }; 309 | B95F696C1EB94D8A0074C915 /* Release */ = { 310 | isa = XCBuildConfiguration; 311 | buildSettings = { 312 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 313 | CODE_SIGN_IDENTITY = "Mac Developer"; 314 | COMBINE_HIDPI_IMAGES = YES; 315 | CURRENT_PROJECT_VERSION = 3; 316 | DEVELOPMENT_TEAM = F29E8CU7JT; 317 | ENABLE_HARDENED_RUNTIME = YES; 318 | INFOPLIST_FILE = Toski/Info.plist; 319 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 320 | MARKETING_VERSION = 1.0.1; 321 | PRODUCT_BUNDLE_IDENTIFIER = com.kennethshawfriedman.Toski; 322 | PRODUCT_NAME = "$(TARGET_NAME)"; 323 | SWIFT_VERSION = 5.0; 324 | }; 325 | name = Release; 326 | }; 327 | /* End XCBuildConfiguration section */ 328 | 329 | /* Begin XCConfigurationList section */ 330 | B95F69561EB94D890074C915 /* Build configuration list for PBXProject "Toski" */ = { 331 | isa = XCConfigurationList; 332 | buildConfigurations = ( 333 | B95F69681EB94D8A0074C915 /* Debug */, 334 | B95F69691EB94D8A0074C915 /* Release */, 335 | ); 336 | defaultConfigurationIsVisible = 0; 337 | defaultConfigurationName = Release; 338 | }; 339 | B95F696A1EB94D8A0074C915 /* Build configuration list for PBXNativeTarget "Toski" */ = { 340 | isa = XCConfigurationList; 341 | buildConfigurations = ( 342 | B95F696B1EB94D8A0074C915 /* Debug */, 343 | B95F696C1EB94D8A0074C915 /* Release */, 344 | ); 345 | defaultConfigurationIsVisible = 0; 346 | defaultConfigurationName = Release; 347 | }; 348 | /* End XCConfigurationList section */ 349 | }; 350 | rootObject = B95F69531EB94D890074C915 /* Project object */; 351 | } 352 | -------------------------------------------------------------------------------- /Toski/Toski.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Toski/Toski.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Toski/Toski/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // Schemer 4 | // 5 | // Created by Kenneth Friedman on 5/2/17. 6 | // Copyright © 2017 Kenneth Friedman. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | @IBAction func executeCommand(_ sender: Any) { 15 | NotificationCenter.default.post(name: NSNotification.Name.init(rawValue: "executeCommand"), object: nil) 16 | } 17 | 18 | func applicationWillTerminate(_ aNotification: Notification) { 19 | //Kills the Scheme Process 20 | SchemeProcess.shared.terminate() 21 | print("Toski ended") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-29.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "1024x1024", 59 | "idiom" : "ios-marketing", 60 | "filename" : "Icon-1024.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "16x16", 65 | "idiom" : "mac", 66 | "filename" : "Icon-16.png", 67 | "scale" : "1x" 68 | }, 69 | { 70 | "size" : "16x16", 71 | "idiom" : "mac", 72 | "filename" : "Icon-16@2x.png", 73 | "scale" : "2x" 74 | }, 75 | { 76 | "size" : "32x32", 77 | "idiom" : "mac", 78 | "filename" : "Icon-32.png", 79 | "scale" : "1x" 80 | }, 81 | { 82 | "size" : "32x32", 83 | "idiom" : "mac", 84 | "filename" : "Icon-32@2x.png", 85 | "scale" : "2x" 86 | }, 87 | { 88 | "size" : "128x128", 89 | "idiom" : "mac", 90 | "filename" : "Icon-128.png", 91 | "scale" : "1x" 92 | }, 93 | { 94 | "size" : "128x128", 95 | "idiom" : "mac", 96 | "filename" : "Icon-128@2x.png", 97 | "scale" : "2x" 98 | }, 99 | { 100 | "size" : "256x256", 101 | "idiom" : "mac", 102 | "filename" : "Icon-256.png", 103 | "scale" : "1x" 104 | }, 105 | { 106 | "size" : "256x256", 107 | "idiom" : "mac", 108 | "filename" : "Icon-513.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "512x512", 113 | "idiom" : "mac", 114 | "filename" : "Icon-512.png", 115 | "scale" : "1x" 116 | }, 117 | { 118 | "size" : "512x512", 119 | "idiom" : "mac", 120 | "filename" : "Icon-512@2x.png", 121 | "scale" : "2x" 122 | } 123 | ], 124 | "info" : { 125 | "version" : 1, 126 | "author" : "xcode" 127 | } 128 | } -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-1024.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-128.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-128@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-16.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-16@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-20@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-20@3x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-256.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-32.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-32@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-40@3x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-512.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-512@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-513.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-513.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-60@2x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/Assets.xcassets/AppIcon.appiconset/Icon-60@3x.png -------------------------------------------------------------------------------- /Toski/Toski/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Toski/Toski/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | DQ 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | Default 396 | 397 | 398 | 399 | 400 | 401 | 402 | Left to Right 403 | 404 | 405 | 406 | 407 | 408 | 409 | Right to Left 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | Default 421 | 422 | 423 | 424 | 425 | 426 | 427 | Left to Right 428 | 429 | 430 | 431 | 432 | 433 | 434 | Right to Left 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | -------------------------------------------------------------------------------- /Toski/Toski/CodeField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodeField.swift 3 | // Toski 4 | // 5 | // Created by Kenneth Friedman on 6/19/19. 6 | // Copyright © 2019 Kenneth Friedman. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class CodeField : NSTextView { 12 | 13 | var parentVC : ViewController! 14 | 15 | required init?(coder: NSCoder) { 16 | super.init(coder: coder) 17 | 18 | //this forces a light mode... should support dark mode eventually 19 | self.backgroundColor = .white 20 | self.insertionPointColor = .black 21 | self.font = CodeField.standardFont() 22 | self.isContinuousSpellCheckingEnabled = false 23 | self.isAutomaticQuoteSubstitutionEnabled = false 24 | self.isAutomaticQuoteSubstitutionEnabled = false 25 | self.isEditable = false //don't edit until scheme launches 26 | self.textContainer?.containerSize = NSSize.init(width: CGFloat.infinity, height: CGFloat.infinity) 27 | } 28 | 29 | static func standardFont() -> NSFont { 30 | 31 | //tries to find source-code-pro (this *should* find the bundled font now) 32 | let fontDescriptor = NSFontDescriptor(name: "SourceCodePro-Regular", size: CodeField.stdFontSize()) 33 | let font = NSFont(descriptor: fontDescriptor, size: CodeField.stdFontSize()) 34 | if let f = font { 35 | return f 36 | } 37 | 38 | //if it can't find it, it uses Monaco (which *should* be default installed) 39 | let fontDescriptorBackup = NSFontDescriptor(name: "Monaco", size: CodeField.stdFontSize()) 40 | let fontBackup = NSFont(descriptor: fontDescriptorBackup, size: CodeField.stdFontSize()) 41 | if let fBackup = fontBackup { 42 | return fBackup 43 | } 44 | 45 | //if all else fails, it returns the system font 46 | return NSFont.systemFont(ofSize: CodeField.stdFontSize()) 47 | } 48 | 49 | static func stdAtrributes() -> [NSAttributedString.Key : Any] { 50 | return [NSAttributedString.Key.font : CodeField.standardFont()] 51 | } 52 | 53 | static func stdFontSize() -> CGFloat { 54 | return 16 55 | } 56 | 57 | func NSRangeFromRange(range r: Range) -> NSRange { 58 | let text = self.textStorage!.string 59 | let start = text.distance(from: text.startIndex, to: r.lowerBound) 60 | let length = text.distance(from: r.lowerBound, to: r.upperBound) 61 | return NSMakeRange(start, length) 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Toski/Toski/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | ATSApplicationFontsPath 6 | . 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIconFile 12 | 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | $(PRODUCT_NAME) 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(MARKETING_VERSION) 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSApplicationCategoryType 26 | public.app-category.developer-tools 27 | LSMinimumSystemVersion 28 | $(MACOSX_DEPLOYMENT_TARGET) 29 | NSHumanReadableCopyright 30 | Copyright © 2017 Kenneth Friedman. All rights reserved. 31 | NSMainStoryboardFile 32 | Main 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /Toski/Toski/SchemeComm.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SchemeComm.swift 3 | // Schemer 4 | // 5 | // Created by Kenneth Friedman on 5/5/17. 6 | // Copyright © 2017 Kenneth Friedman. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | //SchemeComm is used for Scheme Communication. 12 | //// All methods are static, so there is no need for instances 13 | class SchemeComm { 14 | 15 | //returns a Data object to be sent to Scheme. 16 | //This Data object is actually a string of the scheme code to be sent 17 | static func parseExecutionCommand(codingField cf:CodeField) -> Data { 18 | 19 | //string to append code to 20 | var result:String = "" 21 | //error message: used if it can't find text in the codeField 22 | let nothingHereMessage = "(pp \"Something Has Gone Wrong, the text can't be found.\")" 23 | //get string from codeField 24 | let currentText:String = cf.textStorage?.string ?? nothingHereMessage 25 | //get curosor location: 26 | let cursorLoc = SchemeComm.locationOfCursor(codingField: cf) 27 | //grab all text before cursor location: 28 | let codeBeforeCursorRange = currentText.startIndex ..< currentText.index(currentText.startIndex, offsetBy: cursorLoc) 29 | let codeBeforeCursor = String(currentText[codeBeforeCursorRange]) 30 | //find an executable command within the possible code before the cursor 31 | let executableCommand = SchemeComm.findExecutableCommandInText(incoming: codeBeforeCursor) 32 | result.append(executableCommand) 33 | //return as Data object to send to Scheme Process 34 | return result.data(using: .utf8)! 35 | } 36 | 37 | //returns Int location of the cursor, where Int is the 38 | /////number of characters in the codefield's text 39 | static func locationOfCursor(codingField cf:CodeField) -> Int { 40 | let range = cf.selectedRange() 41 | let insertSpot = range.location + range.length 42 | return insertSpot 43 | } 44 | 45 | static func findExecutableCommandInText(incoming:String) -> String { 46 | var chars = Array(incoming) 47 | chars.reverse() 48 | var parenCount = 0 //to keep track of parentheses! 49 | var indextoRevertBackTo = 0 //to keep track of where in substring should split 50 | for i in 0.. String { 80 | let tempTask = Process() 81 | tempTask.launchPath = "/bin/bash" 82 | let mitScheme = "mit-scheme" 83 | tempTask.arguments = [ "-l", "-c", "which \(mitScheme)"] 84 | let pipe = Pipe() 85 | tempTask.standardOutput = pipe 86 | print("trying") 87 | 88 | if #available(OSX 10.13, *) { 89 | do { 90 | try tempTask.run() 91 | } catch { 92 | let alert = NSAlert.init() 93 | alert.messageText = "Can't access bin/bash/" 94 | alert.informativeText = "Toksi can't find bin/bash. Toski needs /bin/bash access to locate MIT Scheme. If you need help getting this to work, please contact the develoer for support." 95 | alert.addButton(withTitle: "OK") 96 | alert.runModal() 97 | return "" 98 | 99 | } 100 | } else { 101 | //prior to 10.13, you had to use .launch, which can't error handle. 102 | //this should be removed ASAP, when 10.13 doesn't have to be supported 103 | tempTask.launch() 104 | } 105 | 106 | let data = pipe.fileHandleForReading.readDataToEndOfFile() 107 | let output:String = String(data: data, encoding: String.Encoding.utf8) ?? "can't find mit-scheme location!" 108 | let outTrimmed = output.trimmingCharacters(in: .whitespacesAndNewlines) 109 | print("MIT-Scheme Location: \(outTrimmed)\n") 110 | return outTrimmed 111 | } 112 | } 113 | 114 | //SchemeProcess is a wrapper around the Process class, acting as a singleton 115 | class SchemeProcess: Process { 116 | 117 | //Keep Init Private, as it should only be used by the shared 118 | private override init() {} 119 | 120 | //This is the shared instance 121 | static let shared = Process() 122 | } 123 | 124 | extension String { 125 | 126 | //This extends the built in String to grab lines 127 | var lines: [String] { 128 | var result: [String] = [] 129 | enumerateLines { line, _ in result.append(line) } 130 | return result 131 | } 132 | 133 | //This extends the built in String to have a method for 134 | mutating func stringByRemovingRegexMatches(pattern: String, replaceWith: String = "") { 135 | do { 136 | let regex = try NSRegularExpression(pattern: pattern, options: NSRegularExpression.Options.caseInsensitive) 137 | let range = NSMakeRange(0, self.count) 138 | self = regex.stringByReplacingMatches(in: self, options: [], range: range, withTemplate: replaceWith) 139 | } catch { 140 | return 141 | } 142 | } 143 | 144 | //Finds number of instances of particular substring 145 | func countInstances(of stringToFind: String) -> Int { 146 | var stringToSearch = self 147 | var count = 0 148 | repeat { 149 | guard let foundRange = stringToSearch.range(of: stringToFind, options: .diacriticInsensitive) 150 | else { break } 151 | stringToSearch = stringToSearch.replacingCharacters(in: foundRange, with: "") 152 | count += 1 153 | 154 | } while (true) 155 | 156 | return count 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /Toski/Toski/Schemer.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Toski/Toski/SourceCodePro-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kennethshawfriedman/Toski/b00caa6fe2dc0ad734d774507ea00f55dbb1991d/Toski/Toski/SourceCodePro-Regular.ttf -------------------------------------------------------------------------------- /Toski/Toski/Syntaxr.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Syntaxr.swift 3 | // Schemer 4 | // 5 | // Created by Kenneth Friedman on 5/7/17. 6 | // Copyright © 2017 Kenneth Friedman. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | //Static class for syntax highlighting 12 | class Syntaxr { 13 | 14 | //for a given line (as a string), return a string formatter with proper highlighting 15 | static func highlightLine(_ line:String) -> NSAttributedString { 16 | 17 | var insideAQuote = false //are you inside a quote right now? 18 | for i in line.indices { //loop through each character 19 | let char = line[i] 20 | if (char == "\"") { //if it's a quote, flip the boolean 21 | insideAQuote = !insideAQuote 22 | } else if (char == ";" && !insideAQuote) { 23 | //we found the semicolon! Rest of line doesn't matter 24 | let firstSubstring = String(line[.. NSAttributedString { 40 | let lines = text.components(separatedBy: "\n") 41 | let formattedText = NSMutableAttributedString() 42 | for i in 0.. [NSAttributedString.Key: Any]? { 57 | guard let input = input else { return nil } 58 | return Dictionary(uniqueKeysWithValues: input.map { key, value in (NSAttributedString.Key(rawValue: key), value)}) 59 | } 60 | 61 | // Helper function inserted by Swift 4.2 migrator. 62 | fileprivate func convertFromNSAttributedStringKey(_ input: NSAttributedString.Key) -> String { 63 | return input.rawValue 64 | } 65 | -------------------------------------------------------------------------------- /Toski/Toski/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // Schemer 4 | // 5 | // Created by Kenneth Friedman on 5/2/17. 6 | // Copyright © 2017 Kenneth Friedman. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class ViewController: NSViewController { 12 | 13 | //Class Variables 14 | ////UI Variables 15 | @IBOutlet var cf: CodeField! 16 | @IBOutlet var outField: NSTextView! 17 | @IBOutlet var previewField: NSTextField! 18 | 19 | ////Non-UI Variables 20 | var handleIn = FileHandle() 21 | let task = SchemeProcess.shared 22 | var backspace = false //is most recent char the backspace? 23 | var warmingUp = true //is Scheme process still "warming up"? 24 | var previewFlag = false //is the user trying to complete a preview execute 25 | 26 | override func viewDidLoad() { 27 | super.viewDidLoad() 28 | 29 | let pipeOut = Pipe() 30 | let pipeIn = Pipe() 31 | 32 | previewField.alphaValue = 0.0 //invisible from start 33 | 34 | outField.isEditable = false; 35 | outField.font = CodeField.standardFont() 36 | let tempStr = NSAttributedString(string: "", attributes: CodeField.stdAtrributes()) 37 | outField.textStorage?.setAttributedString(tempStr) 38 | 39 | //Setting Delegates 40 | cf.delegate = self 41 | cf.textStorage?.delegate = self 42 | cf.parentVC = self 43 | 44 | //task.launchPath = "/usr/local/bin/mit-scheme" //this should eventually be detirmined per-machine (which is working in one of the playgrounds) 45 | //The launchpath on my machine is "/usr/local/bin/mit-scheme", but if this is different on someone else's computer, i 46 | task.launchPath = SchemeHelper.findSchemeLaunchPath() 47 | 48 | //load up the startup.scm code 49 | let startupSCMPath = Bundle.main.path(forResource: "startup", ofType: "scm") 50 | task.arguments = ["--load", startupSCMPath!] 51 | //task set up 52 | task.standardOutput = pipeOut 53 | task.standardInput = pipeIn 54 | 55 | handleIn = pipeIn.fileHandleForWriting 56 | let outHandle = pipeOut.fileHandleForReading 57 | 58 | //The Results of a Scheme Execution come back from the REPL into this function: 59 | outHandle.readabilityHandler = self.readingPipe 60 | 61 | //notification to observe when someone pressed Cmd+Enter 62 | NotificationCenter.default.addObserver(self, selector: #selector(executeCommand), name: NSNotification.Name(rawValue: "executeCommand"), object: nil) 63 | } 64 | 65 | //The Results of a Scheme Execution come back from the REPL into this function: 66 | func readingPipe(_ pipe:FileHandle) { 67 | let inLine = String(data: pipe.availableData, encoding: .utf8) 68 | guard let line = inLine else { return } 69 | 70 | print("\(line)", terminator: "") 71 | 72 | //No need to show the user the REPL input text: the input can be anywhere! 73 | var newLine = line.replacingOccurrences(of: "1 ]=> ", with: "") 74 | newLine = newLine.replacingOccurrences(of: ";Unspecified return value", with: "") 75 | newLine.stringByRemovingRegexMatches(pattern: "\\d+ error> ") //without espcape: \d+ error> 76 | 77 | //if you shouldn't print the line, just return 78 | guard !self.warmingUp else { return } 79 | 80 | //adding text back to the view requires you to be on the main thread, but this readabilityHandler is async 81 | DispatchQueue.main.sync { 82 | self.addLineToOutField(newLine) 83 | } 84 | } 85 | 86 | func addLineToOutField(_ newLine:String) { 87 | //add the proper font to the text, and append it to the codingfield (cf) 88 | let fontAtt = [NSAttributedString.Key.font : CodeField.standardFont()] 89 | let atString = NSAttributedString.init(string: newLine, attributes: fontAtt) 90 | 91 | //KSF: the following two lines will insert the response at the cursor location 92 | //let insertSpot = SchemeComm.locationOfCursor(codingField: self.cf) 93 | //self.cf.textStorage?.insert(atString, at: insertSpot) 94 | 95 | if (self.previewFlag) { 96 | //preview execution here 97 | self.previewField.alphaValue = 1.0 98 | 99 | let newResult = NSMutableAttributedString.init(attributedString: self.previewField.attributedStringValue) 100 | newResult.append(atString) 101 | 102 | //try to prune uncessary things 103 | var processString = newResult.string 104 | 105 | //REGEX processing: 106 | let regex = "(preview-env)|(;Value .+: #\\[environment .+\\])|(;Package: \\(user\\))|(;Unspecified return value)|(\n)|(;Value: )" 107 | processString.stringByRemovingRegexMatches(pattern: regex) 108 | 109 | self.previewField.attributedStringValue = NSAttributedString(string: processString, attributes: CodeField.stdAtrributes()) 110 | 111 | } else { 112 | //Not a preview: standard execution 113 | self.outField.textStorage?.append(atString) 114 | let strLength = self.outField.string.count 115 | self.outField.scrollRangeToVisible(NSRange.init(location: strLength, length: 0)) 116 | } 117 | } 118 | 119 | //When the viewcontroller appears, launch Scheme 120 | override func viewDidAppear() { 121 | 122 | if #available(OSX 10.13, *) { 123 | do { 124 | try task.run() 125 | } catch { 126 | let alert = NSAlert.init() 127 | alert.messageText = "Can't access Scheme" 128 | alert.informativeText = "Toksi can't find MIT Scheme.\nPlease install Scheme at https://www.gnu.org/software/mit-scheme/\nContact the developer if you still can't get it working." 129 | alert.addButton(withTitle: "OK") 130 | alert.runModal() 131 | } 132 | } else { 133 | task.launch() 134 | } 135 | 136 | //textfield can be edited as soon as Scheme as been launched 137 | cf.isEditable = true 138 | } 139 | 140 | //This function is called on Cmd+Enter: it executes a call to Scheme Communication 141 | @objc func executeCommand() { 142 | print("execute") 143 | let dataToSubmit = SchemeComm.parseExecutionCommand(codingField: cf) 144 | handleIn.write(dataToSubmit) 145 | } 146 | 147 | @IBAction func ExitNow(sender: AnyObject) { 148 | NSApplication.shared.terminate(self) 149 | } 150 | 151 | override func textStorageDidProcessEditing(_ notification: Notification) { 152 | warmingUp = false 153 | } 154 | } 155 | 156 | //Extension Contains the Delegate Methods 157 | extension ViewController: NSTextViewDelegate, NSTextStorageDelegate { 158 | 159 | //this is called on every selection change, which includes typing and moving cursor 160 | func textViewDidChangeSelection(_ notification: Notification) { 161 | 162 | //NOTE FROM KSF: this is the beginning of the highlight to eval feature. 163 | //however, the necessary features aren't implemented yet, so all it does is execute and print the procedures 164 | //that you highlight. There's no checking or anything. Don't uncomment unless you want to play with just this feature 165 | 166 | previewFlag = false //always set to false, but change to true if it passes the guard statements 167 | self.previewField.alphaValue = 0.0 //always make the preview invisible. Change to visible when there is a result 168 | self.previewField.stringValue = "" //reset the text as soon as the selection changes 169 | 170 | //grabs range of selected text 171 | let sRange = cf.selectedRange() 172 | guard (sRange.length > 1) else {return} 173 | let maybeSelectedText = cf.textStorage?.string 174 | guard let selectedText = maybeSelectedText else { return } 175 | let selectedNSString = NSString(string: selectedText) 176 | let highlightedText = selectedNSString.substring(with: sRange) 177 | 178 | //trivially looks to match number of parens before attempting a preview execution 179 | let leftParenCount = highlightedText.countInstances(of: "(") 180 | let rightParenCount = highlightedText.countInstances(of: ")") 181 | guard leftParenCount == rightParenCount else { return } 182 | 183 | //ensures there is data to execute 184 | let maybeHighlightAsData = highlightedText.data(using: .utf8) 185 | guard let highlightData = maybeHighlightAsData else { return } 186 | 187 | //creates a new env with same bindings 188 | let createEnv = "(define preview-env (extend-top-level-environment (the-environment)))".data(using: .utf8) 189 | 190 | //enters the new binding 191 | let enterPreEnv = "(ge preview-env)".data(using: .utf8) 192 | 193 | //leaves the new binding (assumption: the code itself ends in the same env it began.) 194 | let exitPreEnv = "(ge (environment-parent (the-environment)))".data(using: .utf8) 195 | 196 | previewFlag = true 197 | 198 | handleIn.write(createEnv!) 199 | handleIn.write(enterPreEnv!) 200 | handleIn.write(highlightData) 201 | handleIn.write(exitPreEnv!) 202 | } 203 | 204 | func textView(_ textView: NSTextView, shouldChangeTextInRanges affectedRanges: [NSValue], replacementStrings: [String]?) -> Bool { 205 | return true 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /Toski/Toski/startup.scm: -------------------------------------------------------------------------------- 1 | #| 2 | Startup.scm 3 | May 11, 2017 4 | By Kenny Friedman, Blake Elias, and Jared Pochtar 5 | 6 | This code is run at start up. It does the following things: 7 | - creates and manages the environments for real vs. preview executions 8 | 9 | |# 10 | 11 | (display "Startup.scm has been found & is currently loading.") 12 | 13 | ;;;; Set Up 14 | 15 | ;define the new environment 16 | ;(define preview-env (extend-top-level-environment (the-environment))) 17 | 18 | ;enter the new environment 19 | ;(ge preview-env) 20 | 21 | ;return to the original 22 | ;(ge (environment-parent (the-environment))) 23 | 24 | 25 | 26 | #| 27 | 28 | (define safe-eval 29 | (let 30 | ((reporting-error-handler (lambda (error) 31 | (pp (list "error" (condition/report-string error))) 32 | (newline) 33 | (restart 1)))) 34 | 35 | (lambda (env code-to-eval-as-string) 36 | (bind-condition-handler '() reporting-error-handler 37 | (lambda () 38 | (eval 39 | (read (string->input-port 40 | (string-append 41 | "((lambda ()" 42 | code-to-eval-as-string 43 | "))"))) 44 | env)))))) 45 | 46 | 47 | 48 | ; (safe-eval (the-environment) "(define (foo n) (+ n 3))(foo 4)") 49 | ; (safe-eval (the-environment) "(define malformed") 50 | 51 | |# 52 | 53 | 54 | 55 | 56 | 57 | (display "Startup.scm has loaded.") 58 | 59 | --------------------------------------------------------------------------------