public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-keiths-linespec-rewrite: * linespec.c (is_closing_quote_enclosed): New function. (linespec_lexer_lex_string): Use is_closing_quote_enclosed. (linespec_lexer_lex_one): Likewise. (parse_linespec): Likewise.
@ 2012-03-27 3:20 kseitz
0 siblings, 0 replies; only message in thread
From: kseitz @ 2012-03-27 3:20 UTC (permalink / raw)
To: archer-commits
The branch, archer-keiths-linespec-rewrite has been updated
via 083cb9ba8a4745ea3495b68d3ca7a405e6420139 (commit)
from e35c7e8e719cdaf8771b9b03b06be508c35f9949 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit 083cb9ba8a4745ea3495b68d3ca7a405e6420139
Author: Keith Seitz <keiths@redhat.com>
Date: Mon Mar 26 20:19:03 2012 -0700
* linespec.c (is_closing_quote_enclosed): New function.
(linespec_lexer_lex_string): Use is_closing_quote_enclosed.
(linespec_lexer_lex_one): Likewise.
(parse_linespec): Likewise.
-----------------------------------------------------------------------
Summary of changes:
gdb/linespec.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
First 500 lines of diff:
diff --git a/gdb/linespec.c b/gdb/linespec.c
index 50cf2e0..fa90786 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -442,6 +442,17 @@ copy_token_string (linespec_token token)
return str;
}
+/* Does P represent the end of a quote-enclosed linespec? */
+
+static int
+is_closing_quote_enclosed (const char *p)
+{
+ if (strchr (linespec_quote_characters, *p))
+ ++p;
+ p = skip_spaces ((char *) p);
+ return (*p == '\0' || linespec_lexer_lex_keyword (p));
+}
+
/* Lex a string from the input in PARSER. */
static linespec_token
@@ -556,7 +567,7 @@ linespec_lexer_lex_string (linespec_parser *parser)
else if (parser->is_quote_enclosed
&& strchr (linespec_quote_characters,
PARSER_STREAM (parser)[0])
- && PARSER_STREAM (parser)[1] == '\0')
+ && is_closing_quote_enclosed (PARSER_STREAM (parser)))
{
LS_TOKEN_STOKEN (token).ptr = start;
LS_TOKEN_STOKEN (token).length = PARSER_STREAM (parser) - start;
@@ -619,7 +630,8 @@ linespec_lexer_lex_one (linespec_parser *parser)
case '\'': case '\"':
/* Special case: permit quote-enclosed linespecs. */
- if (parser->is_quote_enclosed && PARSER_STREAM (parser)[1] == '\0')
+ if (parser->is_quote_enclosed
+ && is_closing_quote_enclosed (PARSER_STREAM (parser)))
{
++(PARSER_STREAM (parser));
parser->lexer.current.type = LSTOKEN_EOI;
@@ -1883,7 +1895,7 @@ parse_linespec (linespec_parser *parser, char **argptr)
char *end;
end = skip_quote_char (*argptr + 1, **argptr);
- if (end != NULL && end[1] == '\0')
+ if (is_closing_quote_enclosed (end))
{
/* Here's the special case. Skip ARGPTR past the initial
quote. */
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-03-27 3:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-27 3:20 [SCM] archer-keiths-linespec-rewrite: * linespec.c (is_closing_quote_enclosed): New function. (linespec_lexer_lex_string): Use is_closing_quote_enclosed. (linespec_lexer_lex_one): Likewise. (parse_linespec): Likewise kseitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).