all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Glyph <glyph@twistedmatrix.com>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 21840@debbugs.gnu.org
Subject: bug#21840: 24.5; semantic analysis of python files is broken by strings that end in backslash
Date: Thu, 3 Dec 2020 10:48:50 -0800	[thread overview]
Message-ID: <F14250C1-2503-4022-9D9B-911D9EC0F5BA@twistedmatrix.com> (raw)
In-Reply-To: <875z5jupzl.fsf@gnus.org>

I don't know how to force semantic to fully reparse a file, I just observe its behavior in response to idle times.

Here's a test file you can use though, if you know how to do that:


def a(v):
    "test"

def x():
    "test"
    a(b"\\")

def y():
    "test"

def z():
    "test"


Comment and uncomment the 'a(b"\\")' line and let semantic get around to reparsing the buffer, however it decides to do that, and (mapcar 'car (semantic-fetch-tags)) will  return ("a" "x") rather than the expected ("a" "x" "y" "z").  However, it seems like there's tons of cache state somewhere that I can't easily clear out because it randomly seems to fluctuate between doing what I expect, returning "nil", and returning a stale copy of the symbols (including stuff added and then removed entirely from the bottom of the buffer).

Sadly, given that I don't use semantic any more (specifically because of this type of inscrutable unreliability) I don't have any more time for debugging this.  Thanks for following up and good luck!

-g

> On Dec 3, 2020, at 2:46 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> 
> Glyph Lefkowitz <glyph@twistedmatrix.com> writes:
> 
>> Python string literals that end in a backslash cause Semantic's parser
>> to halt and not recognize anything further in the buffer.  I personally
>> ran across this because I frequently use helm-semantic-or-imenu, but can
>> be demonstrated equally well by semantic-complete-jump-local or anything
>> else that makes use of the buffer's symbol list.
>> 
>> The trivial way to reproduce this is to put the string literal "\\" at
>> the top of a Python buffer and then invoke semantic in one of the ways
>> just mentioned and notice that nothing is picked up.  You can move the
>> backslash literal down in the file and see every symbol up to the point
>> where it is placed.
> 
> (This bug report unfortunately got no response at the time.)
> 
> Do you have a step-by-step recipe to reproduce this bug, starting from
> "emacs -Q"?
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no






  reply	other threads:[~2020-12-03 18:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  2:16 bug#21840: 24.5; semantic analysis of python files is broken by strings that end in backslash Glyph Lefkowitz
2020-12-03 10:46 ` Lars Ingebrigtsen
2020-12-03 18:48   ` Glyph [this message]
2020-12-04  9:54     ` Lars Ingebrigtsen

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=F14250C1-2503-4022-9D9B-911D9EC0F5BA@twistedmatrix.com \
    --to=glyph@twistedmatrix.com \
    --cc=21840@debbugs.gnu.org \
    --cc=larsi@gnus.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.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.