feat: DSL semantic checking analysis #132
check.yml
on: pull_request
stable / fmt
3s
ubuntu / stable / features
43s
Matrix: clippy
Matrix: msrv
Annotations
1 error and 18 warnings
stable / fmt
Process completed with exit code 1.
|
[clippy] optd-dsl/src/gen/operator.rs#L4:
optd-dsl/src/gen/operator.rs#L4
warning: unused import: `syn::parse_quote`
--> optd-dsl/src/gen/operator.rs:4:5
|
4 | use syn::parse_quote;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
[clippy] optd-dsl/src/analyzer/semantic.rs#L13:
optd-dsl/src/analyzer/semantic.rs#L13
warning: fields `logical_properties`, `operators`, and `identifiers` are never read
--> optd-dsl/src/analyzer/semantic.rs:14:5
|
13 | pub struct SemanticAnalyzer {
| ---------------- fields in this struct
14 | logical_properties: HashSet<String>,
| ^^^^^^^^^^^^^^^^^^
15 | operators: HashSet<String>,
| ^^^^^^^^^
16 | identifiers: Vec<HashSet<String>>,
| ^^^^^^^^^^^
|
= note: `SemanticAnalyzer` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
[clippy] optd-dsl/src/analyzer/semantic.rs#L26:
optd-dsl/src/analyzer/semantic.rs#L26
warning: multiple associated items are never used
--> optd-dsl/src/analyzer/semantic.rs:38:8
|
26 | impl SemanticAnalyzer {
| --------------------- associated items in this implementation
...
38 | fn enter_scope(&mut self) {
| ^^^^^^^^^^^
...
44 | fn exit_scope(&mut self) {
| ^^^^^^^^^^
...
57 | fn add_identifier(&mut self, name: String) -> Result<(), String> {
| ^^^^^^^^^^^^^^
...
76 | fn lookup_identifier(&self, name: &str) -> bool {
| ^^^^^^^^^^^^^^^^^
...
92 | fn is_valid_scalar_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^
...
111 | fn is_valid_logical_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^
...
130 | fn is_valid_property_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^
...
148 | fn validate_properties(&mut self, properties: &Properties) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^^^
...
174 | fn validate_operator(&mut self, operator: &Operator) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^
...
239 | fn validate_function(&mut self, function: &Function) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^
...
269 | fn validate_expr(&mut self, expr: &Expr) -> Result<(), String> {
| ^^^^^^^^^^^^^
...
342 | fn validate_pattern(&mut self, pattern: &Pattern) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^
...
370 | pub fn validate_file(&mut self, file: &File) -> Result<(), String> {
| ^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L7:
optd-dsl/src/gen/operator.rs#L7
warning: function `type_to_tokens` is never used
--> optd-dsl/src/gen/operator.rs:7:4
|
7 | fn type_to_tokens(ty: &Type, is_param: bool) -> TokenStream {
| ^^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L30:
optd-dsl/src/gen/operator.rs#L30
warning: struct `FieldInfo` is never constructed
--> optd-dsl/src/gen/operator.rs:30:8
|
30 | struct FieldInfo {
| ^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L35:
optd-dsl/src/gen/operator.rs#L35
warning: associated items `new`, `struct_field`, `ctor_param`, and `ctor_init` are never used
--> optd-dsl/src/gen/operator.rs:36:8
|
35 | impl FieldInfo {
| -------------- associated items in this implementation
36 | fn new(field: &Field) -> Self {
| ^^^
...
43 | fn struct_field(&self) -> TokenStream {
| ^^^^^^^^^^^^
...
51 | fn ctor_param(&self) -> TokenStream {
| ^^^^^^^^^^
...
57 | fn ctor_init(&self) -> TokenStream {
| ^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L66:
optd-dsl/src/gen/operator.rs#L66
warning: function `generate_code` is never used
--> optd-dsl/src/gen/operator.rs:66:4
|
66 | fn generate_code(operators: &[Operator]) -> proc_macro2::TokenStream {
| ^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L80:
optd-dsl/src/gen/operator.rs#L80
warning: function `generate_logical_operator` is never used
--> optd-dsl/src/gen/operator.rs:80:4
|
80 | fn generate_logical_operator(operator: &LogicalOp) -> TokenStream {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L115:
optd-dsl/src/gen/operator.rs#L115
warning: function `generate_scalar_operator` is never used
--> optd-dsl/src/gen/operator.rs:115:4
|
115 | fn generate_scalar_operator(_operator: &ScalarOp) -> proc_macro2::TokenStream {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L4:
optd-dsl/src/gen/operator.rs#L4
warning: unused import: `syn::parse_quote`
--> optd-dsl/src/gen/operator.rs:4:5
|
4 | use syn::parse_quote;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
|
[clippy] optd-dsl/src/analyzer/semantic.rs#L13:
optd-dsl/src/analyzer/semantic.rs#L13
warning: fields `logical_properties`, `operators`, and `identifiers` are never read
--> optd-dsl/src/analyzer/semantic.rs:14:5
|
13 | pub struct SemanticAnalyzer {
| ---------------- fields in this struct
14 | logical_properties: HashSet<String>,
| ^^^^^^^^^^^^^^^^^^
15 | operators: HashSet<String>,
| ^^^^^^^^^
16 | identifiers: Vec<HashSet<String>>,
| ^^^^^^^^^^^
|
= note: `SemanticAnalyzer` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
= note: `#[warn(dead_code)]` on by default
|
[clippy] optd-dsl/src/analyzer/semantic.rs#L26:
optd-dsl/src/analyzer/semantic.rs#L26
warning: multiple associated items are never used
--> optd-dsl/src/analyzer/semantic.rs:38:8
|
26 | impl SemanticAnalyzer {
| --------------------- associated items in this implementation
...
38 | fn enter_scope(&mut self) {
| ^^^^^^^^^^^
...
44 | fn exit_scope(&mut self) {
| ^^^^^^^^^^
...
57 | fn add_identifier(&mut self, name: String) -> Result<(), String> {
| ^^^^^^^^^^^^^^
...
76 | fn lookup_identifier(&self, name: &str) -> bool {
| ^^^^^^^^^^^^^^^^^
...
92 | fn is_valid_scalar_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^
...
111 | fn is_valid_logical_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^
...
130 | fn is_valid_property_type(ty: &Type) -> bool {
| ^^^^^^^^^^^^^^^^^^^^^^
...
148 | fn validate_properties(&mut self, properties: &Properties) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^^^
...
174 | fn validate_operator(&mut self, operator: &Operator) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^
...
239 | fn validate_function(&mut self, function: &Function) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^^
...
269 | fn validate_expr(&mut self, expr: &Expr) -> Result<(), String> {
| ^^^^^^^^^^^^^
...
342 | fn validate_pattern(&mut self, pattern: &Pattern) -> Result<(), String> {
| ^^^^^^^^^^^^^^^^
...
370 | pub fn validate_file(&mut self, file: &File) -> Result<(), String> {
| ^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L7:
optd-dsl/src/gen/operator.rs#L7
warning: function `type_to_tokens` is never used
--> optd-dsl/src/gen/operator.rs:7:4
|
7 | fn type_to_tokens(ty: &Type, is_param: bool) -> TokenStream {
| ^^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L30:
optd-dsl/src/gen/operator.rs#L30
warning: struct `FieldInfo` is never constructed
--> optd-dsl/src/gen/operator.rs:30:8
|
30 | struct FieldInfo {
| ^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L35:
optd-dsl/src/gen/operator.rs#L35
warning: associated items `new`, `struct_field`, `ctor_param`, and `ctor_init` are never used
--> optd-dsl/src/gen/operator.rs:36:8
|
35 | impl FieldInfo {
| -------------- associated items in this implementation
36 | fn new(field: &Field) -> Self {
| ^^^
...
43 | fn struct_field(&self) -> TokenStream {
| ^^^^^^^^^^^^
...
51 | fn ctor_param(&self) -> TokenStream {
| ^^^^^^^^^^
...
57 | fn ctor_init(&self) -> TokenStream {
| ^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L66:
optd-dsl/src/gen/operator.rs#L66
warning: function `generate_code` is never used
--> optd-dsl/src/gen/operator.rs:66:4
|
66 | fn generate_code(operators: &[Operator]) -> proc_macro2::TokenStream {
| ^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L80:
optd-dsl/src/gen/operator.rs#L80
warning: function `generate_logical_operator` is never used
--> optd-dsl/src/gen/operator.rs:80:4
|
80 | fn generate_logical_operator(operator: &LogicalOp) -> TokenStream {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
[clippy] optd-dsl/src/gen/operator.rs#L115:
optd-dsl/src/gen/operator.rs#L115
warning: function `generate_scalar_operator` is never used
--> optd-dsl/src/gen/operator.rs:115:4
|
115 | fn generate_scalar_operator(_operator: &ScalarOp) -> proc_macro2::TokenStream {
| ^^^^^^^^^^^^^^^^^^^^^^^^
|