aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_util.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-08 18:41:35 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2013-10-08 18:41:35 -0700
commit54d7c29221e066ed4150e53f3bcca90013e5d795 (patch)
treed0e0a55e4565ed31b38ad53f80e1710e916e3e44 /parse_util.h
parent997e3e16dd01f90891ae961381cd559e92543a9e (diff)
Syntax highlighting for command substitutions
Diffstat (limited to 'parse_util.h')
-rw-r--r--parse_util.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/parse_util.h b/parse_util.h
index 24147e18..76b33450 100644
--- a/parse_util.h
+++ b/parse_util.h
@@ -28,6 +28,25 @@ int parse_util_locate_cmdsubst(const wchar_t *in,
bool accept_incomplete);
/**
+ Alternative API. Iterate over command substitutions.
+
+ \param str the string to search for subshells
+ \param inout_cursor_offset On input, the location to begin the search. On output, either the end of the string, or just after the closed-paren.
+ \param out_contents On output, the contents of the command substitution
+ \param out_start On output, the offset of the start of the command substitution (open paren)
+ \param out_end On output, the offset of the end of the command substitution (close paren), or the end of the string if it was incomplete
+ \param accept_incomplete whether to permit missing closing parenthesis
+ \return -1 on syntax error, 0 if no subshells exist and 1 on sucess
+*/
+
+int parse_util_locate_cmdsubst_range(const wcstring &str,
+ size_t *inout_cursor_offset,
+ wcstring *out_contents,
+ size_t *out_start,
+ size_t *out_end,
+ bool accept_incomplete);
+
+/**
Find the beginning and end of the command substitution under the
cursor. If no subshell is found, the entire string is returned. If
the current command substitution is not ended, i.e. the closing