1
Fork 0

Add Span to ast::WhereClause

This commit is contained in:
topecongiro 2017-07-27 13:37:35 +09:00
parent 4a42ff4823
commit 6375b77ebb
6 changed files with 13 additions and 2 deletions

View file

@ -4373,6 +4373,7 @@ impl<'a> Parser<'a> {
where_clause: WhereClause {
id: ast::DUMMY_NODE_ID,
predicates: Vec::new(),
span: syntax_pos::DUMMY_SP,
},
span: span_lo.to(self.prev_span),
})
@ -4440,11 +4441,13 @@ impl<'a> Parser<'a> {
let mut where_clause = WhereClause {
id: ast::DUMMY_NODE_ID,
predicates: Vec::new(),
span: syntax_pos::DUMMY_SP,
};
if !self.eat_keyword(keywords::Where) {
return Ok(where_clause);
}
let lo = self.prev_span;
// This is a temporary future proofing.
//
@ -4522,6 +4525,7 @@ impl<'a> Parser<'a> {
}
}
where_clause.span = lo.to(self.prev_span);
Ok(where_clause)
}