From 139047379b2ff7751c1b5ef8e079ffc29cce752d Mon Sep 17 00:00:00 2001 From: tslil Date: Sat, 21 Mar 2026 20:21:32 +0000 Subject: implement hooks, fix docs --- rprt-engine/src/parser.rs | 56 +++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 24 deletions(-) (limited to 'rprt-engine/src/parser.rs') diff --git a/rprt-engine/src/parser.rs b/rprt-engine/src/parser.rs index 7b68473..e6a9c0b 100644 --- a/rprt-engine/src/parser.rs +++ b/rprt-engine/src/parser.rs @@ -179,8 +179,8 @@ fn parse_function_atom(context: &mut ParseContext) -> Result { @@ -188,8 +188,8 @@ fn parse_function_atom(context: &mut ParseContext) -> Result return Ok(result), @@ -673,7 +673,11 @@ mod tests { let result = parse(tokens).unwrap(); println!("{:?}", result); match result { - Composite::Hook { kind, left, right } => { + Composite::Hook { + kind, + f: left, + g: right, + } => { assert_eq!(kind, HookKind::Before); assert!(matches!( *left, @@ -704,15 +708,15 @@ mod tests { match result { Composite::Hook { kind: outer_kind, - left: outer_left, - right: outer_right, + f: outer_left, + g: outer_right, } => { assert_eq!(outer_kind, HookKind::After); match *outer_left { Composite::Hook { kind: inner_kind, - left: inner_left, - right: inner_right, + f: inner_left, + g: inner_right, } => { assert_eq!(inner_kind, HookKind::After); assert!(matches!( @@ -753,8 +757,8 @@ mod tests { match result { Composite::Hook { kind: outer_kind, - left: outer_left, - right: outer_right, + f: outer_left, + g: outer_right, } => { assert_eq!(outer_kind, HookKind::After); assert!(matches!( @@ -767,8 +771,8 @@ mod tests { match *outer_right { Composite::Hook { kind: inner_kind, - left: inner_left, - right: inner_right, + f: inner_left, + g: inner_right, } => { assert_eq!(inner_kind, HookKind::After); assert!(matches!( @@ -802,8 +806,8 @@ mod tests { match result { Composite::Hook { kind: k1, - left: l1, - right: r1, + f: l1, + g: r1, } => { assert_eq!(k1, HookKind::Before); assert!(matches!( @@ -817,8 +821,8 @@ mod tests { match *r1 { Composite::Hook { kind: k2, - left: l2, - right: r2, + f: l2, + g: r2, } => { assert_eq!(k2, HookKind::After); assert!(matches!( @@ -831,8 +835,8 @@ mod tests { match *r2 { Composite::Hook { kind: k3, - left: l3, - right: r3, + f: l3, + g: r3, } => { assert_eq!(k3, HookKind::Before); assert!(matches!( @@ -867,7 +871,11 @@ mod tests { let result = parse(tokens).unwrap(); println!("{:?}", result); match result { - Composite::Hook { kind, left, right } => { + Composite::Hook { + kind, + f: left, + g: right, + } => { assert_eq!(kind, HookKind::Before); assert!(matches!( *left, @@ -966,8 +974,8 @@ mod tests { match &operations[0] { Composite::Hook { kind: HookKind::After, - left, - right, + f: left, + g: right, } => { match left.as_ref() { Composite::SelectionFunction { @@ -1014,8 +1022,8 @@ mod tests { match g.as_ref() { Composite::Hook { kind: HookKind::After, - left, - right, + f: left, + g: right, } => { match left.as_ref() { Composite::SelectionFunction { -- cgit v1.2.3