nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge: No duplicated mclassdefs
[nit.git]
/
src
/
serialization_phase.nit
diff --git
a/src/serialization_phase.nit
b/src/serialization_phase.nit
index
7bdd2d4
..
f565f56
100644
(file)
--- a/
src/serialization_phase.nit
+++ b/
src/serialization_phase.nit
@@
-16,7
+16,7
@@
# See the License for the specific language governing permissions and
# limitations under the License.
# See the License for the specific language governing permissions and
# limitations under the License.
-# Phase generating methods to
+# Phase generating methods to serialize Nit objects to different formats
module serialization_phase
import phase
module serialization_phase
import phase
@@
-93,6
+93,10
@@
private class SerializationPhase
code.add " v.notify_of_creation self"
for attribute in npropdefs do if attribute isa AAttrPropdef then
code.add " v.notify_of_creation self"
for attribute in npropdefs do if attribute isa AAttrPropdef then
+ if attribute.n_type == null then
+ toolcontext.error(attribute.location, "NOT YET IMPLEMENTED: all attributes of an auto_serialized class definition must define a type.")
+ continue
+ end
var name = attribute.name
var type_name = attribute.type_name
code.add ""
var name = attribute.name
var type_name = attribute.type_name
code.add ""
@@
-131,7
+135,7
@@
private class SerializationPhase
for nclassdef in nclassdefs do
var name = nclassdef.n_id.text
for nclassdef in nclassdefs do
var name = nclassdef.n_id.text
- if not name.has('[') then # FIXME this is a temporary hack
+ if not name.chars.has('[') then # FIXME this is a temporary hack
code.add " if name == \"{name}\" then return new {name}.from_deserializer(self)"
end
end
code.add " if name == \"{name}\" then return new {name}.from_deserializer(self)"
end
end