public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: kseitz@sourceware.org
To: archer-commits@sourceware.org
Subject: [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.
Date: Tue, 27 Mar 2012 03:20:00 -0000	[thread overview]
Message-ID: <20120327032013.26497.qmail@sourceware.org> (raw)

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.


                 reply	other threads:[~2012-03-27  3:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120327032013.26497.qmail@sourceware.org \
    --to=kseitz@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).