Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl: Incorrectly sees << inside a string as start of a heredoc #3588

Closed
petdance opened this issue Dec 8, 2022 · 4 comments · Fixed by #3592
Closed

Perl: Incorrectly sees << inside a string as start of a heredoc #3588

petdance opened this issue Dec 8, 2022 · 4 comments · Fixed by #3592
Assignees

Comments

@petdance
Copy link

petdance commented Dec 8, 2022

The name of the parser:

Perl

The command line you used to run ctags:

ctags --options=NONE -f - foo.pl

The content of input file:

sub foo() {}

my $x = '<<NOT_A_HEREDOC';

sub bar() {}

sub bat() {}

The tags output you are not satisfied with:

ctags: Notice: No options will be read from files or environment
foo	foo.pl	/^sub foo() {}$/;"	s

The tags output you expect:

bar and bat should be output as well. If the line with my $x is removed, or the << is removed, then ctags puts them out.

The version of ctags:

$ ctags --version
Universal Ctags 5.9.0(50ab7a7), Copyright (C) 2015-2022 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Dec  7 2022, 21:48:15
  URL: https://ctags.io/
  Optional compiled features: +wildcards, +regex, +gnulib_regex, +iconv, +option-directory, +xpath, +packcc, +optscript

How do you get ctags binary:

Built locally from master in GitHub repo.

@masatake masatake self-assigned this Dec 8, 2022
@masatake
Copy link
Member

masatake commented Dec 9, 2022

Thank you. Reproduced.

@petdance
Copy link
Author

petdance commented Dec 9, 2022

Thanks. Let me know what I can do to help. I poked at parser/perl.c but didn't see anything obvious to do to address it. I don't know the internals at all.

masatake added a commit to masatake/ctags that referenced this issue Dec 10, 2022
Close universal-ctags#3588.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
masatake added a commit to masatake/ctags that referenced this issue Dec 11, 2022
Close universal-ctags#3588.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
masatake added a commit to masatake/ctags that referenced this issue Dec 27, 2022
Close universal-ctags#3588.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
@masatake
Copy link
Member

I took much time to find ways to distinguish heredoc starters and shift operators.
@petdance, could you try the latest code?
It may work well with '<<' other than << in qw/...<< /.

@petdance
Copy link
Author

petdance commented Jan 29, 2023

Seems to work fine for me. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants