Ticket #5555 (closed feature request: fixed)

Opened 20 months ago

Last modified 14 months ago

support qualified names for invoking a quasiquoter

Reported by: nfrisby Owned by: pcapriotti
Priority: normal Milestone: 7.6.1
Component: Compiler (Parser) Version: 7.0.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Consider

module M

import qualified A (qq)
import qualified B (qq)

In 7.0.3, the quasiquotation syntax [A.qq|...|] is rejected with parse error on input `A.qq'.

Because of the stage-restriction, the only option is to create an auxiliary module

module AB where

import qualified A; import qualified B

qqA = A.qq
qqB = B.qq

and import that into M. This is a pretty heavy-weight workaround.

Is there a reason qualified names are disallowed for invoking a quasiquoter?

Attachments

5555.patch Download (3.1 KB) - added by pcapriotti 14 months ago.
5555-test.patch Download (1.7 KB) - added by pcapriotti 14 months ago.

Change History

Changed 19 months ago by igloo

  • milestone set to 7.6.1

Changed 14 months ago by pcapriotti

  • owner set to pcapriotti
  • difficulty set to Unknown

Changed 14 months ago by pcapriotti

Changed 14 months ago by pcapriotti

Changed 14 months ago by pcapriotti

  • status changed from new to patch

The attached patch adds a "qualified quasi quote" token to the lexer, and the corresponding production to the parser.

Changed 14 months ago by p.capriotti@…

commit dc2f65f6e7c1763d848557708a980df35b755954

Author: Paolo Capriotti <p.capriotti@gmail.com>
Date:   Mon Apr 2 13:09:10 2012 +0100

    Support qualified identifiers in quasi-quotes (#5555).

 compiler/parser/Lexer.x     |   25 ++++++++++++++++++++++++-
 compiler/parser/Parser.y.pp |    5 +++++
 2 files changed, 29 insertions(+), 1 deletions(-)

Changed 14 months ago by pcapriotti

  • status changed from patch to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.