nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
code: various update to clean declaration or usage of constructors
[nit.git]
/
src
/
loader.nit
diff --git
a/src/loader.nit
b/src/loader.nit
index
9b79c62
..
c0891a1
100644
(file)
--- a/
src/loader.nit
+++ b/
src/loader.nit
@@
-42,13
+42,13
@@
import ini
redef class ToolContext
# Option --path
redef class ToolContext
# Option --path
- var opt_path = new OptionArray("Set include path for loaders (may be used more than once)", "-I", "--path")
+ var opt_path = new OptionArray("Add an additional include path (may be used more than once)", "-I", "--path")
# Option --only-metamodel
var opt_only_metamodel = new OptionBool("Stop after meta-model processing", "--only-metamodel")
# Option --only-parse
# Option --only-metamodel
var opt_only_metamodel = new OptionBool("Stop after meta-model processing", "--only-metamodel")
# Option --only-parse
- var opt_only_parse = new OptionBool("Only proceed to parse step of loaders", "--only-parse")
+ var opt_only_parse = new OptionBool("Only proceed to parse files", "--only-parse")
redef init
do
redef init
do
@@
-104,7
+104,7
@@
redef class ModelBuilder
if toolcontext.opt_only_parse.value then
self.toolcontext.info("*** ONLY PARSE...", 1)
if toolcontext.opt_only_parse.value then
self.toolcontext.info("*** ONLY PARSE...", 1)
- exit(0)
+ self.toolcontext.quit
end
return mmodules.to_a
end
return mmodules.to_a
@@
-199,7
+199,7
@@
redef class ModelBuilder
if toolcontext.opt_only_parse.value then
self.toolcontext.info("*** ONLY PARSE...", 1)
if toolcontext.opt_only_parse.value then
self.toolcontext.info("*** ONLY PARSE...", 1)
- exit(0)
+ self.toolcontext.quit
end
return mmodules.to_a
end
return mmodules.to_a
@@
-243,7
+243,9
@@
redef class ModelBuilder
end
end
end
end
- var candidate = search_module_in_paths(anode.hot_location, name, lookpaths)
+ var loc = null
+ if anode != null then loc = anode.hot_location
+ var candidate = search_module_in_paths(loc, name, lookpaths)
if candidate == null then
if mgroup != null then
if candidate == null then
if mgroup != null then
@@
-655,6
+657,7
@@
redef class ModelBuilder
var mmodule = new MModule(model, mgroup, mod_name, nmodule.location)
nmodule.mmodule = mmodule
nmodules.add(nmodule)
var mmodule = new MModule(model, mgroup, mod_name, nmodule.location)
nmodule.mmodule = mmodule
nmodules.add(nmodule)
+ parsed_modules.add mmodule
self.mmodule2nmodule[mmodule] = nmodule
if parent!= null then
self.mmodule2nmodule[mmodule] = nmodule
if parent!= null then
@@
-713,8
+716,6
@@
redef class ModelBuilder
var mdoc = ndoc.to_mdoc
mmodule.mdoc = mdoc
mdoc.original_mentity = mmodule
var mdoc = ndoc.to_mdoc
mmodule.mdoc = mdoc
mdoc.original_mentity = mmodule
- else
- advice(decl, "missing-doc", "Documentation warning: Undocumented module `{mmodule}`")
end
# Is the module a test suite?
mmodule.is_test_suite = not decl.get_annotations("test_suite").is_empty
end
# Is the module a test suite?
mmodule.is_test_suite = not decl.get_annotations("test_suite").is_empty