feat: expect boolean sugar

This commit is contained in:
rvcas
2023-07-15 20:50:02 -04:00
parent d009358266
commit 1b8e94fe32
9 changed files with 198 additions and 31 deletions

View File

@@ -83,3 +83,18 @@ pub(crate) fn args(
.unwrap_or_else(|| (vec![], false, false))
})
}
#[cfg(test)]
mod tests {
use crate::assert_pattern;
#[test]
fn constructor_basic() {
assert_pattern!("True");
}
#[test]
fn constructor_module_select() {
assert_pattern!("module.Foo");
}
}

View File

@@ -0,0 +1,14 @@
---
source: crates/aiken-lang/src/parser/pattern/constructor.rs
description: "Code:\n\nTrue"
---
Constructor {
is_record: false,
location: 0..4,
name: "True",
arguments: [],
module: None,
constructor: (),
with_spread: false,
tipo: (),
}

View File

@@ -0,0 +1,16 @@
---
source: crates/aiken-lang/src/parser/pattern/constructor.rs
description: "Code:\n\nmodule.Foo"
---
Constructor {
is_record: false,
location: 0..10,
name: "Foo",
arguments: [],
module: Some(
"module",
),
constructor: (),
with_spread: false,
tipo: (),
}