www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Pegged suggestion to prevent collisions

reply Basile B. <b2.temp gmx.com> writes:
I'm sorry to post this here but currently I cannot create an 
account to open an issue on Github.

Today I encountered an issue after writing a peg that contains a 
rule named "Tuple".
Currently you cannot have such a rule because pegged imports 
std.typecons.

My suggestion is to make all imports in pegged selective and 
**renamed** e.g instead of

   import std.typecons;

rewrite

   import std.typecons : PeggedTuple = Tuple;

to minimize the chances of collisions. The problem is known, 
documented [1] but I dont see why the solution I propose would 
not work.

Later I've also noticed an inaccurary in the wiki, on this page 
[2] it is stated that

   "Predefined Parsers are all lowercase"

This sould be

   "Predefined Parsers, to the exception of `Alpha`, are lowercase"

--
[1] 
https://github.com/PhilippeSigaud/Pegged/wiki/Predefined-Parsers#public-imports
[2] 
https://github.com/PhilippeSigaud/Pegged/wiki/Declaring-a-Grammar
Apr 19 2020
parent reply Luis <luis.panadero gmail.com> writes:
On Sunday, 19 April 2020 at 10:36:57 UTC, Basile B. wrote:
 I'm sorry to post this here but currently I cannot create an 
 account to open an issue on Github.

 [...]
I create a incidence on Pegged : https://github.com/PhilippeSigaud/Pegged/issues/290 Sadly the Wiki isn't update too frequently. I will try to take a look to it.
Apr 19 2020
parent Basile B. <b2.temp gmx.com> writes:
On Sunday, 19 April 2020 at 13:33:27 UTC, Luis wrote:
 On Sunday, 19 April 2020 at 10:36:57 UTC, Basile B. wrote:
 I'm sorry to post this here but currently I cannot create an 
 account to open an issue on Github.

 [...]
I create a incidence on Pegged : https://github.com/PhilippeSigaud/Pegged/issues/290
Thanks
 Sadly the Wiki isn't update too frequently. I will try to take 
 a look to it.
Apr 19 2020