Merge: Conditional importation
authorJean Privat <jean@pryen.org>
Wed, 22 Jul 2015 14:21:05 +0000 (10:21 -0400)
committerJean Privat <jean@pryen.org>
Wed, 22 Jul 2015 14:21:05 +0000 (10:21 -0400)
commit1562eb38287982604a6102497fd7259d91d592dd
treeab5a6275fdd47a179ff09f5c05f9fd8504cf44fe
parent067a3906cc4d02dec67fbcf174fd4abe46ce6b5b
parentac6af3c6549503f79cfff30751d084051ed1a8d6
Merge: Conditional importation

First quick and dirty implementation for #1579.
Since the loader is due to a full rewrite (cf #1250), some part were implemented as simple as possible.

It is only a technology preview. A lot of thing are missing including the following:

* do not error if the modules in the rules are not present (eg optional modules not installed). Not an issue currently since all the modules are present in the repository.
* show warnings for useless condition to help the programmer
* implement some visibility rules. `public` is assumed even if it makes no sense and cause issues
* understand qualified modules in the conditions

The last issue might be the more limiting currently as only the conditional module understand qualified names. the potential qualified names in the arguments are accepted but just ignored.
Basically `toto` is ignored in `import foo::bar is conditional(toto::tata)`.

Pull-Request: #1580
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>