Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: DSL operator codegen #25

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["optd-core"]
members = [ "optd-core", "optd-dsl"]
resolver = "2"
4 changes: 1 addition & 3 deletions optd-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,4 @@ tokio = { version = "1.43.0", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1", features = ["raw_value"] }
dotenvy = "0.15"
async-recursion = "1.1.1"
pest = "2.7.15"
pest_derive = "2.7.15"
async-recursion = "1.1.1"
1 change: 0 additions & 1 deletion optd-core/src/dsl/ast/lower_layer.rs

This file was deleted.

2 changes: 0 additions & 2 deletions optd-core/src/dsl/ast/mod.rs

This file was deleted.

151 changes: 0 additions & 151 deletions optd-core/src/dsl/ast/upper_layer.rs

This file was deleted.

3 changes: 0 additions & 3 deletions optd-core/src/dsl/mod.rs

This file was deleted.

1 change: 0 additions & 1 deletion optd-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#[allow(dead_code)]
pub mod cascades;
pub mod dsl;
pub mod engine;
pub mod operators;
pub mod plans;
Expand Down
15 changes: 15 additions & 0 deletions optd-dsl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "optd-dsl"
version = "0.1.0"
edition = "2021"

[lib]
proc-macro = true

[dependencies]
pest = "2.7.15"
pest_derive = "2.7.15"
syn = { version = "2.0", features = ["full", "extra-traits"] }
quote = "1.0"
proc-macro2 = "1.0.93"
prettyplease = "0.2"
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use std::collections::HashSet;

use crate::dsl::ast::upper_layer::{
Expr, File, Function, Operator, OperatorKind, Pattern, Properties, Type,
};
use crate::ast::{Expr, File, Function, Operator, OperatorKind, Pattern, Properties, Type};

/// SemanticAnalyzer performs static analysis on the DSL code to ensure semantic correctness.
/// It validates properties, operators, functions, and expressions while maintaining scope information.
Expand Down Expand Up @@ -387,8 +385,8 @@ impl SemanticAnalyzer {
#[cfg(test)]
mod tests {
use super::*;
use crate::dsl::{
ast::upper_layer::{
use crate::{
ast::{
Expr, Field, File, Function, Literal, LogicalOp, Operator, Properties, ScalarOp, Type,
},
parser::parse_file,
Expand Down Expand Up @@ -443,7 +441,7 @@ mod tests {
}

#[test]
fn parse_working_file() {
fn test_working_file() {
let input = include_str!("../programs/working.optd");
let out = parse_file(input).unwrap();
let mut analyzer = SemanticAnalyzer::new();
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions optd-dsl/src/gen/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod operator;
Loading