feat: expect boolean sugar
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: (),
|
||||
}
|
||||
@@ -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: (),
|
||||
}
|
||||
Reference in New Issue
Block a user