Swiftpack.co - doHernandezM/SwiftScript as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by doHernandezM.
doHernandezM/SwiftScript 0.1.1
1 part HyperCard, 1 part realBasic, and 3 parts Swift. This code currently just highlights most swift code. However, in the future this will be able to do things based on the compiled text. I'm thinking that I should be able to use blocks to get things done.
⭐️ 2
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/doHernandezM/SwiftScript.git", from: "0.1.1")

SwiftScript v0.1.1

"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

GitHub

link
Stars: 2
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Related Packages

Release Notes

2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics