public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <dje@transmeta.com>
To: "Nick Kelsey" <nickk@ubicom.com>
Cc: <binutils@sources.redhat.com>, cgen@sources.redhat.com
Subject: patch - fix false keyword triggering in gas with cgen targets
Date: Wed, 18 Dec 2002 12:47:00 -0000	[thread overview]
Message-ID: <15872.57031.583198.497704@casey.transmeta.com> (raw)
In-Reply-To: <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp>

Nick Kelsey writes:
 > Hi all,
 > 
 > Attached is patch to fix flase keyword triggering in gas with symbols such
 > as <register name>_foo.

An equivalent solution is to move the '_' to desc.scm and either
make it a default nonalpha_char or hardcode it as always being
a nonalpha_char.

However, I like changing cgen-asm.c better. '_' is typically a
legit symbol char so better to bubble it up to the top and treat
it like alnum's.
I'm assuming of course this doesn't break existing ports.
Given that the '_' was there for a long time I think it is
a safe assumption, but still an assumption nonetheless.

If down the road we ever have to revisit this decision we
can move '_' to desc.scm and make it the default.

---
Nit though.  GNU coding standard say the || goes at the beginning
of the next line.  The way I remember this is that English reads as

"if foo, or bar, or baz"

not

"if foo or, bar or, baz"

*** cgen-asm.c	26 Nov 2002 18:12:48 -0000
--- cgen-asm.c	18 Dec 2002 02:16:00 -0000
*************** cgen_parse_keyword (cd, strp, keyword_ta
*** 225,231 ****
    /* Allow letters, digits, and any special characters.  */
    while (((p - start) < (int) sizeof (buf))
  	 && *p
! 	 && (ISALNUM (*p) || strchr (keyword_table->nonalpha_chars, *p)))
      ++p;
  
    if (p - start >= (int) sizeof (buf))
--- 225,233 ----
    /* Allow letters, digits, and any special characters.  */
    while (((p - start) < (int) sizeof (buf))
  	 && *p
! 	 && (ISALNUM (*p) ||
! 	     strchr (keyword_table->nonalpha_chars, *p) ||
! 	     *p == '_'))
      ++p;
  
    if (p - start >= (int) sizeof (buf))

           reply	other threads:[~2002-12-18 20:47 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <0eee01c2a6cc$0d5d4230$f601a8c0@nkelseyxp>]

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=15872.57031.583198.497704@casey.transmeta.com \
    --to=dje@transmeta.com \
    --cc=binutils@sources.redhat.com \
    --cc=cgen@sources.redhat.com \
    --cc=nickk@ubicom.com \
    /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).