aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_tree.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-28 14:39:47 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-03-28 14:39:47 -0700
commit005edf71a8ed3493b9fbbc1de81d10ed73cdca79 (patch)
treeb81dcea4f872272657ec81f662d6eb34394d0c3d /parse_tree.h
parentc1f64ba017b3294820ed5381cfd7a6e36501dcc8 (diff)
Fix initially backgrounded jobs. Fixes #1373
Diffstat (limited to 'parse_tree.h')
-rw-r--r--parse_tree.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/parse_tree.h b/parse_tree.h
index f9f27beb..c0e24a5c 100644
--- a/parse_tree.h
+++ b/parse_tree.h
@@ -184,6 +184,9 @@ public:
/* Given a job, return all of its statements. These are 'specific statements' (e.g. symbol_decorated_statement, not symbol_statement) */
parse_node_list_t specific_statements_for_job(const parse_node_t &job) const;
+
+ /* Given a job, return whether it should be backgrounded, because it has a & specifier */
+ bool job_should_be_backgrounded(const parse_node_t &job) const;
};
@@ -198,9 +201,9 @@ bool parse_tree_from_string(const wcstring &str, parse_tree_flags_t flags, parse
job job_list
<TOK_END> job_list
-# A job is a non-empty list of statements, separated by pipes. (Non-empty is useful for cases like if statements, where we require a command). To represent "non-empty", we require a statement, followed by a possibly empty job_continuation
+# A job is a non-empty list of statements, separated by pipes. (Non-empty is useful for cases like if statements, where we require a command). To represent "non-empty", we require a statement, followed by a possibly empty job_continuation, and then optionally a background specifier '&'
- job = statement job_continuation
+ job = statement job_continuation optional_background
job_continuation = <empty> |
<TOK_PIPE> statement job_continuation
@@ -240,7 +243,7 @@ bool parse_tree_from_string(const wcstring &str, parse_tree_flags_t flags, parse
# A decorated_statement is a command with a list of arguments_or_redirections, possibly with "builtin" or "command" or "exec"
decorated_statement = plain_statement | COMMAND plain_statement | BUILTIN plain_statement | EXEC plain_statement
- plain_statement = <TOK_STRING> arguments_or_redirections_list optional_background
+ plain_statement = <TOK_STRING> arguments_or_redirections_list
argument_list = <empty> | argument argument_list
@@ -255,7 +258,7 @@ bool parse_tree_from_string(const wcstring &str, parse_tree_flags_t flags, parse
end_command = END
- # A freestanding_argument_list is equivalent to a normal argument list, except it may contain TOK_END (newlines, and even semicolons, for historical reasons:
+ # A freestanding_argument_list is equivalent to a normal argument list, except it may contain TOK_END (newlines, and even semicolons, for historical reasons
freestanding_argument_list = <empty> |
argument freestanding_argument_list |