Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit18ee4be

Browse files
authored
Merge pull requestserilog#98 from nblumhardt/bind-locals-in-rep-enumerable
Bind template locals appearing in repetition enumerable expressions
2 parents1460b49 +e2b6d6a commit18ee4be

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ Template Transform(Repetition rep, Stack<string> locals)
7676
locals.Pop();
7777

7878
returnnewRepetition(
79-
rep.Enumerable,
79+
ExpressionLocalNameBinder.BindLocalValueNames(rep.Enumerable,locals),
8080
rep.BindingNames,
8181
body,
8282
rep.Delimiter!=null?Transform(rep.Delimiter,locals):null,

‎test/Serilog.Expressions.Tests/Cases/template-evaluation-cases.asv‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ A{#if false}B{#else if true}C{#end} ⇶ AC
2525
{#each a in [1,2,3]}<{a}>{#delimit},{#end} ⇶ <1>,<2>,<3>
2626
{#each a in {x: 1, y: 2}}{a}{#end} ⇶ xy
2727
{#each a, b in {x: 1, y: 2}}{a}.{b}{#end} ⇶ x.1y.2
28+
{#each a, b in {x: {y: 'z'}}}{#each c, d in b}A: {a}, C: {c}, D: {d}{#end}{#end} ⇶ A: x, C: y, D: z
2829
{#if true}A{#each a in [1]}B{a}{#end}C{#end}D ⇶ AB1CD
2930
{#each a in []}{a}!{#else}none{#end} ⇶ none
3031
Culture-specific {42.34} ⇶ Culture-specific 42,34

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp