Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
zslayton committed Oct 6, 2023
1 parent 0de6c1c commit 2147a6e
Show file tree
Hide file tree
Showing 13 changed files with 965 additions and 446 deletions.
17 changes: 9 additions & 8 deletions src/lazy/any_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ impl<'data> MacroInvocation<'data, AnyEncoding> for LazyRawAnyMacroInvocation<'d
type ArgumentExpr = LazyRawValueExpr<'data, AnyEncoding>;
type ArgumentsIterator = LazyRawAnyMacroArgsIterator<'data>;

type TransientEvaluator<'context> =
TransientEExpEvaluator<'context, 'data, AnyEncoding> where Self: 'context, 'data: 'context;

fn id(&self) -> MacroIdRef<'_> {
match self.encoding {
LazyRawAnyMacroInvocationKind::Text_1_0(_) => unreachable!("macro in text Ion 1.0"),
Expand All @@ -97,16 +100,14 @@ impl<'data> MacroInvocation<'data, AnyEncoding> for LazyRawAnyMacroInvocation<'d
}
}

type TransientEvaluator<'top> = TransientEExpEvaluator<'top, 'data, AnyEncoding> where 'data: 'top, Self: 'top;

fn make_transient_evaluator<'top>(
context: EncodingContext<'top>,
) -> Self::TransientEvaluator<'top>
fn make_transient_evaluator<'context>(
context: EncodingContext<'context>,
) -> Self::TransientEvaluator<'context>
where
Self: 'top,
'data: 'top,
'data: 'context,
Self: 'context,
{
TransientEExpEvaluator::new(context)
Self::TransientEvaluator::new(context)
}
}

Expand Down
16 changes: 8 additions & 8 deletions src/lazy/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ impl<'data> MacroInvocation<'data, TextEncoding_1_1> for RawTextMacroInvocation<
type ArgumentExpr = LazyRawValueExpr<'data, TextEncoding_1_1>;
type ArgumentsIterator = RawTextSExpIterator_1_1<'data>;

type TransientEvaluator<'context> =
TransientEExpEvaluator<'context, 'data, TextEncoding_1_1> where Self: 'context, 'data: 'context;

fn id(&self) -> MacroIdRef {
self.id
}
Expand All @@ -191,16 +194,13 @@ impl<'data> MacroInvocation<'data, TextEncoding_1_1> for RawTextMacroInvocation<
RawTextSExpIterator_1_1::new(self.arguments_bytes())
}

type TransientEvaluator<'top> = TransientEExpEvaluator<'top, 'data, TextEncoding_1_1> where 'data: 'top, Self: 'top;

fn make_transient_evaluator<'top>(
context: EncodingContext<'top>,
) -> Self::TransientEvaluator<'top>
fn make_transient_evaluator<'context>(
context: EncodingContext<'context>,
) -> Self::TransientEvaluator<'context>
where
Self: 'top,
'data: 'top,
Self: 'context,
{
TransientEExpEvaluator::new(context)
Self::TransientEvaluator::new(context)
}
}

Expand Down
169 changes: 84 additions & 85 deletions src/lazy/expanded/compiler.rs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/lazy/expanded/e_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ impl<'data, D: LazyDecoder<'data>> ToArgumentKind<'data, D, D::MacroInvocation>
context: EncodingContext<'top>,
) -> ArgumentKind<'top, 'data, D, D::MacroInvocation>
where
D::MacroInvocation: 'top,
Self: 'top,
{
match self {
Expand Down
Loading

0 comments on commit 2147a6e

Please sign in to comment.