unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: mvar <mvar.40k@gmail.com>
To: 44465@debbugs.gnu.org
Cc: mvar <mvar.40k@gmail.com>, monnier@iro.umontreal.ca
Subject: bug#44465: 28.0.50; tcl-mode mismatched parenthesis for nested [strings]
Date: Sun, 15 Aug 2021 01:22:50 +0300	[thread overview]
Message-ID: <87zgtjwts5.fsf@cnu407c2zx.nsn-intra.net> (raw)
In-Reply-To: <87eel8asmr.fsf@cnu407c2zx.nsn-intra.net> (mvar's message of "Thu, 05 Nov 2020 14:35:24 +0200")

mvar <mvar.40k@gmail.com> writes:

> After the applied fix in #39277, font locking fails in the following case:
>
> set a "Testing: [split "192.168.1.1/24" "/"] address"
>
> the last bracket ] reports "no matching parenthesis found"
>
> this part:
>
> 192.168.1.1/24"
>
> is not locked as a string, but "/" is.
>
> Note that the whole argument is evaluated properly by tclsh as a
> single contiguous string:
>
> % set a "Testing: [split "192.168.1.1/24" "/"] address"
> Testing: 192.168.1.1 24 address
>
> i can't find a way around this behavior even with escaping the double
> quotes or using single quotes, because doing that will change how the
> argument is evaluated by tcl (array instead of string):
>
> % set b "Testing: [split '192.168.1.1/24' '/'] address"
> Testing: {} 192.168.1.1 24 {} address
> % set a "Testing: [split \"192.168.1.1/24\" \"/\"] address"
> Testing: {} 192.168.1.1 24 {} address
> %
>


i've been trying every once in a while to figure out a solution to this
bug but keep failing.

@Stefan i've added you to cc: in case you can help a bit and provide
some tips.
In the fix for #39277 you've added tcl--syntax-of-quote and also this comment:

(defconst tcl-syntax-propertize-function
  ;; FIXME: Handle the [...] commands nested inside "..." strings.

so my question, is the problem described in this bug report supposed to be fixed as
a regexp in the tcl-syntax-propertize-function rules list or should i try
to extend tcl--syntax-of-quote to cover this case too? I've failed in
both accounts so far, especially the regexp i can't find the proper
pattern to fix this and not break something else (which kind of proves the
saying "you fix 1 problem with regexp - you now have 2 problems" :)

thank you in advance,
Michalis





  parent reply	other threads:[~2021-08-14 22:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-05 12:35 bug#44465: 28.0.50; tcl-mode mismatched parenthesis for nested [strings] mvar
2021-01-22 19:25 ` bug#44465: Still open after applying fix for #44834 and #44083 Anticrisis
2021-08-14 22:22 ` mvar [this message]
2021-08-14 23:51   ` bug#44465: 28.0.50; tcl-mode mismatched parenthesis for nested [strings] Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87zgtjwts5.fsf@cnu407c2zx.nsn-intra.net \
    --to=mvar.40k@gmail.com \
    --cc=44465@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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).