Crates.io | dwparser |
lib.rs | dwparser |
version | |
source | src |
created_at | 2023-01-17 08:26:54.095333+00 |
updated_at | 2025-02-17 12:43:04.653964+00 |
description | DataWindow Syntax Parser |
homepage | |
repository | https://github.com/gaoqiangz/dwparser |
max_upload_size | |
id | 760859 |
Cargo.toml error: | TOML parse error at line 26, column 1 | 26 | 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 |
DataWindow Syntax Parser written in Rust
DataWindow
语法生成语法树AST
,修改AST
并重新生成DataWindow
语法字符串DataWindow::Modify/Describe
函数的语法,并且可以修改任何语法项Flag | Description | Default |
---|---|---|
preserve_order |
保留原始语法项的顺序 | enabled |
case_insensitive |
忽略大小写 | false |
query |
支持modify 和describe 操作 |
false |
serde_support |
支持serde 序列化接口 |
false |
full |
开启所有特性 | false |
cargo add
> cargo add dwparser
Cargo.toml
[dependencies]
dwparser = "0.1.0"
processing
let mut dwsyn = dwparser::parse("{DataWindow Syntax}").unwrap();
dwsyn.modify("DataWindow.Processing = 2");
let mut dwsyn = dwparser::parse("{DataWindow Syntax}").unwrap();
//通过字段名
dwsyn.modify("DataWindow.Table.Column.ColA.ColType = char(255)");
//通过ID
dwsyn.modify("DataWindow.Table.Column.1.ColType = char(255)");
let mut dwsyn = dwparser::parse("{DataWindow Syntax}").unwrap();
//通过字段名
dwsyn.modify("Destroy DataWindow.Table.Column.ColA");
//通过ID
dwsyn.modify("Destroy DataWindow.Table.Column.1");
let mut dwsyn = dwparser::parse("{DataWindow Syntax}").unwrap();
dwsyn.modify("Destroy DataWindow.Footer.1");