aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/parser_keywords.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-07-24 00:50:58 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2015-07-24 00:59:27 -0700
commitb4f53143b0e05fd3061cdf2e65e17a6a2904090b (patch)
tree4785bf31f7b89fc2420aa740d9a6967dc6c6f9b1 /src/parser_keywords.h
parent9c2fdc6da57032c4448b59de5872086eea626b74 (diff)
Migrate source files into src/ directory
This change moves source files into a src/ directory, and puts object files into an obj/ directory. The Makefile and xcode project are updated accordingly. Fixes #1866
Diffstat (limited to 'src/parser_keywords.h')
-rw-r--r--src/parser_keywords.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/parser_keywords.h b/src/parser_keywords.h
new file mode 100644
index 00000000..6794b294
--- /dev/null
+++ b/src/parser_keywords.h
@@ -0,0 +1,43 @@
+/** \file parser_keywords.h
+
+Functions having to do with parser keywords, like testing if a function is a block command.
+*/
+
+#ifndef FISH_PARSER_KEYWORD_H
+#define FISH_PARSER_KEYWORD_H
+
+/**
+ Tests if the specified commands parameters should be interpreted as another command, which will be true if the command is either 'command', 'exec', 'if', 'while', or 'builtin'. This does not handle "else if" which is more complicated.
+
+ \param cmd The command name to test
+ \return 1 of the command parameter is a command, 0 otherwise
+*/
+
+bool parser_keywords_is_subcommand(const wcstring &cmd);
+
+/**
+ Tests if the specified command is a reserved word, i.e. if it is
+ the name of one of the builtin functions that change the block or
+ command scope, like 'for', 'end' or 'command' or 'exec'. These
+ functions may not be overloaded, so their names are reserved.
+
+ \param word The command name to test
+ \return 1 of the command parameter is a command, 0 otherwise
+*/
+bool parser_keywords_is_reserved(const wcstring &word);
+
+/**
+ Test if the specified string is command that opens a new block
+*/
+
+bool parser_keywords_is_block(const wcstring &word);
+
+/**
+ Check if the specified command is one of the builtins that cannot
+ have arguments, any followin argument is interpreted as a new
+ command
+*/
+bool parser_keywords_skip_arguments(const wcstring &cmd);
+
+
+#endif