summaryrefslogtreecommitdiffstats
path: root/parsing/parse.sh
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/parse.sh')
-rw-r--r--parsing/parse.sh21
1 files changed, 18 insertions, 3 deletions
diff --git a/parsing/parse.sh b/parsing/parse.sh
index b39d84e..ff6b5ad 100644
--- a/parsing/parse.sh
+++ b/parsing/parse.sh
@@ -26,6 +26,7 @@ complete_command()
list()
{
+ dbg 'list()'
if and_or; then
while separator_op; do
if ! and_or; then
@@ -38,6 +39,7 @@ list()
}
and_or()
{
+ dbg 'and_or()'
if pipeline; then
while accept T_AND_IF || accept T_OR_IF; do
if ! linebreak || ! pipeline; then
@@ -50,6 +52,7 @@ and_or()
}
pipeline()
{
+ dbg 'pipeline()'
accept T_BANG
if pipe_sequence; then
return 0
@@ -59,6 +62,7 @@ pipeline()
pipe_sequence()
{
+ dbg 'pipe_sequence()'
if command; then
while accept T_PIPE; do
if ! linebreak || ! command; then
@@ -72,6 +76,7 @@ pipe_sequence()
command()
{
+ dbg 'command()'
if compound_command; then
redirect_list
return 0
@@ -85,6 +90,7 @@ command()
compound_command()
{
+ dbg 'compound_command()'
if brace_group; then
return 0
elif subshell; then
@@ -105,6 +111,7 @@ compound_command()
subshell()
{
+ dbg 'subshell()'
if accept T_LPAREN && compound_list && expect T_RPAREN; then
return 0
fi
@@ -113,8 +120,10 @@ subshell()
compound_list()
{
+ dbg 'compound_list()'
newline_list
if term; then
+ dbg FOUND TERM
separator
return 0
fi
@@ -123,11 +132,10 @@ compound_list()
term()
{
+ dbg 'term()'
if and_or; then
while separator; do
- if ! and_or; then
- return 1
- fi
+ and_or
done
return 0
fi
@@ -155,6 +163,7 @@ for_clause()
wordlist()
{
+ dbg 'wordlist()'
if accept T_WORD; then
while accept T_WORD; do :; done
return 0
@@ -236,6 +245,7 @@ function_body()
brace_group()
{
+ dbg 'brace_group()'
if accept T_LBRACE && compound_list && expect T_RBRACE; then
return 0
fi
@@ -244,6 +254,7 @@ brace_group()
do_group()
{
+ dbg 'do_group()'
if accept T_DO && compound_list && expect T_DONE; then
return 0
fi
@@ -252,6 +263,7 @@ do_group()
simple_command()
{
+ dbg 'simple_command()'
if cmd_prefix; then
if cmd_word; then
cmd_suffix
@@ -266,6 +278,7 @@ simple_command()
cmd_name()
{
+ dbg 'cmd_name()'
# TODO: Assignment
if accept T_WORD; then
return 0
@@ -275,6 +288,7 @@ cmd_name()
cmd_word()
{
+ dbg 'cmd_word()'
# TODO: Assignment
if accept T_WORD; then
return 0
@@ -367,6 +381,7 @@ separator()
sequential_sep()
{
+ dbg 'sequential_sep()'
if accept T_SEMI; then
if linebreak; then
return 0