clover

Crates.ioclover
lib.rsclover
version0.1.3
sourcesrc
created_at2020-10-04 13:43:31.134818
updated_at2022-07-16 14:27:52.130389
descriptionA scripting language.
homepage
repositoryhttps://github.com/ippan/clover
max_upload_size
id296032
size168,881
Pan Ip (ippan)

documentation

README

Clover

crates.io CI Crates.io

a scripting language created in Rust

still in development~

Features

  • bytecode
  • first class function
  • error handling

Example

You can go to examples directory for more examples

Hello World

function main()
    print("hello world!")
end

Include other file

rectangle.luck

public model Rectangle
    width
    height
end

implement Rectangle
    function area(this)
        this.width * this.height
    end
end

main.luck

include Rectangle from "./rectangle.luck"

function main()
    local rect = Rectangle(20, 30)
    print(rect.area())
end

Editor support

Visual Studio Code

Use Clover VSCode Support for code highlighting in Visual Studio Code

Integrate to your project

Example

let result = create_state_by_filename("example/main.luck");

match result {
  Ok(mut state) => {
    state.execute();
  }
}

Export native function/struct to Clover

see clover-std

CLI

Install

use Cargo to install the clover-cli

cargo install clover-cli

Usage

clover examples/main.luck
Commit count: 115

cargo fmt