Skip to content

Commit 9b76125

Browse files
Fix identifier parsing of human-readable schemas (#914)
Signed-off-by: Shaobo He <[email protected]>
1 parent ad61b3f commit 9b76125

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cedar-policy-validator/src/human_schema/grammar.lalrpop

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ Ident: Node<Id> = {
226226
=> Node::with_source_loc("Long".parse().unwrap(), Loc::new(l..r, Arc::clone(src))),
227227
<l:@L> STRING <r:@R>
228228
=> Node::with_source_loc("String".parse().unwrap(), Loc::new(l..r, Arc::clone(src))),
229+
<l:@L> TYPE <r:@R>
230+
=> Node::with_source_loc("type".parse().unwrap(), Loc::new(l..r, Arc::clone(src))),
231+
<l:@L> IN <r:@R>
232+
=>? Err(ParseError::User {
233+
error: Node::with_source_loc(UserError::ReservedIdentifierUsed("in".into()), Loc::new(l..r, Arc::clone(src)))
234+
}),
229235
<l:@L> <i:IDENTIFIER> <r:@R>
230236
=>? Id::from_str(i)
231237
.map(|id : Id| Node::with_source_loc(id, Loc::new(l..r, Arc::clone(src))))

0 commit comments

Comments
 (0)