Skip to content
Merged
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
3 changes: 2 additions & 1 deletion pdl-compiler/scripts/generate_cxx_backend_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ def check_members(decl: ast.Declaration, var: str, expected: object) -> List[str
checks.append(f"ASSERT_TRUE(!{get_field(decl, var, id)}.has_value());")

elif isinstance(field, ast.TypedefField) and field.cond and value is not None:
checks.append(f"{field.type_id} const& {field_var} = {get_field(decl, var, id)}.value();")
checks.append(f"auto opt_{field_var} = {get_field(decl, var, id)};")
checks.append(f"{field.type_id} const& {field_var} = opt_{field_var}.value();")
checks.extend(check_members(field.type, field_var, value))

elif isinstance(field, ast.TypedefField):
Expand Down
2 changes: 1 addition & 1 deletion pdl-compiler/src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1934,7 +1934,7 @@ mod test {
let mut db = ast::SourceDatabase::new();
let file = parse_inline(&mut db, "stdin", $text.to_owned()).expect("parsing failure");
let result = analyzer::analyze(&file);
assert!(matches!(result, Err(_)));
assert!(result.is_err());
let diagnostics = result.err().unwrap();
let mut buffer = termcolor::Buffer::no_color();
let _ = diagnostics.emit(&db, &mut buffer);
Expand Down
1 change: 1 addition & 0 deletions pdl-compiler/src/backends.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

//! Compiler backends.

pub mod cxx;
#[cfg(feature = "java")]
pub mod java;
pub mod json;
Expand Down
Loading
Loading