Ticket #466 (closed bug: wontfix)

Opened 13 years ago

Last modified 11 years ago

PAST::Val.new( :value( ~$/ ), :returns('Complex')) generates incorrect pir

Reported by: bsdz Owned by: pmichaud
Priority: major Milestone:
Component: PCT Version: trunk
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

When trying to assigned capture string to a Complex type the generated PIR does not quote the string token so one ends up with something like: -

    new $P14, "Complex"
    assign $P14, 10i

When you really want: -

    assign $P14, "10j"

This can be fixed by adding the a valflag option in src/PAST/Compiler.pir similar to String's settings.

valflagsComplex? = 's~*:e'

However, this might break some future intended usage.

It would be something useful to control from NQP.

Attachments

PAST-Compiler.patch Download (496 bytes) - added by bsdz 13 years ago.
Patch file
pct-complex.patch Download (1.5 KB) - added by bsdz 13 years ago.
New patch with test case included for PCT PAST compiler.

Change History

Changed 13 years ago by bsdz

Patch file

Changed 13 years ago by bsdz

New patch with test case included for PCT PAST compiler.

Changed 13 years ago by bsdz

Added new patch that also includes a test case to prove correct behavior.

Changed 12 years ago by jkeenan

pmichaud,

Can you provide any update on the issues in this ticket?

Thank you very much.
kid51

Changed 11 years ago by pmichaud

  • status changed from new to closed
  • resolution set to wontfix

PAST really wants to keep the number of types it supports to a minimum, thus it only offers encodings for String, Integer, and Float. It expects HLLs to make any additional %valflags entries for other types as they are needed. (This interface will likely change in future versions of PAST.)

Marking ticket as 'wontfix'.

Pm

Note: See TracTickets for help on using tickets.