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

expression "... unless $condition" is broken in 5.28+ #16840

Open
p5pRT opened this issue Feb 5, 2019 · 3 comments
Open

expression "... unless $condition" is broken in 5.28+ #16840

p5pRT opened this issue Feb 5, 2019 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Feb 5, 2019

Migrated from rt.perl.org#133825 (status was 'open')

Searchable as RT133825$

@p5pRT
Copy link
Author

p5pRT commented Feb 5, 2019

From the.dmol@yandex.by

Created by the.dmol@yandex.by

This is a bug report for perl from the.dmol@​yandex.by,
generated with the help of perlbug 1.41 running under perl 5.28.0.

-----------------------------------------------------------------

The script​:

my $x = 11;
... unless $x;

Leads to error​: syntax error at /tmp/1.pl line 3, near "... unless"

In the community it is said that it works fine with perl 5.26,
5.18; however it has the same failure on perl 5.19.2.

Perl Info

Flags:
    category=core
    severity=medium

Site configuration information for perl 5.28.0:

Configured by b at Wed Nov 21 19:06:02 +03 2018.

Summary of my perl5 (revision 5 version 28 subversion 0) configuration:
   
  Platform:
    osname=linux
    osvers=4.18.19_1
    archname=x86_64-linux
    uname='linux localhost 4.18.19_1 #1 smp preempt wed nov 14 23:03:54 utc 2018 x86_64 gnulinux '
    config_args='-de -Dprefix=/home/b/perl5/perlbrew/perls/perl-5.28.0 -Aeval:scriptdir=/home/b/perl5/perlbrew/perls/perl-5.28.0/bin'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=undef
    usemultiplicity=undef
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='cc'
    ccflags ='-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2'
    optimize='-O2'
    cppflags='-fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    ccversion=''
    gccversion='4.2.1 Compatible Clang 6.0.1 (tags/RELEASE_601/final)'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='cc'
    ldflags =' -fstack-protector-strong -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib/clang/6.0.1/lib /usr/lib /lib/../lib /usr/lib/../lib /lib /lib64 /usr/lib64
    libs=-lpthread -lnsl -ldb -ldl -lm -lcrypt -lutil -lc
    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
    libc=libc-2.28.so
    so=so
    useshrplib=false
    libperl=libperl.a
    gnulibc_version='2.28'
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Wl,-E'
    cccdlflags='-fPIC'
    lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector-strong'

Locally applied patches:
    Devel::PatchPerl 1.48


@INC for perl 5.28.0:
    /home/b/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0/x86_64-linux
    /home/b/perl5/perlbrew/perls/perl-5.28.0/lib/site_perl/5.28.0
    /home/b/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0/x86_64-linux
    /home/b/perl5/perlbrew/perls/perl-5.28.0/lib/5.28.0


Environment for perl 5.28.0:
    HOME=/home/b
    LANG=en_US.UTF-8
    LANGUAGE (unset)
    LC_COLLATE=C
    LC_CTYPE=en_US.UTF-8
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/home/b/development/cpp/mxe/usr/bin:/home/b/.luarocks/bin:/home/b/apps/lua-system/env/bin:/home/linuxbrew/.linuxbrew/bin:/home/b/perl5/perlbrew/bin:/home/b/perl5/perlbrew/perls/perl-5.28.0/bin:/home/linuxbrew/.linuxbrew/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin:/opt/texlive/2018/bin/x86_64-linux
    PERLBREW_HOME=/home/b/.perlbrew
    PERLBREW_MANPATH=/home/b/perl5/perlbrew/perls/perl-5.28.0/man
    PERLBREW_PATH=/home/b/perl5/perlbrew/bin:/home/b/perl5/perlbrew/perls/perl-5.28.0/bin
    PERLBREW_PERL=perl-5.28.0
    PERLBREW_ROOT=/home/b/perl5/perlbrew
    PERLBREW_SHELLRC_VERSION=0.84
    PERLBREW_VERSION=0.84
    PERL_BADLANG (unset)
    SHELL=/bin/zsh

@p5pRT
Copy link
Author

p5pRT commented Feb 5, 2019

From @jkeenan

On Tue, 05 Feb 2019 12​:32​:00 GMT, the.dmol@​yandex.by wrote​:

This is a bug report for perl from the.dmol@​yandex.by,
generated with the help of perlbug 1.41 running under perl 5.28.0.

-----------------------------------------------------------------

The script​:

my $x = 11;
... unless $x;

Leads to error​: syntax error at /tmp/1.pl line 3, near "... unless"

In the community it is said that it works fine with perl 5.26,
5.18; however it has the same failure on perl 5.19.2.

Bisection results​:

#####
29d69c3 is the first bad commit
commit 29d69c3
Author​: Zefram <zefram@​fysh.org>
Date​: Fri Nov 10 02​:07​:46 2017 +0000

parse yada-yada only as a statement

Commit f5727a1 tried to make yada-yada be parsed consistently as a term expression, but actually things are more complicated than that. The tokeniser didn't accept yada-yada in the right contexts to make it usable as an expression, and changing that would require decisions on resolving ambiguities between yada-yada and flip-flop. It's also documented as being a statement rather than an expression, though with some incorrect information about ambiguities.

Overall it looks more like the intent was for yada-yada to be a statement. This commit makes it grammatically treated as such, and also fixes up the dubious parts of the documentation. [perl #132150]

:100644 100644 bd778164b46127635824789e3342c6c0231bfec5 e5baa09042f1310c3387467d092d412f9fa5dd93 M perly.act
:100644 100644 121fa1d97884458ca77467331b8bfcd6f6810cb9 43b8885f13257de05810e9eac067b55090695cdc M perly.h
:100644 100644 796c9d790b1a1ec56afb92109a430bba219f6e62 bf47bc3815240bc7f22385a08dfabdd4c652ce0d M perly.tab
:100644 100644 56e34da7b4cc4cc9547afd541c297d4146e0f2c4 0a7c30c0421c0f3e9a531caf13c6115429e2a03f M perly.y
:040000 040000 e7c7155568b9ce588ebb1b3b3a953831c6453e06 e60b2f99b77d7136147d09ab52d477c61c18fc25 M pod
:040000 040000 1e7f43b0720982ee94673a2ce945b46d0945d0f4 d7d743638312e071fc6ea99049468da4879bcac7 M t
:100644 100644 79df0bcbc52f49f513786b013375684bd5bdff6f 18eda7a3c10a736670e269ad2481eec070d1d526 M toke.c

#####

Thank you very much.
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Feb 5, 2019

The RT System itself - Status changed from 'new' to 'open'

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

No branches or pull requests

2 participants