summaryrefslogtreecommitdiff
path: root/lib/libedit/parse.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2003-12-05 13:37:48 +0000
committerlukem <lukem@NetBSD.org>2003-12-05 13:37:48 +0000
commita9beb0e4439ae031de723787f27a4eb4e6d7a4d7 (patch)
tree46626ac02ffc2f7667626ddc1ebe644f9222bc30 /lib/libedit/parse.c
parent3b1892c380180d77479fa1aa2fce3d0f22ef17c5 (diff)
Tokenization function enhancements:
* Make tok_init(), tok_end(), tok_reset(), tok_line() and tok_str() publically available in <histedit.h> * Documented the public functions in editline(3) * Renamed tok_line() -> tok_str() * Added new tok_line() which takes a "const LineInfo *" instead of "const char *" (the former has "cursor" information), and optionally return the argv index ("int *cursorc") and offset within that index ("int *cursorv"). This means that completion routines can use the tokenization code to crack the line and easily find which word the cursor is at. (mmm, context sensitive completion :) * Fixed TEST/test.c when using "continuation" lines (unmatched quote or \ at EOL), and added some more DEBUG messages including highlighting where the cursor is (with a `_').
Diffstat (limited to 'lib/libedit/parse.c')
-rw-r--r--lib/libedit/parse.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c
index e7a36b300bf..de02fc611b6 100644
--- a/lib/libedit/parse.c
+++ b/lib/libedit/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.19 2003/11/02 20:06:57 christos Exp $ */
+/* $NetBSD: parse.c,v 1.20 2003/12/05 13:37:48 lukem Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: parse.c,v 1.19 2003/11/02 20:06:57 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.20 2003/12/05 13:37:48 lukem Exp $");
#endif
#endif /* not lint && not SCCSID */
@@ -55,7 +55,6 @@ __RCSID("$NetBSD: parse.c,v 1.19 2003/11/02 20:06:57 christos Exp $");
* setty
*/
#include "el.h"
-#include "tokenizer.h"
#include <stdlib.h>
private const struct {
@@ -84,7 +83,7 @@ parse_line(EditLine *el, const char *line)
Tokenizer *tok;
tok = tok_init(NULL);
- tok_line(tok, line, &argc, &argv);
+ tok_str(tok, line, &argc, &argv);
argc = el_parse(el, argc, argv);
tok_end(tok);
return (argc);