Skip to content

Commit

Permalink
- releasing version 0.2.6
Browse files Browse the repository at this point in the history
- change new db, drop db, permit query
  • Loading branch information
julfikar committed Jun 11, 2023
1 parent b76d768 commit 2dd1dfb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "flql"
version = "0.2.5"
version = "0.2.6"
edition = "2021"
authors = ["Mohammad Julfikar <julfikar@eztech.com.my>", "Mohammad Julfikar <md.julfikar.mahmud@gmail.com>"]
categories = ["parser-implementations"]
Expand Down
6 changes: 3 additions & 3 deletions flql.pest
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ expr = {
delete_clip
}

new_db = { "db"~"."~"new"~"("~db~")"~"."~"permit"~"("~object~")" }
perm_db = { "db"~"("~db~")"~"."~"permit"~"("~object~")" }
drop_db = { "db"~"("~db~")"~"."~"drop"~"("~")" }
new_db = { "db"~"."~"new"~"("~object~")" }
perm_db = { "db"~"."~"permit"~"("~object~")" }
drop_db = { "db"~"."~"drop"~"("~db~")" }
drop_user = { "db"~"("~db~")"~"."~"user"~"("~quots~")"~"."~"drop"~"("~")" }

new = { "new" ~ "(" ~ object ~ ")" }
Expand Down
24 changes: 8 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ use crate::exp_parser::BoxedExpression;
/// if chk.is_ok() {
/// let parsed = chk.unwrap();
/// match parsed {
/// Flql::DbNew(_,_) => {}
/// Flql::DbPerm(_,_) => {}
/// Flql::DbNew(_) => {}
/// Flql::DbPerm(_) => {}
/// Flql::DbDrop(_) => {}
/// Flql::New(_) => {}
/// Flql::Drop(_) => {}
Expand Down Expand Up @@ -451,8 +451,8 @@ struct FlqlParser;

#[derive(PartialEq, Debug, Clone)]
pub enum Flql {
DbNew(String,String),
DbPerm(String,String),
DbNew(String),
DbPerm(String),
DbDrop(String),
New(String),
Drop(String),
Expand Down Expand Up @@ -483,18 +483,10 @@ fn pair_parser(pair: Pair<Rule>) -> Flql {
match pair.as_rule() {
Rule::expr => pair_parser(pair.into_inner().next().unwrap()),
Rule::new_db => {
let two = two(pair);
Flql::DbNew(
two[0].to_string(),
two[1].to_string()
)
Flql::DbNew(one(pair).to_string())
},
Rule::perm_db => {
let two = two(pair);
Flql::DbPerm(
two[0].to_string(),
two[1].to_string()
)
Flql::DbPerm(one(pair).to_string())
}
Rule::drop_db => {
Flql::DbDrop(one(pair).to_string())
Expand Down Expand Up @@ -766,8 +758,8 @@ mod tests {
if chk.is_ok() {
let parsed = chk.unwrap();
match parsed {
Flql::DbNew(_,_) => {}
Flql::DbPerm(_,_) => {}
Flql::DbNew(_) => {}
Flql::DbPerm(_) => {}
Flql::DbDrop(_) => {}
Flql::New(_) => {}
Flql::Drop(_) => {}
Expand Down

0 comments on commit 2dd1dfb

Please sign in to comment.