Summary: New syntax f1 AND-WITH-WITNESSES f2 : predicate_on_both_witnesses() This is needed for a linter to check that a macro is present, see the test. Reviewed By: skcho Differential Revision: D18735988 fbshipit-source-id: a3be75c5emaster
parent
c9449cce77
commit
48da570aa0
@ -0,0 +1,27 @@
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*)
|
||||
|
||||
open! IStd
|
||||
|
||||
let decl_name_is_contained_in_name_of_decl (node1 : Ctl_parser_types.ast_node)
|
||||
(node2 : Ctl_parser_types.ast_node) =
|
||||
let get_name decl =
|
||||
match Clang_ast_proj.get_named_decl_tuple decl with
|
||||
| Some (_, ndi) ->
|
||||
Some ndi.ni_name
|
||||
| None ->
|
||||
None
|
||||
in
|
||||
match (node1, node2) with
|
||||
| Decl decl1, Decl decl2 -> (
|
||||
match (get_name decl1, get_name decl2) with
|
||||
| Some name1, Some name2 ->
|
||||
String.is_substring name2 ~substring:name1
|
||||
| _ ->
|
||||
false )
|
||||
| _ ->
|
||||
false
|
@ -1,13 +1,11 @@
|
||||
/*
|
||||
(*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/NSObject.h>
|
||||
*)
|
||||
|
||||
int x;
|
||||
open! IStd
|
||||
|
||||
@interface SiblingExample : NSObject
|
||||
|
||||
@end
|
||||
val decl_name_is_contained_in_name_of_decl :
|
||||
Ctl_parser_types.ast_node -> Ctl_parser_types.ast_node -> bool
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
int x;
|
||||
|
||||
@interface SiblingExample
|
||||
|
||||
@end
|
||||
|
||||
#define LINK_REQUIRE(NAME) \
|
||||
extern char Linkable_##NAME; \
|
||||
extern const void* const OS_WEAK OS_CONCAT(Link_, NAME); \
|
||||
OS_USED const void* const OS_WEAK OS_CONCAT(Link_, NAME) = &Linkable_##NAME;
|
||||
|
||||
LINK_REQUIRE(SiblingExample_Cat2);
|
||||
@interface SiblingExample (Cat2)
|
||||
- (void)foo:(int)themeProvider;
|
||||
|
||||
@end
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
int x;
|
||||
|
||||
@interface SiblingExample
|
||||
|
||||
@end
|
||||
|
||||
#define LINK_REQUIRE(NAME) \
|
||||
extern char Linkable_##NAME; \
|
||||
extern const void* const OS_WEAK OS_CONCAT(Link_, NAME); \
|
||||
OS_USED const void* const OS_WEAK OS_CONCAT(Link_, NAME) = &Linkable_##NAME;
|
||||
|
||||
@interface SiblingExample (Cat1)
|
||||
- (void)foo:(int)themeProvider;
|
||||
|
||||
@end
|
||||
|
||||
LINK_REQUIRE(SiblingExampl);
|
||||
@interface SiblingExample (Cat2)
|
||||
- (void)foo:(int)themeProvider;
|
||||
|
||||
@end
|
Loading…
Reference in new issue