summaryrefslogtreecommitdiffstats
path: root/parsing/parse.sh
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/parse.sh')
-rw-r--r--parsing/parse.sh18
1 files changed, 12 insertions, 6 deletions
diff --git a/parsing/parse.sh b/parsing/parse.sh
index faf4637..a28aad2 100644
--- a/parsing/parse.sh
+++ b/parsing/parse.sh
@@ -1,7 +1,9 @@
-HT="$(printf '\t.')"; HT="${HT%.}"
-LF="$(printf '\n.')"; LF="${LF%.}"
-RS="$(printf '\036.')"; RS="${RS%.}"
-US="$(printf '\037.')"; US="${US%.}"
+STX="$(printf '\002.')"; STX="${STX%.}"
+ETX="$(printf '\003.')"; ETX="${ETX%.}"
+ HT="$(printf '\t.')"; HT="${HT%.}"
+ LF="$(printf '\n.')"; LF="${LF%.}"
+ RS="$(printf '\036.')"; RS="${RS%.}"
+ US="$(printf '\037.')"; US="${US%.}"
dbg()
{
@@ -46,6 +48,7 @@ ptrace_fail()
. ./tokens.sh
. ./lexer.sh
+. ./codegen.sh
complete_command()
{
@@ -626,6 +629,9 @@ try()
;;
esac
done
+ printf 'Generated code:\n'
+ IFS="${LF}"
+ printf '\t%s\n' $(codegen "${tokens}")
unset IFS
else
printf 'FAIL\n'
@@ -634,7 +640,7 @@ try()
}
#try '"foo bar" && $baz || qux' '${quux%uux quuux'
-#try '"foo bar" && $baz || qux' '${quux%uux } quuux'
+try '"foo bar" && $baz || qux' '${quux%uux } quuux'
#try 'foo ${bar}'
#try 'foo ${#bar}'
#try 'foo ${bar#baz}'
@@ -653,5 +659,5 @@ try()
#try 'foo(){ bar; }'
#try 'case foo in bar) baz;; (qux) quux;; quux);; esac'
#try 'foo bar ( baz )'
-try 'foo $(bar)'
+#try 'foo $(bar)'
#try 'foo $((1 + 1))'