Hi again,
2012/8/11 Dirk Ullrich <
dirk.u...@gmail.com>:
here comes my next iteration for working on namespaced operators. I've
redone my last patch to generalize `maybeWithNS' the parsing of
namespaces. This has the following effects:
(1) `iName' can be now based on `maybeWithNS', too.
There is one difference to the previous `iName': identifiers with a
trailing `.' are not parsed as pure namespaces: e.g. "a.b." is parsed
as `NS (UN "b.") ["a"]' (instead of `NS (UN "") ["b", "a"]').
@Edwin: Is this a problem?
(If it is a problem for a call to `iName' where it is used to parse a
namespace, we could use `maybeWithNS' instead.)
(2) Operators with namespaces in function position are handled correctly.
(3) Operators with namespaces in infix position are not handled yet -
but we are closer. For instance
pOpInfix = maybeWithNS operator True []
would properly parse infix operators with optional namespace -- even
such funny nones like `ns...' - this would become `..' with namespace
`ns'. There is only one restriction to the namespace here: it cannot
contain two consecutive dots, i.e. something like `..'.
@Edwin, again: Is this a problem?
For implementing namespace support for infix operators imho one have
to use `maybeWithNS' in the `table' / `toTable' definition in
`Idris/Parser.hs'. I could try this when I am back from holiday in
about a week.
The patch appended is for current Git master (so, please, throw my
older patches with the same name away).
Dirk