Skip to content

Commit 323feee

Browse files
committed
review feedback
Signed-off-by: Shaobo He <[email protected]>
1 parent 07ed080 commit 323feee

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

cedar-policy-core/src/parser/cst_to_ast.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,6 @@ impl Node<Option<cst::Add>> {
10481048
} = initial.try_as_inner()?
10491049
{
10501050
let cst::Member { item, access } = item_node.try_as_inner()?;
1051-
//let item = item.to_expr_or_special()?;
10521051
// Among successful conversion from `Primary` to `ExprOrSpecial`,
10531052
// an `Ident` or `Str` becomes `ExprOrSpecial::StrLit`,
10541053
// `ExprOrSpecial::Var`, and `ExprOrSpecial::Name`. Other

cedar-policy-formatter/tests/extended_has.cedar

+13
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,17 @@ permit(
1414
zip &&
1515
// we are safe to access all attributes
1616
principal.contactInfo.address.zip == "90210"
17+
};
18+
19+
// Same example without comments
20+
permit(
21+
principal is User,
22+
action == Action::"preview",
23+
resource == Movie::"Blockbuster"
24+
) when {
25+
principal has
26+
contactInfooooooooooooooooooooooooooooooooooooooooooooooo.
27+
addressssssssssssssssssssss.
28+
zipppppppppppp &&
29+
principal.contactInfo.address.zip == "90210"
1730
};

cedar-policy-formatter/tests/snapshots/cedar_policy_formatter__pprint__fmt__tests__format_files@extended_has.cedar.snap

+15
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,18 @@ when
2626
.address
2727
.zip == "90210"
2828
};
29+
30+
// Same example without comments
31+
permit (
32+
principal is User,
33+
action == Action::"preview",
34+
resource == Movie::"Blockbuster"
35+
)
36+
when
37+
{
38+
principal
39+
has
40+
contactInfooooooooooooooooooooooooooooooooooooooooooooooo.addressssssssssssssssssssss
41+
.zipppppppppppp &&
42+
principal.contactInfo.address.zip == "90210"
43+
};

0 commit comments

Comments
 (0)