Skip to content

Commit

Permalink
fix: Parsing example
Browse files Browse the repository at this point in the history
  • Loading branch information
can-keklik committed Jul 16, 2024
1 parent 5649993 commit 55b2551
Show file tree
Hide file tree
Showing 7 changed files with 3,498 additions and 6 deletions.
2 changes: 2 additions & 0 deletions lykiadb-lang/src/parser/program.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use serde::{Deserialize, Serialize};
use serde_json::Value;

use crate::{
Locals,
ast::{expr::Expr, stmt::Stmt},
};
#[derive(Serialize, Deserialize)]
pub struct Program {
root: Box<Stmt>,
locals: Option<Locals>,
Expand Down
4 changes: 3 additions & 1 deletion lykiadb-playground/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ crate-type = ["cdylib"]

[dependencies]
lykiadb-lang = { path = "../lykiadb-lang" }
wasm-bindgen="0.2.92"
wasm-bindgen="0.2.92"
serde = { version = "1.0.188", features=["derive", "rc"] }
serde-wasm-bindgen = "0.6.5"
5 changes: 5 additions & 0 deletions lykiadb-playground/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import * as wasm from "./pkg/lykiadb_playground";
console.time("parse");
for (let i = 0; i < 100000; i++) {
wasm.parse("SELECT * FROM foo;");
}
console.timeEnd("parse");

console.log(wasm.parse("SELECT * FROM foo;"));
3 changes: 1 addition & 2 deletions lykiadb-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
],
"license": "(MIT OR Apache-2.0)",
"devDependencies": {
"lykiadb-playground-pack": "^0.1.0",
"webpack": "^4.29.3",
"webpack": " ^5.4.3",
"webpack-cli": "^3.1.0",
"webpack-dev-server": "^3.1.5",
"copy-webpack-plugin": "^5.0.0"
Expand Down
Loading

0 comments on commit 55b2551

Please sign in to comment.