Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #40069] [PGE] "value" can't be used as a rule name.

8 views
Skip to first unread message

Ambs @ Cpan . Org

unread,
Aug 4, 2006, 4:50:19 AM8/4/06
to bugs-bi...@rt.perl.org
# New Ticket Created by am...@cpan.org
# Please include the string: [perl #40069]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40069 >


---
osname= linux
osvers= 2.4.26
arch= i486-linux
cc= cc
---
Flags:
category=core
severity=high
ack=no
---

If we define a rule or token named 'value', things do not work. The PGE
compiler works, but then the grammar does not run.

Probably this happens with other names as well. This should not happen.

---
Summary of my parrot 0.4.5 (r13753) configuration:
configdate='Thu Aug 3 19:31:53 2006'
Platform:
osname=linux, archname=i486-linux
jitcapable=1, jitarchname=i386-linux,
jitosname=LINUX, jitcpuarch=i386
execcapable=1
perl=/usr/bin/perl5.8.5
Compiler:
cc='cc', ccflags=' -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I /usr/local//include',
Linker and Libraries:
ld='cc', ldflags=' -L/usr/local/lib',
cc_ldflags='',
libs='-lnsl -ldl -lm -lcrypt -lutil -lpthread -lrt -lgmp'
Dynamic Linking:
share_ext='.so', ld_share_flags='-shared -L/usr/local/lib -fPIC',
load_ext='.so', ld_load_flags='-shared -L/usr/local/lib -fPIC'
Types:
iv=long, intvalsize=4, intsize=4, opcode_t=long, opcode_t_size=4,
ptrsize=4, ptr_alignment=1 byteorder=1234,
nv=double, numvalsize=8, doublesize=8

---
Environment:
HOME LANG LANGUAGE LC_ALL LC_COLLATE LD_LIBRARY_PATH LOGDIR PATH PERL5_CPANPLUS_CONFIG SHELL

Patrick R. Michaud

unread,
Aug 4, 2006, 1:14:38 PM8/4/06
to perl6-i...@perl.org
On Fri, Aug 04, 2006 at 01:50:19AM -0700, ambs @ cpan. org wrote:
> # New Ticket Created by am...@cpan.org
> # Please include the string: [perl #40069]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=40069 >
>
> If we define a rule or token named 'value', things do not work. The PGE
> compiler works, but then the grammar does not run.
>
> Probably this happens with other names as well. This should not happen.

I know what's happening, but I'm not sure how to work around it.
Perhaps MMD would resolve the problem.

The problem: Match objects have methods defined on them such as
.from(), .to(), and .value(). As a result, defining a subrule
named 'value' in a grammar is probably overriding the method of the
same name defined for Match objects.

The quick conclusion is that at the moment it's difficult to have
rules named 'value', 'from', 'to', or any of the other predefined
methods on Match objects.

However, I wonder if MMD can resolve this, because then the compiler
would presumably dispatch to the correct method based on the argument
types.

At any rate, this is definitely something we should address; it's
likely to wait for some other refactors to take place.

Thanks!

Pm

0 new messages