• Home
  • Raw
  • Download

Lines Matching refs:decl

217         for decl in &file.declarations {  in new()
218 if let Some(id) = decl.id() { in new()
219 if let Some(prev) = scope.typedef.insert(id.to_string(), decl) { in new()
225 decl.kind(), in new()
229 decl.loc.primary(), in new()
249 pub fn get_parent(&self, decl: &crate::ast::Decl<A>) -> Option<&'d crate::ast::Decl<A>> { in get_parent()
250 decl.parent_id().and_then(|parent_id| self.typedef.get(parent_id).cloned()) in get_parent()
256 decl: &'d crate::ast::Decl<A>, in iter_parents()
258 std::iter::successors(self.get_parent(decl), |decl| self.get_parent(decl)) in iter_parents()
264 decl: &'d crate::ast::Decl<A>, in iter_fields()
266 std::iter::successors(Some(decl), |decl| self.get_parent(decl)).flat_map(Decl::fields) in iter_fields()
334 decl: &'d parser_ast::Decl, in check_decl_identifiers()
339 let decl_id = decl.id().unwrap(); in check_decl_identifiers()
348 decl.kind(), in check_decl_identifiers()
351 .with_labels(vec![decl.loc.primary()]), in check_decl_identifiers()
362 for field in decl.fields() { in check_decl_identifiers()
426 if let Some(parent_id) = decl.parent_id() { in check_decl_identifiers()
428 match (&decl.desc, parent_decl) { in check_decl_identifiers()
434 .with_labels(vec![decl.loc.primary()]) in check_decl_identifiers()
435 .with_notes(vec![format!("hint: expected {} identifier", decl.kind())]), in check_decl_identifiers()
449 .with_labels(vec![decl.loc.primary()]) in check_decl_identifiers()
450 .with_notes(vec![format!("hint: expected {} identifier", decl.kind())]), in check_decl_identifiers()
463 for decl in &file.declarations { in check_decl_identifiers()
464 match &decl.desc { in check_decl_identifiers()
467 bfs(decl, &mut context, scope, &mut diagnostics) in check_decl_identifiers()
474 .with_labels(vec![decl.loc.primary()]) in check_decl_identifiers()
482 .with_labels(vec![decl.loc.primary()]) in check_decl_identifiers()
497 for decl in &file.declarations { in check_field_identifiers()
499 for field in decl.fields() { in check_field_identifiers()
653 for decl in &file.declarations { in check_enum_declarations()
654 if let DeclDesc::Enum { tags, width, .. } = &decl.desc { in check_enum_declarations()
739 decl: &parser_ast::Decl, in check_constraints()
743 match scope.iter_fields(decl).find(|field| field.id() == Some(&constraint.id)) { in check_constraints()
850 Some(decl) => diagnostics.push( in check_constraints()
862 decl.kind() in check_constraints()
903 for decl in &file.declarations { in check_constraints()
905 match &decl.desc { in check_constraints()
915 scope.iter_parents(decl).fold(HashMap::new(), |acc, decl| { in check_constraints()
916 decl.constraints().fold(acc, |mut acc, constraint| { in check_constraints()
928 for field in decl.fields() { in check_constraints()
952 for decl in &file.declarations { in check_size_fields()
955 for field in decl.fields() { in check_size_fields()
988 match decl.fields().find(|field| match &field.desc { in check_size_fields()
1038 match decl.fields().find(|field| field.id() == Some(field_id)) { in check_size_fields()
1083 for decl in &file.declarations { in check_fixed_fields()
1084 for field in decl.fields() { in check_fixed_fields()
1118 Some(decl) => diagnostics.push( in check_fixed_fields()
1124 decl.loc in check_fixed_fields()
1149 fn requires_payload(file: &parser_ast::File, decl: &parser_ast::Decl) -> bool { in check_payload_fields()
1150 file.iter_children(decl).any(|child| child.fields().next().is_some()) in check_payload_fields()
1154 for decl in &file.declarations { in check_payload_fields()
1156 for field in decl.fields() { in check_payload_fields()
1180 if payload.is_none() && requires_payload(file, decl) { in check_payload_fields()
1185 .with_labels(vec![decl.loc.primary()]) in check_payload_fields()
1188 decl.id().unwrap() in check_payload_fields()
1202 for decl in &file.declarations { in check_array_fields()
1203 for field in decl.fields() { in check_array_fields()
1205 if let Some(size_field) = decl.fields().find(|field| match &field.desc { in check_array_fields()
1236 for decl in &file.declarations { in check_padding_fields()
1238 for field in decl.fields() { in check_padding_fields()
1272 decl: &parser_ast::Decl, in compute_field_sizes()
1276 let mut decl = decl.annotate(Default::default(), |fields| { in compute_field_sizes() localVariable
1277 fields.iter().map(|field| annotate_field(decl, field, scope)).collect() in compute_field_sizes()
1281 decl.annot = match &decl.desc { in compute_field_sizes()
1285 let mut size = decl in compute_field_sizes()
1304 ast::DeclAnnotation { size: ast::Size::Static(*width), ..decl.annot } in compute_field_sizes()
1307 ast::DeclAnnotation { size: ast::Size::Dynamic, ..decl.annot } in compute_field_sizes()
1310 ast::DeclAnnotation { size: ast::Size::Static(0), ..decl.annot } in compute_field_sizes()
1313 decl in compute_field_sizes()
1317 decl: &parser_ast::Decl, in compute_field_sizes()
1334 let has_payload_size = decl.fields().any(|field| match &field.desc { in compute_field_sizes()
1361 let has_array_size = decl.fields().any(|field| match &field.desc { in compute_field_sizes()
1380 for decl in file.declarations.iter() { in compute_field_sizes()
1381 let decl = annotate_decl(decl, &scope); in compute_field_sizes() localVariable
1382 if let Some(id) = decl.id() { in compute_field_sizes()
1383 scope.insert(id.to_string(), decl.annot.clone()); in compute_field_sizes()
1385 declarations.push(decl); in compute_field_sizes()
1443 let groups = utils::drain_filter(&mut file.declarations, |decl| { in inline_groups()
1444 matches!(&decl.desc, DeclDesc::Group { .. }) in inline_groups()
1447 .map(|decl| (decl.id().unwrap().to_owned(), decl)) in inline_groups()
1450 for decl in file.declarations.iter_mut() { in inline_groups()
1451 match &mut decl.desc { in inline_groups()