mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-07-02 00:51:15 -03:00
Port future_feature_flags.cpp to Rust
This is early work but I guess there's no harm in pushing it?
Some thoughts on the conventions:
Types that live only inside Rust follow Rust naming convention
("FeatureMetadata").
Types that live on both sides of the language boundary follow the existing
naming ("feature_flag_t").
The alternative is to define a type alias ("using feature_flag_t =
rust::FeatureFlag") but that doesn't seem to be supported in "[cxx::bridge]"
blocks. We could put it in a header ("future_feature_flags.h").
"feature_metadata_t" is a variant of "FeatureMetadata" that can cross
the language boundary. This has the advantage that we can avoid tainting
"FeatureMetadata" with "CxxString" and such. This is an experimental approach,
probably not what we should do in general.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "expand.h"
|
||||
#include "fallback.h" // IWYU pragma: keep
|
||||
#include "function.h"
|
||||
#include "future_feature_flags.h"
|
||||
#include "future_feature_flags.rs.h"
|
||||
#include "history.h"
|
||||
#include "maybe.h"
|
||||
#include "operation_context.h"
|
||||
@@ -665,7 +665,7 @@ static void color_string_internal(const wcstring &buffstr, highlight_spec_t base
|
||||
break;
|
||||
}
|
||||
case L'?': {
|
||||
if (!feature_test(features_t::qmark_noglob)) {
|
||||
if (!feature_test(feature_flag_t::qmark_noglob)) {
|
||||
colors[in_pos] = highlight_role_t::operat;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user