(&mut self, literal: &ast::Node)
| 709 | } |
| 710 | |
| 711 | fn create_object_from_literal(&mut self, literal: &ast::Node) -> Result<Symbol<T>> { |
| 712 | let ctx = self.get_current_ctx(); |
| 713 | let sym = match &literal.kind { |
| 714 | ast::Clang::CharacterLiteral(cl) => { |
| 715 | let ty = cl.r#type.clone(); |
| 716 | Symbol::new(ty, ObjectState::Literal(Literal::Char(cl.clone())), ctx) |
| 717 | } |
| 718 | ast::Clang::StringLiteral(sl) => { |
| 719 | let ty = sl.r#type.clone(); |
| 720 | Symbol::new(ty, ObjectState::Literal(Literal::String(sl.clone())), ctx) |
| 721 | } |
| 722 | ast::Clang::IntegerLiteral(il) => { |
| 723 | let ty = il.r#type.clone(); |
| 724 | Symbol::new(ty, ObjectState::Literal(Literal::Int(il.clone())), ctx) |
| 725 | } |
| 726 | ast::Clang::FloatingLiteral(fl) => { |
| 727 | let ty = fl.r#type.clone(); |
| 728 | Symbol::new(ty, ObjectState::Literal(Literal::Float(fl.clone())), ctx) |
| 729 | } |
| 730 | _ => unreachable!("require Literal stmt, received: {literal:#?}"), |
| 731 | }; |
| 732 | Ok(sym) |
| 733 | } |
| 734 | |
| 735 | pub fn create_object_for_call(&mut self, call: &ast::Node) -> Result<Symbol<T>> { |
| 736 | if let ast::Clang::CallExpr(ce) = &call.kind { |
no test coverage detected