nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/standard: Got rid of FDStream, reified under FStream
[nit.git]
/
src
/
modelbuilder.nit
diff --git
a/src/modelbuilder.nit
b/src/modelbuilder.nit
index
30a0617
..
1ae7e45
100644
(file)
--- a/
src/modelbuilder.nit
+++ b/
src/modelbuilder.nit
@@
-125,10
+125,8
@@
class ModelBuilder
# Instantiate a modelbuilder for a model and a toolcontext
# Important, the options of the toolcontext must be correctly set (parse_option already called)
# Instantiate a modelbuilder for a model and a toolcontext
# Important, the options of the toolcontext must be correctly set (parse_option already called)
- init(model: Model, toolcontext: ToolContext)
+ init
do
do
- self.model = model
- self.toolcontext = toolcontext
assert toolcontext.modelbuilder_real == null
toolcontext.modelbuilder_real = self
assert toolcontext.modelbuilder_real == null
toolcontext.modelbuilder_real = self
@@
-141,10
+139,8
@@
class ModelBuilder
end
var nit_dir = toolcontext.nit_dir
end
var nit_dir = toolcontext.nit_dir
- if nit_dir != null then
- var libname = "{nit_dir}/lib"
- if libname.file_exists then paths.add(libname)
- end
+ var libname = "{nit_dir}/lib"
+ if libname.file_exists then paths.add(libname)
end
# Load a bunch of modules.
end
# Load a bunch of modules.
@@
-225,6
+221,12
@@
class ModelBuilder
for mprop in props do
if not mtype.has_mproperty(mmodule, mprop) then continue
if not mmodule.is_visible(mprop.intro_mclassdef.mmodule, mprop.visibility) then continue
for mprop in props do
if not mtype.has_mproperty(mmodule, mprop) then continue
if not mmodule.is_visible(mprop.intro_mclassdef.mmodule, mprop.visibility) then continue
+
+ # new-factories are invisible outside of the class
+ if mprop isa MMethod and mprop.is_new and (not mtype isa MClassType or mprop.intro_mclassdef.mclass != mtype.mclass) then
+ continue
+ end
+
if res == null then
res = mprop
continue
if res == null then
res = mprop
continue
@@
-703,6
+705,13
@@
class ModelBuilder
self.toolcontext.info("{mmodule} imports {imported_modules.join(", ")}", 3)
mmodule.set_imported_mmodules(imported_modules)
self.toolcontext.info("{mmodule} imports {imported_modules.join(", ")}", 3)
mmodule.set_imported_mmodules(imported_modules)
+ # Force standard to be public if imported
+ for sup in mmodule.in_importation.greaters do
+ if sup.name == "standard" then
+ mmodule.set_visibility_for(sup, public_visibility)
+ end
+ end
+
# TODO: Correctly check for useless importation
# It is even doable?
var directs = mmodule.in_importation.direct_greaters
# TODO: Correctly check for useless importation
# It is even doable?
var directs = mmodule.in_importation.direct_greaters