Crates.io | dwparser |
lib.rs | dwparser |
version | 0.1.3 |
source | src |
created_at | 2023-01-17 08:26:54.095333 |
updated_at | 2023-01-17 14:48:34.206734 |
description | DataWindow Syntax Parser |
homepage | |
repository | https://github.com/gaoqiangz/dwparser |
max_upload_size | |
id | 760859 |
size | 1,943,830 |
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");