nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
online_ide: imports nitc (symlinked from contrib)
[nit.git]
/
src
/
nitserial.nit
diff --git
a/src/nitserial.nit
b/src/nitserial.nit
index
db70d4c
..
83b697e
100644
(file)
--- a/
src/nitserial.nit
+++ b/
src/nitserial.nit
@@
-18,7
+18,7
@@
#
# Executing on the module `game_logic` will create the module `game_logic_serial`
# in the local directory. Mixing the generated module to the main module with
#
# Executing on the module `game_logic` will create the module `game_logic_serial`
# in the local directory. Mixing the generated module to the main module with
-# `nitg game_logic.nit -m game_logic_serial` will create a program supporting
+# `nitc game_logic.nit -m game_logic_serial` will create a program supporting
# deserialization of all generic types visible from the main module.
#
# Because the generation is limited to the visible types, a module author might want
# deserialization of all generic types visible from the main module.
#
# Because the generation is limited to the visible types, a module author might want
@@
-27,7
+27,6
@@
module nitserial
import frontend
import rapid_type_analysis
import frontend
import rapid_type_analysis
-import model_utils
import template
# A Nit module
import template
# A Nit module
@@
-70,7
+69,7
@@
redef class ToolContext
var opt_dir: OptionString = new OptionString("Output directory", "--dir")
# Depth of the visit and generation
var opt_dir: OptionString = new OptionString("Output directory", "--dir")
# Depth of the visit and generation
- var opt_depth = new OptionEnum(["module", "group", "project"],
+ var opt_depth = new OptionEnum(["module", "group", "package"],
"Depth of the visit and generation", 0, "-d", "--depth")
redef init
"Depth of the visit and generation", 0, "-d", "--depth")
redef init
@@
-94,7
+93,7
@@
end
redef class MClassType
redef fun is_visible_from(mmodule) do
redef class MClassType
redef fun is_visible_from(mmodule) do
- return mmodule.is_visible(mclass.intro_mmodule, public_visibility)
+ return mmodule.is_visible(mclass.intro_mmodule, mclass.visibility)
end
end
end
end
@@
-153,7
+152,7
@@
for mmodule in mmodules do
else if module_path.has_suffix(".nit") then
module_name = module_path.basename(".nit")
else
else if module_path.has_suffix(".nit") then
module_name = module_path.basename(".nit")
else
- module_name = module_path.basename("")
+ module_name = module_path.basename
module_path += ".nit"
end
module_path += ".nit"
end
@@
-161,14
+160,14
@@
for mmodule in mmodules do
var importations = null
var mgroup = mmodule.mgroup
if toolcontext.opt_depth.value == 1 and mgroup != null then
var importations = null
var mgroup = mmodule.mgroup
if toolcontext.opt_depth.value == 1 and mgroup != null then
- modelbuilder.visit_group mgroup
+ modelbuilder.scan_group mgroup
target_modules = mgroup.mmodules
else if toolcontext.opt_depth.value == 2 then
target_modules = mgroup.mmodules
else if toolcontext.opt_depth.value == 2 then
- # project
+ # package
target_modules = new Array[MModule]
importations = new Array[MModule]
if mgroup != null then
target_modules = new Array[MModule]
importations = new Array[MModule]
if mgroup != null then
- for g in mgroup.mproject.mgroups do
+ for g in mgroup.mpackage.mgroups do
target_modules.add_all g.mmodules
end
target_modules.add_all g.mmodules
end
@@
-215,7
+214,7
@@
redef class Deserializer
for mtype in rta.live_types do
# We are only interested in instanciated generics, subtypes of Serializable
for mtype in rta.live_types do
# We are only interested in instanciated generics, subtypes of Serializable
- # and which are visibles.
+ # and which are visible.
if mtype isa MGenericType and
mtype.is_subtype(m, null, serializable_type) and
mtype.is_visible_from(mmodule) and
if mtype isa MGenericType and
mtype.is_subtype(m, null, serializable_type) and
mtype.is_visible_from(mmodule) and