Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
hchataing committed Apr 23, 2024
1 parent b24b0db commit 85b74ee
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
11 changes: 0 additions & 11 deletions pdl-compiler/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@ pub enum Tag {
Other(TagOther),
}

/// Represent literal values declared in the source ast.
/// Literals can occur in constraints or fixed fields.
/// This type carry the type information even if implicit
/// in the source ast, in order to simplify code generation.
#[derive(Debug, Serialize, Clone, PartialEq, Eq)]
#[serde(untagged)]
pub enum Literal {
Integer { value: usize, width: usize },
Enum { type_id: String, tag_id: String },
}

#[derive(Debug, Serialize, Clone)]
#[serde(tag = "kind", rename = "constraint")]
pub struct Constraint {
Expand Down
12 changes: 0 additions & 12 deletions pdl-compiler/src/backends/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,20 +1018,8 @@ mod tests {
use crate::ast;
use crate::parser::parse_inline;
use crate::test_utils::{assert_snapshot_eq, format_rust};
use googletest::prelude::{elements_are, eq, expect_that};
use paste::paste;

/// Parse a string fragment as a PDL file.
///
/// # Panics
///
/// Panics on parse errors.
pub fn parse_str(text: &str) -> ast::File {
let mut db = ast::SourceDatabase::new();
let file = parse_inline(&mut db, "stdin", String::from(text)).expect("parse error");
analyzer::analyze(&file).expect("analyzer error")
}

/// Create a unit test for the given PDL `code`.
///
/// The unit test will compare the generated Rust code for all
Expand Down

0 comments on commit 85b74ee

Please sign in to comment.