src/hightlight: hightlight and do not crash on MNotNullType
authorJean Privat <jean@pryen.org>
Tue, 7 Apr 2015 10:37:36 +0000 (17:37 +0700)
committerJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 00:52:02 +0000 (07:52 +0700)
Also add MNullType that where missing.

Signed-off-by: Jean Privat <jean@pryen.org>

src/highlight.nit

index e6ca8ea..39a042a 100644 (file)
@@ -510,6 +510,33 @@ redef class MNullableType
        end
 end
 
+redef class MNotNullType
+       redef fun infobox(v)
+       do
+               return mtype.infobox(v)
+       end
+       redef fun linkto
+       do
+               var res = new HTMLTag("span")
+               res.append("not null ").add(mtype.linkto)
+               return res
+       end
+end
+
+redef class MNullType
+       redef fun infobox(v)
+       do
+               var res = new HInfoBox(v, to_s)
+               return res
+       end
+       redef fun linkto
+       do
+               var res = new HTMLTag("span")
+               res.append("null")
+               return res
+       end
+end
+
 redef class MSignature
        redef fun linkto
        do