summaryrefslogtreecommitdiff
path: root/src/library/val.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-14 20:43:03 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-14 20:43:03 +0200
commitc8f6b5bd5c55845562571c196a0b2c1a7ca20f71 (patch)
tree0e5066064f1bf81f847cb1cfe23578e2f42fe1e8 /src/library/val.rs
parent650c712eabc6f665a0a0cc2a47fb5b90cf715d87 (diff)
Desugar body into last argument 🍩
Diffstat (limited to 'src/library/val.rs')
-rw-r--r--src/library/val.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/library/val.rs b/src/library/val.rs
index bbbeb1d1..6e83571a 100644
--- a/src/library/val.rs
+++ b/src/library/val.rs
@@ -5,21 +5,22 @@ use super::*;
/// This is also the fallback function, which is used when a function name
/// cannot be resolved.
pub fn val(call: FuncCall, _: &ParseState) -> Pass<SyntaxNode> {
+ let mut args = call.args;
let node = ValNode {
- body: call.body.map(|s| s.v),
+ content: args.pos.get::<SyntaxTree>(),
};
Pass::node(node, Feedback::new())
}
#[derive(Debug, Clone, PartialEq)]
struct ValNode {
- body: Option<SyntaxTree>,
+ content: Option<SyntaxTree>,
}
#[async_trait(?Send)]
impl Layout for ValNode {
async fn layout<'a>(&'a self, _: LayoutContext<'_>) -> Pass<Commands<'a>> {
- Pass::okay(match &self.body {
+ Pass::okay(match &self.content {
Some(tree) => vec![LayoutSyntaxTree(tree)],
None => vec![],
})