mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
Run clang-format on all files
The main change here is to reorder headers.
This commit is contained in:
parent
e73e9c3e2e
commit
82eca4bc86
110 changed files with 250 additions and 171 deletions
|
@ -4,15 +4,15 @@
|
||||||
|
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "env.h"
|
|
||||||
#include "wutil.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
#include "env.h"
|
||||||
|
#include "wutil.h"
|
||||||
|
|
||||||
class autoload_file_cache_t;
|
class autoload_file_cache_t;
|
||||||
class environment_t;
|
class environment_t;
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
|
@ -17,17 +17,18 @@
|
||||||
// 4). Use 'git add sphinx_doc_src/NAME.txt' to start tracking changes to the documentation file.
|
// 4). Use 'git add sphinx_doc_src/NAME.txt' to start tracking changes to the documentation file.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
#include "builtin_argparse.h"
|
#include "builtin_argparse.h"
|
||||||
#include "builtin_bg.h"
|
#include "builtin_bg.h"
|
||||||
#include "builtin_bind.h"
|
#include "builtin_bind.h"
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
// See issue #4190 for the rationale behind the original behavior of this builtin.
|
// See issue #4190 for the rationale behind the original behavior of this builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_argparse.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
@ -16,7 +18,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_argparse.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Implementation of the bg builtin.
|
// Implementation of the bg builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_bg.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
@ -8,7 +10,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_bg.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Implementation of the bind builtin.
|
// Implementation of the bind builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_bind.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
@ -10,7 +12,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_bind.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "input.h" // IWYU pragma: keep
|
#include "input.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// Implementation of the bind builtin.
|
// Implementation of the bind builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_block.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_block.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// Implementation of the builtin builtin.
|
// Implementation of the builtin builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
#include "builtin_builtin.h"
|
#include "builtin_builtin.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// Implementation of the cd builtin.
|
// Implementation of the cd builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_cd.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_cd.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// Implementation of the command builtin.
|
// Implementation of the command builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_command.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_command.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
|
@ -2,23 +2,23 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
#include "color.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "complete.h"
|
#include "complete.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
#include "highlight.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_util.h"
|
#include "parse_util.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "highlight.h"
|
|
||||||
#include "color.h"
|
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "wgetopt.h"
|
#include "wgetopt.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_COMPLETE_H
|
#ifndef FISH_BUILTIN_COMPLETE_H
|
||||||
#define FISH_BUILTIN_COMPLETE_H
|
#define FISH_BUILTIN_COMPLETE_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
// Implementation of the contains builtin.
|
// Implementation of the contains builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_contains.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_contains.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// Implementation of the disown builtin.
|
// Implementation of the disown builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_disown.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_disown.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Implementation of the echo builtin.
|
// Implementation of the echo builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_echo.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_echo.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
// Implementation of the emit builtin.
|
// Implementation of the emit builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
#include "builtin_emit.h"
|
#include "builtin_emit.h"
|
||||||
|
|
||||||
|
#include "builtin.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Implementation of the exit builtin.
|
// Implementation of the exit builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_exit.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_exit.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
// Implementation of the fg builtin.
|
// Implementation of the fg builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_fg.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_fg.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Implementation of the function builtin.
|
// Implementation of the function builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_function.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -11,7 +13,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_function.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "complete.h"
|
#include "complete.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
// Implementation of the functions builtin.
|
// Implementation of the functions builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_functions.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
@ -13,7 +15,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_functions.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "complete.h"
|
#include "complete.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
|
@ -266,7 +267,8 @@ static int report_function_metadata(const wchar_t *funcname, bool verbose, io_st
|
||||||
append_format(comment, L"# Defined in %ls @ line %d\n", path, line_number);
|
append_format(comment, L"# Defined in %ls @ line %d\n", path, line_number);
|
||||||
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
|
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
|
||||||
std::vector<highlight_spec_t> colors;
|
std::vector<highlight_spec_t> colors;
|
||||||
highlight_shell_no_io(comment, colors, comment.size(), nullptr, env_stack_t::globals());
|
highlight_shell_no_io(comment, colors, comment.size(), nullptr,
|
||||||
|
env_stack_t::globals());
|
||||||
streams.out.append(str2wcstring(colorize(comment, colors)));
|
streams.out.append(str2wcstring(colorize(comment, colors)));
|
||||||
} else {
|
} else {
|
||||||
streams.out.append(comment);
|
streams.out.append(comment);
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
// Implementation of the history builtin.
|
// Implementation of the history builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_history.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_history.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "history.h"
|
#include "history.h"
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_JOBS_H
|
#ifndef FISH_BUILTIN_JOBS_H
|
||||||
#define FISH_BUILTIN_JOBS_H
|
#define FISH_BUILTIN_JOBS_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,22 @@
|
||||||
// Implementation of the math builtin.
|
// Implementation of the math builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_math.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "tinyexpr.h"
|
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_math.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
#include "tinyexpr.h"
|
||||||
#include "wgetopt.h"
|
#include "wgetopt.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_PRINTF_H
|
#ifndef FISH_BUILTIN_PRINTF_H
|
||||||
#define FISH_BUILTIN_PRINTF_H
|
#define FISH_BUILTIN_PRINTF_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// Implementation of the pwd builtin.
|
// Implementation of the pwd builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_pwd.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_pwd.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
// Implementation of the random builtin.
|
// Implementation of the random builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_random.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_random.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
// Implementation of the read builtin.
|
// Implementation of the read builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_read.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_read.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "complete.h"
|
#include "complete.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
// Implementation of the realpath builtin.
|
// Implementation of the realpath builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_realpath.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_realpath.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
// Implementation of the return builtin.
|
// Implementation of the return builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_return.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_return.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -6,10 +6,10 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_SET_H
|
#ifndef FISH_BUILTIN_SET_H
|
||||||
#define FISH_BUILTIN_SET_H
|
#define FISH_BUILTIN_SET_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ static void print_colors(io_streams_t &streams) {
|
||||||
}
|
}
|
||||||
outp.writestr(color_name);
|
outp.writestr(color_name);
|
||||||
outp.writech(L'\n');
|
outp.writech(L'\n');
|
||||||
} // conveniently, 'normal' is always the last color so we don't need to reset here
|
} // conveniently, 'normal' is always the last color so we don't need to reset here
|
||||||
|
|
||||||
streams.out.append(str2wcstring(outp.contents()));
|
streams.out.append(str2wcstring(outp.contents()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_SET_COLOR_H
|
#ifndef FISH_BUILTIN_SET_COLOR_H
|
||||||
#define FISH_BUILTIN_SET_COLOR_H
|
#define FISH_BUILTIN_SET_COLOR_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,15 @@
|
||||||
// Implementation of the source builtin.
|
// Implementation of the source builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin_source.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_source.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// Implementation of the status builtin.
|
// Implementation of the status builtin.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include <stddef.h>
|
#include "builtin_status.h"
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_status.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "future_feature_flags.h"
|
#include "future_feature_flags.h"
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <cwctype>
|
#include <cwctype>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_STRING_H
|
#ifndef FISH_BUILTIN_STRING_H
|
||||||
#define FISH_BUILTIN_STRING_H
|
#define FISH_BUILTIN_STRING_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -3,22 +3,23 @@
|
||||||
// Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference.
|
// Implemented from scratch (yes, really) by way of IEEE 1003.1 as reference.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "builtin.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "builtin.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
#ifndef FISH_BUILTIN_ULIMIT_H
|
#ifndef FISH_BUILTIN_ULIMIT_H
|
||||||
#define FISH_BUILTIN_ULIMIT_H
|
#define FISH_BUILTIN_ULIMIT_H
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
// Functions for waiting for processes completed.
|
// Functions for waiting for processes completed.
|
||||||
|
#include "builtin_wait.h"
|
||||||
|
|
||||||
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "builtin_wait.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
|
@ -11,8 +14,6 @@
|
||||||
#include "wgetopt.h"
|
#include "wgetopt.h"
|
||||||
#include "wutil.h"
|
#include "wutil.h"
|
||||||
|
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
/// Return the job id to which the process with pid belongs.
|
/// Return the job id to which the process with pid belongs.
|
||||||
/// If a specified process has already finished but the job hasn't, parser_t::job_get_from_pid()
|
/// If a specified process has already finished but the job hasn't, parser_t::job_get_from_pid()
|
||||||
/// doesn't work properly, so use this function in wait command.
|
/// doesn't work properly, so use this function in wait command.
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#define FISH_BUILTIN_WAIT_H
|
#define FISH_BUILTIN_WAIT_H
|
||||||
|
|
||||||
class parser_t;
|
class parser_t;
|
||||||
|
struct io_streams_t;
|
||||||
|
|
||||||
int builtin_wait(parser_t &parser, io_streams_t &streams, wchar_t **argv);
|
int builtin_wait(parser_t &parser, io_streams_t &streams, wchar_t **argv);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
// Color class implementation.
|
// Color class implementation.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "color.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cwchar> // IWYU pragma: keep
|
#include <cwchar> // IWYU pragma: keep
|
||||||
|
|
||||||
#include "color.h"
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#define FISH_COLOR_H
|
#define FISH_COLOR_H
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#ifdef HAVE_EXECINFO_H
|
#ifdef HAVE_EXECINFO_H
|
||||||
|
|
|
@ -5,15 +5,17 @@
|
||||||
///
|
///
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "complete.h"
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cwchar>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
@ -29,7 +31,6 @@
|
||||||
#include "autoload.h"
|
#include "autoload.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "complete.h"
|
|
||||||
#include "env.h"
|
#include "env.h"
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
#include "expand.h"
|
#include "expand.h"
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
#include "enum_set.h"
|
#include "enum_set.h"
|
||||||
|
|
||||||
struct completion_mode_t {
|
struct completion_mode_t {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Functions for setting and getting environment variables.
|
// Functions for setting and getting environment variables.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "env.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <pwd.h>
|
#include <pwd.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
@ -18,7 +20,6 @@
|
||||||
|
|
||||||
#include "builtin_bind.h"
|
#include "builtin_bind.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env.h"
|
|
||||||
#include "env_dispatch.h"
|
#include "env_dispatch.h"
|
||||||
#include "env_universal_common.h"
|
#include "env_universal_common.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
@ -25,6 +26,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "env_universal_common.h"
|
#include "env_universal_common.h"
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
/// Initialize variable dispatch.
|
/// Initialize variable dispatch.
|
||||||
class environment_t;
|
class environment_t;
|
||||||
void env_dispatch_init(const environment_t &vars);
|
void env_dispatch_init(const environment_t &vars);
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#ifdef __CYGWIN__
|
#ifdef __CYGWIN__
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
@ -28,9 +29,9 @@
|
||||||
#include <sys/time.h> // IWYU pragma: keep
|
#include <sys/time.h> // IWYU pragma: keep
|
||||||
#include <sys/types.h> // IWYU pragma: keep
|
#include <sys/types.h> // IWYU pragma: keep
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
#include <cwchar>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Functions for handling event triggers.
|
// Functions for handling event triggers.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "event.h"
|
||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
@ -13,7 +15,6 @@
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "event.h"
|
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "input_common.h"
|
#include "input_common.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
|
@ -16,13 +16,13 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cstring>
|
|
||||||
#include <stack>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stack>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#include <sys/types.h> // IWYU pragma: keep
|
#include <sys/types.h> // IWYU pragma: keep
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
@ -37,7 +38,8 @@
|
||||||
#include <ncurses/term.h>
|
#include <ncurses/term.h>
|
||||||
#endif
|
#endif
|
||||||
#include <signal.h> // IWYU pragma: keep
|
#include <signal.h> // IWYU pragma: keep
|
||||||
#include <cwchar> // IWYU pragma: keep
|
|
||||||
|
#include <cwchar> // IWYU pragma: keep
|
||||||
|
|
||||||
#include "common.h" // IWYU pragma: keep
|
#include "common.h" // IWYU pragma: keep
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -92,8 +92,8 @@ wchar_t *wcsdup(const wchar_t *in);
|
||||||
int wcscasecmp(const wchar_t *a, const wchar_t *b);
|
int wcscasecmp(const wchar_t *a, const wchar_t *b);
|
||||||
int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
int wcsncasecmp(const wchar_t *s1, const wchar_t *s2, size_t n);
|
||||||
wchar_t *wcsndup(const wchar_t *in, size_t c);
|
wchar_t *wcsndup(const wchar_t *in, size_t c);
|
||||||
#endif // clang::weak_import
|
#endif // clang::weak_import
|
||||||
#else // __APPLE__
|
#else // __APPLE__
|
||||||
|
|
||||||
/// These functions are missing from Solaris 10, and only accessible from
|
/// These functions are missing from Solaris 10, and only accessible from
|
||||||
/// Solaris 11 in the std:: namespace.
|
/// Solaris 11 in the std:: namespace.
|
||||||
|
|
|
@ -30,9 +30,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -24,8 +24,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -24,18 +24,18 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cstring>
|
|
||||||
#include <cwchar>
|
|
||||||
#include <thread>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <cstring>
|
||||||
|
#include <cwchar>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <thread>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,15 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
#include "global_safety.h"
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "enum_set.h"
|
#include "enum_set.h"
|
||||||
|
#include "global_safety.h"
|
||||||
#include "parse_util.h"
|
#include "parse_util.h"
|
||||||
#include "wildcard.h"
|
#include "wildcard.h"
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
namespace flog_details {
|
namespace flog_details {
|
||||||
|
|
||||||
// Note we are relying on the order of global initialization within this file.
|
// Note we are relying on the order of global initialization within this file.
|
||||||
|
|
|
@ -4,13 +4,14 @@
|
||||||
|
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "global_safety.h"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "global_safety.h"
|
||||||
|
|
||||||
using wcstring = std::wstring;
|
using wcstring = std::wstring;
|
||||||
using wcstring_list_t = std::vector<wcstring>;
|
using wcstring_list_t = std::vector<wcstring>;
|
||||||
|
|
||||||
|
|
|
@ -8,9 +8,9 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include <cwchar>
|
|
||||||
#include "future_feature_flags.h"
|
#include "future_feature_flags.h"
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
|
|
||||||
/// The set of features applying to this instance.
|
/// The set of features applying to this instance.
|
||||||
static features_t global_features;
|
static features_t global_features;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#define FISH_FUTURE_FEATURE_FLAGS_H
|
#define FISH_FUTURE_FEATURE_FLAGS_H
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
|
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
// fish is multithreaded. Global (which includes function and file-level statics) when used naively
|
// fish is multithreaded. Global (which includes function and file-level statics) when used naively
|
||||||
// may therefore lead to data races. Use the following types to characterize and enforce correct
|
// may therefore lead to data races. Use the following types to characterize and enforce correct
|
||||||
// access patterns.
|
// access patterns.
|
||||||
|
|
|
@ -6,9 +6,9 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
// We need the sys/file.h for the flock() declaration on Linux but not OS X.
|
// We need the sys/file.h for the flock() declaration on Linux but not OS X.
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "history.h"
|
|
||||||
#include "history_file.h"
|
#include "history_file.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "history.h"
|
||||||
|
|
||||||
// Some forward declarations.
|
// Some forward declarations.
|
||||||
static history_item_t decode_item_fish_2_0(const char *base, size_t len);
|
static history_item_t decode_item_fish_2_0(const char *base, size_t len);
|
||||||
static history_item_t decode_item_fish_1_x(const char *begin, size_t length);
|
static history_item_t decode_item_fish_1_x(const char *begin, size_t length);
|
||||||
|
|
|
@ -3,12 +3,12 @@
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "maybe.h"
|
#include <sys/mman.h>
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include <sys/mman.h>
|
#include "maybe.h"
|
||||||
|
|
||||||
class history_item_t;
|
class history_item_t;
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
#if HAVE_TERM_H
|
#if HAVE_TERM_H
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
@ -11,8 +12,8 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -2,12 +2,13 @@
|
||||||
#ifndef INPUT_COMMON_H
|
#ifndef INPUT_COMMON_H
|
||||||
#define INPUT_COMMON_H
|
#define INPUT_COMMON_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include <queue>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "maybe.h"
|
#include "maybe.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
#include <queue>
|
|
||||||
|
|
||||||
enum class readline_cmd_t {
|
enum class readline_cmd_t {
|
||||||
beginning_of_line,
|
beginning_of_line,
|
||||||
end_of_line,
|
end_of_line,
|
||||||
|
|
|
@ -1,16 +1,17 @@
|
||||||
// Library for pooling common strings.
|
// Library for pooling common strings.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "intern.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "intern.h"
|
|
||||||
|
|
||||||
bool string_less_than_string(const wchar_t *a, const wchar_t *b) { return std::wcscmp(a, b) < 0; }
|
bool string_less_than_string(const wchar_t *a, const wchar_t *b) { return std::wcscmp(a, b) < 0; }
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,19 @@
|
||||||
// Utilities for io redirection.
|
// Utilities for io redirection.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "io.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "exec.h"
|
#include "exec.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "io.h"
|
|
||||||
#include "iothread.h"
|
#include "iothread.h"
|
||||||
#include "redirection.h"
|
#include "redirection.h"
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "iothread.h"
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -8,16 +10,15 @@
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <atomic>
|
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
|
#include <cstring>
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
#include "global_safety.h"
|
#include "global_safety.h"
|
||||||
#include "iothread.h"
|
|
||||||
#include "wutil.h"
|
#include "wutil.h"
|
||||||
|
|
||||||
#ifdef _POSIX_THREAD_THREADS_MAX
|
#ifdef _POSIX_THREAD_THREADS_MAX
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#define FISH_IOTHREAD_H
|
#define FISH_IOTHREAD_H
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
#define FISH_LRU_H
|
#define FISH_LRU_H
|
||||||
|
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#if HAVE_CURSES_H
|
#if HAVE_CURSES_H
|
||||||
#include <curses.h>
|
#include <curses.h>
|
||||||
|
@ -17,8 +18,8 @@
|
||||||
#include <ncurses/term.h>
|
#include <ncurses/term.h>
|
||||||
#endif
|
#endif
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
// IWYU pragma: no_include <cstddef>
|
// IWYU pragma: no_include <cstddef>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
|
@ -2,9 +2,10 @@
|
||||||
#ifndef FISH_PARSE_CONSTANTS_H
|
#ifndef FISH_PARSE_CONSTANTS_H
|
||||||
#define FISH_PARSE_CONSTANTS_H
|
#define FISH_PARSE_CONSTANTS_H
|
||||||
|
|
||||||
#include "common.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
#define PARSE_ASSERT(a) assert(a)
|
#define PARSE_ASSERT(a) assert(a)
|
||||||
#define PARSER_DIE() \
|
#define PARSER_DIE() \
|
||||||
do { \
|
do { \
|
||||||
|
|
|
@ -8,6 +8,8 @@
|
||||||
// for the execution to finish to see them.
|
// for the execution to finish to see them.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parse_execution.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -15,9 +17,9 @@
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
@ -36,7 +38,6 @@
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "maybe.h"
|
#include "maybe.h"
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_execution.h"
|
|
||||||
#include "parse_util.h"
|
#include "parse_util.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "path.h"
|
#include "path.h"
|
||||||
|
@ -488,7 +489,8 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const wcstring &switch_value_expanded = switch_values_expanded.size() == 1 ? switch_values_expanded.at(0).completion : L"";
|
const wcstring &switch_value_expanded =
|
||||||
|
switch_values_expanded.size() == 1 ? switch_values_expanded.at(0).completion : L"";
|
||||||
|
|
||||||
block_t *sb = parser->push_block(block_t::switch_block());
|
block_t *sb = parser->push_block(block_t::switch_block());
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <tuple>
|
#include <tuple>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parse_productions.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_grammar.h"
|
#include "parse_grammar.h"
|
||||||
#include "parse_productions.h"
|
|
||||||
#include "parse_tree.h"
|
#include "parse_tree.h"
|
||||||
|
|
||||||
using namespace parse_productions;
|
using namespace parse_productions;
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
// Programmatic representation of fish code.
|
// Programmatic representation of fish code.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parse_tree.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -16,7 +18,6 @@
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_productions.h"
|
#include "parse_productions.h"
|
||||||
#include "parse_tree.h"
|
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "tnode.h"
|
#include "tnode.h"
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
|
|
|
@ -4,10 +4,12 @@
|
||||||
// that are somehow related to parsing the code.
|
// that are somehow related to parsing the code.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parse_util.h"
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
@ -18,7 +20,6 @@
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "future_feature_flags.h"
|
#include "future_feature_flags.h"
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_util.h"
|
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "tnode.h"
|
#include "tnode.h"
|
||||||
#include "tokenizer.h"
|
#include "tokenizer.h"
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
// The fish parser. Contains functions for parsing and evaluating code.
|
// The fish parser. Contains functions for parsing and evaluating code.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parser.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cwchar>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
@ -19,7 +21,6 @@
|
||||||
#include "parse_constants.h"
|
#include "parse_constants.h"
|
||||||
#include "parse_execution.h"
|
#include "parse_execution.h"
|
||||||
#include "parse_util.h"
|
#include "parse_util.h"
|
||||||
#include "parser.h"
|
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "sanity.h"
|
#include "sanity.h"
|
||||||
|
|
|
@ -1,12 +1,13 @@
|
||||||
// Functions having to do with parser keywords, like testing if a function is a block command.
|
// Functions having to do with parser keywords, like testing if a function is a block command.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "parser_keywords.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "parser_keywords.h"
|
|
||||||
|
|
||||||
typedef std::unordered_set<wcstring> string_set_t;
|
typedef std::unordered_set<wcstring> string_set_t;
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,14 @@
|
||||||
// issues.
|
// issues.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "path.h"
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
@ -19,7 +21,6 @@
|
||||||
#include "expand.h"
|
#include "expand.h"
|
||||||
#include "fallback.h" // IWYU pragma: keep
|
#include "fallback.h" // IWYU pragma: keep
|
||||||
#include "flog.h"
|
#include "flog.h"
|
||||||
#include "path.h"
|
|
||||||
#include "wutil.h" // IWYU pragma: keep
|
#include "wutil.h" // IWYU pragma: keep
|
||||||
|
|
||||||
/// Unexpected error in path_get_path().
|
/// Unexpected error in path_get_path().
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#if FISH_USE_POSIX_SPAWN
|
#if FISH_USE_POSIX_SPAWN
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
// Print help message for the specified command.
|
// Print help message for the specified command.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "print_help.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "print_help.h"
|
|
||||||
|
|
||||||
#define CMD_LEN 1024
|
#define CMD_LEN 1024
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
@ -33,11 +34,11 @@
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wctype.h>
|
#include <wctype.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <csignal>
|
#include <csignal>
|
||||||
|
#include <cwchar>
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -1201,8 +1202,9 @@ wcstring completion_apply_to_command_line(const wcstring &val, complete_flags_t
|
||||||
// Find the last quote in the token to complete. By parsing only the string inside any
|
// Find the last quote in the token to complete. By parsing only the string inside any
|
||||||
// command substitution, we prevent the tokenizer from treating the entire command
|
// command substitution, we prevent the tokenizer from treating the entire command
|
||||||
// substitution as one token.
|
// substitution as one token.
|
||||||
parse_util_get_parameter_info(command_line.substr(cmdsub_offset, (cmdsub_end - cmdsub_begin)),
|
parse_util_get_parameter_info(
|
||||||
cursor_pos - cmdsub_offset, "e, NULL, NULL);
|
command_line.substr(cmdsub_offset, (cmdsub_end - cmdsub_begin)),
|
||||||
|
cursor_pos - cmdsub_offset, "e, NULL, NULL);
|
||||||
|
|
||||||
// If the token is reported as unquoted, but ends with a (unescaped) quote, and we can
|
// If the token is reported as unquoted, but ends with a (unescaped) quote, and we can
|
||||||
// modify the command line, then delete the trailing quote so that we can insert within
|
// modify the command line, then delete the trailing quote so that we can insert within
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
#include "redirection.h"
|
#include "redirection.h"
|
||||||
#include "wutil.h"
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
|
||||||
|
#include "wutil.h"
|
||||||
|
|
||||||
#define NOCLOB_ERROR _(L"The file '%ls' already exists")
|
#define NOCLOB_ERROR _(L"The file '%ls' already exists")
|
||||||
|
|
||||||
#define FILE_ERROR _(L"An error occurred while redirecting file '%ls'")
|
#define FILE_ERROR _(L"An error occurred while redirecting file '%ls'")
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#ifndef FISH_REDIRECTION_H
|
#ifndef FISH_REDIRECTION_H
|
||||||
#define FISH_REDIRECTION_H
|
#define FISH_REDIRECTION_H
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
#include "maybe.h"
|
#include "maybe.h"
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
/// This file supports "applying" redirections.
|
/// This file supports "applying" redirections.
|
||||||
|
|
||||||
/// A class representing a sequence of basic redirections.
|
/// A class representing a sequence of basic redirections.
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Functions for performing sanity checks on the program state.
|
// Functions for performing sanity checks on the program state.
|
||||||
#include "config.h" // IWYU pragma: keep
|
#include "config.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
#include "sanity.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -11,7 +13,6 @@
|
||||||
#include "kill.h"
|
#include "kill.h"
|
||||||
#include "proc.h"
|
#include "proc.h"
|
||||||
#include "reader.h"
|
#include "reader.h"
|
||||||
#include "sanity.h"
|
|
||||||
|
|
||||||
/// Status from earlier sanity checks.
|
/// Status from earlier sanity checks.
|
||||||
static relaxed_atomic_bool_t insane{false};
|
static relaxed_atomic_bool_t insane{false};
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <cwchar>
|
#include <cwchar>
|
||||||
|
|
||||||
|
@ -642,8 +643,7 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
|
||||||
// Determine how many lines have stuff on them; we need to clear lines with stuff that we don't
|
// Determine how many lines have stuff on them; we need to clear lines with stuff that we don't
|
||||||
// want.
|
// want.
|
||||||
const size_t lines_with_stuff = std::max(actual_lines_before_reset, scr->actual.line_count());
|
const size_t lines_with_stuff = std::max(actual_lines_before_reset, scr->actual.line_count());
|
||||||
if (scr->desired.line_count() < lines_with_stuff)
|
if (scr->desired.line_count() < lines_with_stuff) need_clear_screen = true;
|
||||||
need_clear_screen = true;
|
|
||||||
|
|
||||||
if (left_prompt != scr->actual_left_prompt) {
|
if (left_prompt != scr->actual_left_prompt) {
|
||||||
s_move(scr, 0, 0);
|
s_move(scr, 0, 0);
|
||||||
|
@ -669,12 +669,11 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
|
||||||
const size_t shared_prefix = line_shared_prefix(o_line, s_line);
|
const size_t shared_prefix = line_shared_prefix(o_line, s_line);
|
||||||
size_t skip_prefix = shared_prefix;
|
size_t skip_prefix = shared_prefix;
|
||||||
if (shared_prefix < o_line.indentation) {
|
if (shared_prefix < o_line.indentation) {
|
||||||
if (o_line.indentation > s_line.indentation
|
if (o_line.indentation > s_line.indentation && !has_cleared_screen && clr_eol &&
|
||||||
&& !has_cleared_screen && clr_eol && clr_eos) {
|
clr_eos) {
|
||||||
s_set_color(scr, vars, highlight_spec_t{});
|
s_set_color(scr, vars, highlight_spec_t{});
|
||||||
s_move(scr, 0, (int)i);
|
s_move(scr, 0, (int)i);
|
||||||
s_write_mbs(scr,
|
s_write_mbs(scr, should_clear_screen_this_line ? clr_eos : clr_eol);
|
||||||
should_clear_screen_this_line ? clr_eos : clr_eol);
|
|
||||||
has_cleared_screen = should_clear_screen_this_line;
|
has_cleared_screen = should_clear_screen_this_line;
|
||||||
has_cleared_line = true;
|
has_cleared_line = true;
|
||||||
}
|
}
|
||||||
|
@ -685,8 +684,9 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
|
||||||
// over the shared prefix of what we want to output now, and what we output before, to
|
// over the shared prefix of what we want to output now, and what we output before, to
|
||||||
// avoid repeatedly outputting it.
|
// avoid repeatedly outputting it.
|
||||||
if (skip_prefix > 0) {
|
if (skip_prefix > 0) {
|
||||||
size_t skip_width = shared_prefix < skip_prefix ? skip_prefix
|
size_t skip_width = shared_prefix < skip_prefix
|
||||||
: fish_wcswidth(&o_line.text.at(0), shared_prefix);
|
? skip_prefix
|
||||||
|
: fish_wcswidth(&o_line.text.at(0), shared_prefix);
|
||||||
if (skip_width > skip_remaining) skip_remaining = skip_width;
|
if (skip_width > skip_remaining) skip_remaining = skip_width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -722,21 +722,20 @@ static void s_update(screen_t *scr, const wcstring &left_prompt, const wcstring
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now actually output stuff.
|
// Now actually output stuff.
|
||||||
for (; ; j++) {
|
for (;; j++) {
|
||||||
bool done = j >= o_line.size();
|
bool done = j >= o_line.size();
|
||||||
// Clear the screen if we have not done so yet.
|
// Clear the screen if we have not done so yet.
|
||||||
// If we are about to output into the last column, clear the screen first. If we clear
|
// If we are about to output into the last column, clear the screen first. If we clear
|
||||||
// the screen after we output into the last column, it can erase the last character due
|
// the screen after we output into the last column, it can erase the last character due
|
||||||
// to the sticky right cursor. If we clear the screen too early, we can defeat soft
|
// to the sticky right cursor. If we clear the screen too early, we can defeat soft
|
||||||
// wrapping.
|
// wrapping.
|
||||||
if (should_clear_screen_this_line && !has_cleared_screen
|
if (should_clear_screen_this_line && !has_cleared_screen &&
|
||||||
&& (done || j + 1 == (size_t)screen_width)) {
|
(done || j + 1 == (size_t)screen_width)) {
|
||||||
s_move(scr, current_width, (int)i);
|
s_move(scr, current_width, (int)i);
|
||||||
s_write_mbs(scr, clr_eos);
|
s_write_mbs(scr, clr_eos);
|
||||||
has_cleared_screen = true;
|
has_cleared_screen = true;
|
||||||
}
|
}
|
||||||
if (done)
|
if (done) break;
|
||||||
break;
|
|
||||||
|
|
||||||
perform_any_impending_soft_wrap(scr, current_width, (int)i);
|
perform_any_impending_soft_wrap(scr, current_width, (int)i);
|
||||||
s_move(scr, current_width, (int)i);
|
s_move(scr, current_width, (int)i);
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <cwchar>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <cwchar>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
|
@ -24,14 +24,15 @@
|
||||||
|
|
||||||
// This version has been altered and ported to C++ for inclusion in fish.
|
// This version has been altered and ported to C++ for inclusion in fish.
|
||||||
#include "tinyexpr.h"
|
#include "tinyexpr.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
@ -263,7 +264,7 @@ void next_token(state *s) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Look for an operator or special character. */
|
/* Look for an operator or special character. */
|
||||||
switch (s->next++ [0]) {
|
switch (s->next++[0]) {
|
||||||
// The "te_fun2" casts are necessary to pick the right overload.
|
// The "te_fun2" casts are necessary to pick the right overload.
|
||||||
case '+':
|
case '+':
|
||||||
s->type = TOK_INFIX;
|
s->type = TOK_INFIX;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue