unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Ben Wong <bug-gnu-emacs+gnu.org@wongs.net>
Cc: 8632@debbugs.gnu.org
Subject: bug#8632: 23.2; shell-script[bash] doesn't handle bitshift $(( 1 << 16 ))
Date: Fri, 13 May 2011 16:12:54 -0300	[thread overview]
Message-ID: <jwvzkmq2zf1.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <7jmxiz1mlu.fsf@asome.wongs.net> (Ben Wong's message of "Fri, 06 May 2011 15:38:05 -0700")

> In shell-script mode (bash minor mode) Emacs 23.2 incorrectly parses the
> following line as a HERE DOCUMENT.

> 	echo $(( 1 << 16 ))

> It is confused because sh-font-lock-open-heredoc (in sh-script.el)
> does not know about bash's ARITHMETIC EXPANSION.

Indeed, thanks for spotting this.

> There should be a function, similar to sh-in-comment-or-string, which
> parses the script looking for arithmetic expansion.

I guess the way to do it would be to try to handle $(( as
a string-opener in sh-syntax-propertize-function and then write
code to jump to the matching )) to mark it as the string-closer.

Patch welcome,


        Stefan





  reply	other threads:[~2011-05-13 19:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06 22:38 bug#8632: 23.2; shell-script[bash] doesn't handle bitshift $(( 1 << 16 )) Ben Wong
2011-05-13 19:12 ` Stefan Monnier [this message]
2012-04-17 10:28   ` Vincent Lefevre

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvzkmq2zf1.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=8632@debbugs.gnu.org \
    --cc=bug-gnu-emacs+gnu.org@wongs.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).