Crates.io | vbscript |
lib.rs | vbscript |
version | |
source | src |
created_at | 2024-05-17 21:17:55.970945 |
updated_at | 2024-12-09 08:57:12.415674 |
description | Rust VBScript lexer and parser |
homepage | |
repository | https://github.com/francisdb/vbscript.rs |
max_upload_size | |
id | 1243689 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Rust VBScript lexer and parser
https://crates.io/crates/vbscript
Check the examples folder
On October 2023 Microsoft deprecated VBScript. A timeline is available at the Windows IT Pro Blog.
However, there are still many legacy systems that use VBScript. This project aims to provide a lexer, parser and maybe later interpreter for VBScript, so that it can be used in Rust projects.
https://github.com/francisdb/vbsfmt
The wine project has a similar lexer/parser/interpreter in C, but it's COM based and not very easy to use as a library: https://gitlab.winehq.org/wine/wine/-/tree/master/dlls/vbscript
MS VBScript Language Reference https://docs.microsoft.com/en-us/previous-versions/t0aew7h6(v=vs.85)
Vbsedit VBScript help: https://www.vbsedit.com/html/1c457e66-a6b2-4545-b2dd-33a59d8661e8.asp
Vbsedit Example vbs files: https://www.vbsedit.com/scripts/default.asp
vpx-js vbscript bnf grammar and transpiler https://github.com/vpdb/vpx-js/blob/master/lib/scripting/grammar/grammar.bnf
Rosetta code VBScript bnf grammar https://rosettacode.org/wiki/BNF_Grammar#VBScript , used by vbscript_in_js
wine vbscript bison grammar https://gitlab.winehq.org/wine/wine/-/blob/master/dlls/vbscript/parser.y
Make sure you populate the testsctipts
folder, feel free to add more vbs files to the folder.
./testsctipts/populate.sh
Run the tests. They will also be included in the default cargo test
run.
RUST_BACKTRACE=1 cargo test -- --nocapture try_lexing_all_vbs_files
RUST_BACKTRACE=1 cargo test -- --nocapture try_parsing_all_vbs_files
To run this benchmark, use the following command:
cargo bench
We use https://github.com/MarcoIeni/release-plz which creates a release pr on every commit to master
Thanks go to Domenic Quirl for his excellent blog post on parsing basics. This project was started from his blog post, you can find it here: https://domenicquirl.github.io/blog/parsing-basics/ https://github.com/domenicquirl/blog/tree/master/parsing-basics