mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-24 07:40:19 +00:00
Really check everything in check_all
This commit is contained in:
parent
a83301ce5b
commit
6b6423edfb
@ -30,10 +30,7 @@ pub(crate) fn typecheck(namespace: &Namespace, apis: &[Api], types: &Types) -> R
|
||||
}
|
||||
|
||||
fn do_typecheck(cx: &mut Check) {
|
||||
for segment in cx.namespace {
|
||||
ident::check(cx, segment);
|
||||
}
|
||||
ident::check_all(cx, cx.apis);
|
||||
ident::check_all(cx, cx.namespace, cx.apis);
|
||||
|
||||
for ty in cx.types {
|
||||
match ty {
|
||||
|
@ -1,8 +1,9 @@
|
||||
use crate::syntax::check::Check;
|
||||
use crate::syntax::namespace::Namespace;
|
||||
use crate::syntax::{error, Api};
|
||||
use proc_macro2::Ident;
|
||||
|
||||
pub(crate) fn check(cx: &mut Check, ident: &Ident) {
|
||||
fn check(cx: &mut Check, ident: &Ident) {
|
||||
let s = ident.to_string();
|
||||
if s.starts_with("cxxbridge") {
|
||||
cx.error(ident, error::CXXBRIDGE_RESERVED.msg);
|
||||
@ -12,7 +13,11 @@ pub(crate) fn check(cx: &mut Check, ident: &Ident) {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn check_all(cx: &mut Check, apis: &[Api]) {
|
||||
pub(crate) fn check_all(cx: &mut Check, namespace: &Namespace, apis: &[Api]) {
|
||||
for segment in namespace {
|
||||
check(cx, segment);
|
||||
}
|
||||
|
||||
for api in apis {
|
||||
match api {
|
||||
Api::Include(_) => {}
|
||||
|
Loading…
Reference in New Issue
Block a user