Module QualifiedCppName.Match
Module to match qualified C++ procnames "fuzzily", that is up to namescapes and templating. In particular, this deals with the following issues:
- 'std::' namespace may have inline namespace afterwards: std::move becomes std::__1::move. This happens on libc++ and to some extent on libstdc++. To work around this problem, make matching against 'std::' more fuzzier: std::X::Y::Z will match std::.*::X::Y::Z (but only for the 'std' namespace).
- The names are allowed not to commit to a template specialization: we want std::move to match std::__1::move<const X&> and std::__1::move<int>. To do so, comparison function for qualifiers will ignore template specializations.
For example:
"std", "move"
:
- matches:
"std", "blah", "move"
- matches:
"std", "blah<int>", "move"
- does not match:
"std","blah", "move", "BAD"
- we don't want std::.*::X::.* to pass - does not match:
"stdBAD", "move"
, - it's not std namespace anymore
"folly", "someFunction"
- matches:
"folly","someFunction"
- matches:
"folly","someFunction<int>"
- matches:
"folly<int>","someFunction"
- does not match:
"folly", "BAD", "someFunction"
- unlike 'std' any other namespace needs all qualifiers to match - does not match:
"folly","someFunction<int>", "BAD"
- same as previous example
val of_fuzzy_qual_names : ?prefix:bool -> string list -> quals_matcher
val match_qualifiers : quals_matcher -> t -> bool