Git Product home page Git Product logo

inline-vbs's Introduction

inline-vbs

inline-vbs is a crate that allows you to embed VBScript, JScript and many other languages inside Rust code files. It uses the Active Scripting COM APIs to dynamically parse and execute (optionally, evaluate) code.

image

Basic usage

use inline_vbs::*;

fn main() {
    vbs! { On Error Resume Next } // tired of handling errors?
    vbs! { MsgBox "Hello, world!" }
    let language = "VBScript";
    assert_eq!(vbs_!['language & " Rocks!"], "VBScript Rocks!".into());
}

Macros:

  • vbs! - Executes a statement or evaluates an expression (depending on context)
  • vbs_! - Evaluates an expression
  • vbs_raw! - Executes a statement (string input instead of tokens, use for multiline code) See more examples in tests/tests.rs.

Installation

Add this to your Cargo.toml:

[dependencies]
inline-vbs = "0.4.0"

Important: You need to have the MSVC Build Tools installed on your computer, as required by cc.

Language support

VBScript (vbs!) and JScript (js!) are available out of the box on 32-bit and 64-bit.

Other Active Scripting engines exist:

Note: install an engine matching the bitness of your program; by default Rust on Windows builds 64-bit programs, which can only use 64-bit libraries. If you want to use a 32-bit library, you need to build your program with --target i686-pc-windows-msvc.

Limitations

Many.

Motivation

N/A

License

This project is licensed under either of

inline-vbs's People

Contributors

zdimension avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.