summaryrefslogtreecommitdiff
path: root/src/syntax/test.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2020-08-14 20:13:50 +0200
committerLaurenz <laurmaedje@gmail.com>2020-08-14 20:13:50 +0200
commit1fb2d5103d0840f24ae588f4a05ed20a13f621d0 (patch)
treed3875bc617e253876249d2ea9a2aa0b231f661c7 /src/syntax/test.rs
parent0ac2e86feb09cabd11c93bad325ab4acead8ccbe (diff)
Always parse bodies as syntax trees 🌳
Previously they were passed as strings to the function parser, now they are parsed and then passed as trees to the function. This allows making bodies sugar for a last content argument. While it removes some flexibility allowing function to parse arbitrary syntaxes in their bodies, these can be modelled as (raw) string arguments.
Diffstat (limited to 'src/syntax/test.rs')
-rw-r--r--src/syntax/test.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/syntax/test.rs b/src/syntax/test.rs
index 7dec20e3..2ea5dde3 100644
--- a/src/syntax/test.rs
+++ b/src/syntax/test.rs
@@ -58,13 +58,12 @@ macro_rules! span_item {
};
}
-pub fn debug_func(call: FuncCall, state: &ParseState) -> Pass<SyntaxNode> {
- let mut f = Feedback::new();
+pub fn debug_func(call: FuncCall, _: &ParseState) -> Pass<SyntaxNode> {
let node = DebugNode {
header: call.header,
- body: parse_body_maybe(call.body, state, &mut f),
+ body: call.body.map(|s| s.v),
};
- Pass::node(node, f)
+ Pass::node(node, Feedback::new())
}
#[derive(Debug, Clone, PartialEq)]