Skip to content

doHernandezM/Schwifty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftScript v1.0.0

"Lite" Version of Swift: for fun

1 part HyperCard, 1 part realBasic(rip), and 3 parts Swift.

The intent of Schwifty is to be even more light weight and easy to use than Swfit. It does this by dropping support for everything but assigning variables, arithmetic and if statements.

Download the demo app Schwifty for more

Status

• This code currently just highlights most swift code. However, in the future this will be able to do things based on the compiled text. • Going to use pre-fab blocks to support

Todo: • Highlight entered text vs error vs string

I'm thinking that I should be able to use blocks to get things done.

To get started

  1. Conform to
public protocol SchwiftScriptDelegate {
   func update()
}
  1. Set the designated delegate
SwiftScript.compiler.delegate = myDelegate
  1. Set the compilers string to string to be compiled or highlighted
SwiftScript.compiler.string = myStringToBeCompiled
  1. Once the string has been compiled, you can access the attributed strings via
let myAttributedString: NSAttributedString = SwiftScript.compiler.attributedString 
  1. Or you can access the compiled lines, errors and vars via
var errors: [SwiftScript.Error] = SwiftScript.compiler.state.errors

Requires:

  1. Swift ~4, developed under 5.2+
  2. macOS 10.15+ for Syntext Highlighting

About

*Lite* version of Swift, for fun.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages