summaryrefslogtreecommitdiff
path: root/devdocs/elisp/low_002dlevel-parsing.html
diff options
context:
space:
mode:
Diffstat (limited to 'devdocs/elisp/low_002dlevel-parsing.html')
-rw-r--r--devdocs/elisp/low_002dlevel-parsing.html10
1 files changed, 10 insertions, 0 deletions
diff --git a/devdocs/elisp/low_002dlevel-parsing.html b/devdocs/elisp/low_002dlevel-parsing.html
new file mode 100644
index 00000000..af6098ff
--- /dev/null
+++ b/devdocs/elisp/low_002dlevel-parsing.html
@@ -0,0 +1,10 @@
+ <h4 class="subsection">Low-Level Parsing</h4> <p>The most basic way to use the expression parser is to tell it to start at a given position with a certain state, and parse up to a specified end position. </p> <dl> <dt id="parse-partial-sexp">Function: <strong>parse-partial-sexp</strong> <em>start limit &amp;optional target-depth stop-before state stop-comment</em>
+</dt> <dd>
+<p>This function parses a sexp in the current buffer starting at <var>start</var>, not scanning past <var>limit</var>. It stops at position <var>limit</var> or when certain criteria described below are met, and sets point to the location where parsing stops. It returns a parser state describing the status of the parse at the point where it stops. </p> <p>If the third argument <var>target-depth</var> is non-<code>nil</code>, parsing stops if the depth in parentheses becomes equal to <var>target-depth</var>. The depth starts at 0, or at whatever is given in <var>state</var>. </p> <p>If the fourth argument <var>stop-before</var> is non-<code>nil</code>, parsing stops when it comes to any character that starts a sexp. If <var>stop-comment</var> is non-<code>nil</code>, parsing stops after the start of an unnested comment. If <var>stop-comment</var> is the symbol <code>syntax-table</code>, parsing stops after the start of an unnested comment or a string, or after the end of an unnested comment or a string, whichever comes first. </p> <p>If <var>state</var> is <code>nil</code>, <var>start</var> is assumed to be at the top level of parenthesis structure, such as the beginning of a function definition. Alternatively, you might wish to resume parsing in the middle of the structure. To do this, you must provide a <var>state</var> argument that describes the initial status of parsing. The value returned by a previous call to <code>parse-partial-sexp</code> will do nicely. </p>
+</dd>
+</dl><div class="_attribution">
+ <p class="_attribution-p">
+ Copyright &copy; 1990-1996, 1998-2022 Free Software Foundation, Inc. <br>Licensed under the GNU GPL license.<br>
+ <a href="https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Parsing.html" class="_attribution-link">https://www.gnu.org/software/emacs/manual/html_node/elisp/Low_002dLevel-Parsing.html</a>
+ </p>
+</div>