Skip to content

Commit

Permalink
Hide spans from ast debug output to fix insta tests on windows part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Nak committed Oct 11, 2024
1 parent b3b56e5 commit 8ca415a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 175 deletions.
9 changes: 6 additions & 3 deletions crates/parser/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,10 @@ impl FromSyntax<Error> for FuncSignature {
}

/// Doesn't include `%` prefix.
#[derive(Debug)]
#[derive(Dbg)]
pub struct FunctionName {
pub name: SmolStr,
#[debug(skip)]
pub span: Span,
}

Expand Down Expand Up @@ -265,9 +266,10 @@ impl FromSyntax<Error> for BlockId {
}
}

#[derive(Debug)]
#[derive(Dbg)]
pub struct Stmt {
pub kind: StmtKind,
#[debug(skip)]
pub span: Span,
}

Expand Down Expand Up @@ -296,10 +298,11 @@ pub enum StmtKind {
Inst(Inst),
}

#[derive(Debug)]
#[derive(Dbg)]
pub struct Inst {
pub name: InstName,
pub args: Vec<InstArg>,
#[debug(skip)]
pub span: Span,
}

Expand Down
25 changes: 5 additions & 20 deletions crates/parser/test_files/syntax/module/newlines.ast.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ Module {
linkage: Public,
name: FunctionName {
name: "main",
span: Span(
43,
48,
),
..
},
params: [],
ret_type: None,
Expand Down Expand Up @@ -85,16 +82,10 @@ Module {
..
},
],
span: Span(
81,
94,
),
..
},
),
span: Span(
73,
94,
),
..
},
Stmt {
kind: Inst(
Expand All @@ -104,16 +95,10 @@ Module {
..
},
args: [],
span: Span(
104,
110,
),
..
},
),
span: Span(
104,
110,
),
..
},
],
},
Expand Down
Loading

0 comments on commit 8ca415a

Please sign in to comment.