summaryrefslogtreecommitdiffstats
path: root/parsing/parse.sh
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/parse.sh')
-rw-r--r--parsing/parse.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/parsing/parse.sh b/parsing/parse.sh
index 8168c48..faf4637 100644
--- a/parsing/parse.sh
+++ b/parsing/parse.sh
@@ -580,12 +580,13 @@ sequential_sep()
return 1
}
-parse()
+parse_sub()
{
local fn="${1}"
- shift 1
+ local ln="${2}"
+ shift 2
- init_lexer "${fn}"
+ init_lexer "${fn}" ${ln}
# If this returns (does not exit), there are no errors.
complete_command
@@ -598,6 +599,17 @@ parse()
return 0
}
+parse()
+{
+ local fn="${1}"
+ shift 1
+
+ if parse_sub "${fn}" 1; then
+ return 0
+ fi
+ return 1
+}
+
try()
{
local tokens=
@@ -638,6 +650,8 @@ try()
#try 'if ; then ; fi'
#try 'while foo; do bar; done'
#try 'while ; do ; done'
-try 'foo(){ bar; }'
+#try 'foo(){ bar; }'
#try 'case foo in bar) baz;; (qux) quux;; quux);; esac'
#try 'foo bar ( baz )'
+try 'foo $(bar)'
+#try 'foo $((1 + 1))'