mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 12:04:39 +08:00
Reformat CPP files
This commit is contained in:
parent
f1a59e83c5
commit
9ee5075fc3
|
@ -153,7 +153,6 @@ struct optional_t {
|
||||||
bool has_value() const { return contents != nullptr; }
|
bool has_value() const { return contents != nullptr; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace horrible_template_goop {
|
namespace horrible_template_goop {
|
||||||
|
|
||||||
// void if B is true, SFINAE'd away otherwise.
|
// void if B is true, SFINAE'd away otherwise.
|
||||||
|
|
|
@ -87,8 +87,10 @@
|
||||||
static const char *const *s_arguments;
|
static const char *const *s_arguments;
|
||||||
static int s_test_run_count = 0;
|
static int s_test_run_count = 0;
|
||||||
|
|
||||||
#define system_assert(command) if (system(command)) \
|
#define system_assert(command) \
|
||||||
{ err(L"Non-zero result on line %d: %s", __LINE__, command); }
|
if (system(command)) { \
|
||||||
|
err(L"Non-zero result on line %d: %s", __LINE__, command); \
|
||||||
|
}
|
||||||
|
|
||||||
// Indicate if we should test the given function. Either we test everything (all arguments) or we
|
// Indicate if we should test the given function. Either we test everything (all arguments) or we
|
||||||
// run only tests that have a prefix in s_arguments.
|
// run only tests that have a prefix in s_arguments.
|
||||||
|
|
|
@ -1177,8 +1177,7 @@ void highlighter_t::visit(const ast::redirection_t &redir) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOCLOB means that we must not overwrite files that exist.
|
// NOCLOB means that we must not overwrite files that exist.
|
||||||
target_is_valid =
|
target_is_valid = file_is_writable &&
|
||||||
file_is_writable &&
|
|
||||||
!(file_exists && oper->mode == redirection_mode_t::noclob);
|
!(file_exists && oper->mode == redirection_mode_t::noclob);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,15 +30,14 @@ struct parse_token_t {
|
||||||
bool is_help_argument{false}; // Hackish: whether the source looks like '-h' or '--help'
|
bool is_help_argument{false}; // Hackish: whether the source looks like '-h' or '--help'
|
||||||
bool is_newline{false}; // Hackish: if TOK_END, whether the source is a newline.
|
bool is_newline{false}; // Hackish: if TOK_END, whether the source is a newline.
|
||||||
bool may_be_variable_assignment{false}; // Hackish: whether this token is a string like FOO=bar
|
bool may_be_variable_assignment{false}; // Hackish: whether this token is a string like FOO=bar
|
||||||
tokenizer_error_t tok_error{tokenizer_error_t::none}; // If this is a tokenizer error, that error.
|
tokenizer_error_t tok_error{
|
||||||
|
tokenizer_error_t::none}; // If this is a tokenizer error, that error.
|
||||||
source_offset_t source_start{SOURCE_OFFSET_INVALID};
|
source_offset_t source_start{SOURCE_OFFSET_INVALID};
|
||||||
source_offset_t source_length{0};
|
source_offset_t source_length{0};
|
||||||
|
|
||||||
/// \return the source range.
|
/// \return the source range.
|
||||||
/// Note the start may be invalid.
|
/// Note the start may be invalid.
|
||||||
source_range_t range() const {
|
source_range_t range() const { return source_range_t{source_start, source_length}; }
|
||||||
return source_range_t{source_start, source_length};
|
|
||||||
}
|
|
||||||
|
|
||||||
/// \return whether we are a string with the dash prefix set.
|
/// \return whether we are a string with the dash prefix set.
|
||||||
bool is_dash_prefix_string() const {
|
bool is_dash_prefix_string() const {
|
||||||
|
|
|
@ -671,7 +671,6 @@ std::vector<int> parse_util_compute_indents(const wcstring &src) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
node_visitor(*this).accept_children_of(&node);
|
node_visitor(*this).accept_children_of(&node);
|
||||||
indent -= dec;
|
indent -= dec;
|
||||||
}
|
}
|
||||||
|
|
|
@ -220,6 +220,7 @@ struct eval_res_t {
|
||||||
|
|
||||||
class parser_t : public std::enable_shared_from_this<parser_t> {
|
class parser_t : public std::enable_shared_from_this<parser_t> {
|
||||||
friend class parse_execution_context_t;
|
friend class parse_execution_context_t;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// The current execution context.
|
/// The current execution context.
|
||||||
std::unique_ptr<parse_execution_context_t> execution_context;
|
std::unique_ptr<parse_execution_context_t> execution_context;
|
||||||
|
|
|
@ -885,9 +885,7 @@ void reader_data_t::kill(editable_line_t *el, size_t begin_idx, size_t length, i
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is called from a signal handler!
|
// This is called from a signal handler!
|
||||||
void reader_handle_sigint() {
|
void reader_handle_sigint() { interrupted = SIGINT; }
|
||||||
interrupted = SIGINT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Make sure buffers are large enough to hold the current string length.
|
/// Make sure buffers are large enough to hold the current string length.
|
||||||
void reader_data_t::command_line_changed(const editable_line_t *el) {
|
void reader_data_t::command_line_changed(const editable_line_t *el) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user