diff --git a/src/ast.h b/src/ast.h index 49fc361b4..ac436aa68 100644 --- a/src/ast.h +++ b/src/ast.h @@ -153,7 +153,6 @@ struct optional_t { bool has_value() const { return contents != nullptr; } }; - namespace horrible_template_goop { // void if B is true, SFINAE'd away otherwise. @@ -1015,4 +1014,4 @@ class ast_t { }; } // namespace ast -#endif // FISH_AST_H +#endif // FISH_AST_H diff --git a/src/fish_tests.cpp b/src/fish_tests.cpp index e85d2aa05..221721e32 100644 --- a/src/fish_tests.cpp +++ b/src/fish_tests.cpp @@ -87,8 +87,10 @@ static const char *const *s_arguments; static int s_test_run_count = 0; -#define system_assert(command) if (system(command)) \ - { err(L"Non-zero result on line %d: %s", __LINE__, command); } +#define system_assert(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 // run only tests that have a prefix in s_arguments. diff --git a/src/highlight.cpp b/src/highlight.cpp index 3e2c16a6e..abb68d2e7 100644 --- a/src/highlight.cpp +++ b/src/highlight.cpp @@ -1078,7 +1078,7 @@ void highlighter_t::visit(const ast::decorated_statement_t &stmt) { void highlighter_t::visit(const ast::redirection_t &redir) { maybe_t oper = pipe_or_redir_t::from_string(redir.oper.source(this->buff)); // like 2> - wcstring target = redir.target.source(this->buff); // like &1 or file path + wcstring target = redir.target.source(this->buff); // like &1 or file path assert(oper.has_value() && "Should have successfully parsed a pipe_or_redir_t since it was in our ast"); @@ -1177,9 +1177,8 @@ void highlighter_t::visit(const ast::redirection_t &redir) { } // NOCLOB means that we must not overwrite files that exist. - target_is_valid = - file_is_writable && - !(file_exists && oper->mode == redirection_mode_t::noclob); + target_is_valid = file_is_writable && + !(file_exists && oper->mode == redirection_mode_t::noclob); break; } } diff --git a/src/parse_tree.h b/src/parse_tree.h index 66669a311..ba702862f 100644 --- a/src/parse_tree.h +++ b/src/parse_tree.h @@ -25,20 +25,19 @@ struct parse_token_t { enum parse_token_type_t type; // The type of the token as represented by the parser enum parse_keyword_t keyword { parse_keyword_t::none - }; // Any keyword represented by this token - bool has_dash_prefix{false}; // Hackish: whether the source contains a dash prefix - 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. + }; // Any keyword represented by this token + bool has_dash_prefix{false}; // Hackish: whether the source contains a dash prefix + 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 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_length{0}; /// \return the source range. /// Note the start may be invalid. - source_range_t range() const { - return source_range_t{source_start, source_length}; - } + source_range_t range() const { return source_range_t{source_start, source_length}; } /// \return whether we are a string with the dash prefix set. bool is_dash_prefix_string() const { diff --git a/src/parse_util.cpp b/src/parse_util.cpp index 190fdcac9..0aa9673a1 100644 --- a/src/parse_util.cpp +++ b/src/parse_util.cpp @@ -671,7 +671,6 @@ std::vector parse_util_compute_indents(const wcstring &src) { } } - node_visitor(*this).accept_children_of(&node); indent -= dec; } diff --git a/src/parser.h b/src/parser.h index 0bfb23689..6c0a5e235 100644 --- a/src/parser.h +++ b/src/parser.h @@ -220,6 +220,7 @@ struct eval_res_t { class parser_t : public std::enable_shared_from_this { friend class parse_execution_context_t; + private: /// The current execution context. std::unique_ptr execution_context; diff --git a/src/reader.cpp b/src/reader.cpp index 679be8bd7..e388b909c 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -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! -void reader_handle_sigint() { - interrupted = SIGINT; -} +void reader_handle_sigint() { interrupted = SIGINT; } /// Make sure buffers are large enough to hold the current string length. void reader_data_t::command_line_changed(const editable_line_t *el) {