mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
docs: list reserved keywords
This commit is contained in:
parent
0bc524340c
commit
0431f21bb2
2 changed files with 3 additions and 0 deletions
|
@ -68,6 +68,8 @@ By using one of the event handler switches, a function can be made to run automa
|
|||
|
||||
- ``fish_cancel``, which is emitted when a commandline is cleared (used for terminal-shell integration).
|
||||
|
||||
Functions may not be named the same as a reserved keyword. These are elements of fish syntax or builtin commands which are essential for the operations of the shell. Current reserved words are ``[``, ``_``, ``and``, ``argparse``, ``begin``, ``break``, ``builtin``, ``case``, ``command``, ``continue``, ``else``, ``end``, ``eval``, ``exec``, ``for``, ``function``, ``if``, ``not``, ``or``, ``read``, ``return``, ``set``, ``status``, ``string``, ``switch``, ``test``, ``time``, and ``while``.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ static const wcstring subcommand_keywords[]{L"command", L"builtin", L"while", L"
|
|||
static const string_set_t block_keywords = {L"for", L"while", L"if",
|
||||
L"function", L"switch", L"begin"};
|
||||
|
||||
// Don't forget to add any new reserved keywords to the documentation
|
||||
static const wcstring reserved_keywords[] = {
|
||||
L"end", L"case", L"else", L"return", L"continue", L"break", L"argparse", L"read",
|
||||
L"string", L"set", L"status", L"test", L"[", L"_", L"eval"};
|
||||
|
|
Loading…
Reference in a new issue