From: Jean Privat Date: Mon, 21 Jul 2014 15:49:23 +0000 (-0400) Subject: test: convert writable to annotations X-Git-Tag: v0.6.7~32^2~2 X-Git-Url: http://nitlanguage.org test: convert writable to annotations Signed-off-by: Jean Privat --- diff --git a/tests/base_attr2.nit b/tests/base_attr2.nit index 204b0c9..03c8413 100644 --- a/tests/base_attr2.nit +++ b/tests/base_attr2.nit @@ -19,17 +19,17 @@ class A protected var a2: Object = self private var a3: Object = self - var a4: Object writable = self - protected var a5: Object writable = self - private var a6: Object writable = self + var a4: Object = self is writable + protected var a5: Object = self is writable + private var a6: Object = self is writable - var a7: Object protected writable = self - protected var a8: Object protected writable = self - private var a9: Object protected writable = self + var a7: Object = self is protected writable + protected var a8: Object = self is protected writable + private var a9: Object = self is protected writable - var a10: Object private writable = self - protected var a11: Object private writable = self - private var a12: Object private writable = self + var a10: Object = self is private writable + protected var a11: Object = self is private writable + private var a12: Object = self is private writable var cpt: Int = 0 diff --git a/tests/base_attr4.nit b/tests/base_attr4.nit index f7bf6a7..b8f02dc 100644 --- a/tests/base_attr4.nit +++ b/tests/base_attr4.nit @@ -24,8 +24,8 @@ end class B super A redef var foo: Int = 20 - var bar: Int redef writable = 30 - redef var baz: Int redef writable = 40 + var bar: Int = 30 is redef writable + redef var baz: Int = 40 is redef writable end class C diff --git a/tests/base_attr5.nit b/tests/base_attr5.nit index 56c88da..8bb4171 100644 --- a/tests/base_attr5.nit +++ b/tests/base_attr5.nit @@ -33,24 +33,24 @@ class B super A #alt1#var foo: Int = 10 #alt2#redef var foo: Int = 10 - #alt3#var foo: Int writable = 10 - #alt4#redef var foo: Int writable = 10 - #alt5#var foo: Int redef writable = 10 - #alt6#redef var foo: Int redef writable = 10 + #alt3#var foo: Int = 10 is writable + #alt4#redef var foo: Int = 10 is writable + #alt5#var foo: Int = 10 is redef writable + #alt6#redef var foo: Int = 10 is redef writable #alt7#redef var foo #alt11#var bar: Int = 20 #alt12#redef var bar: Int = 20 - #alt13#var bar: Int writable = 20 - #alt14#redef var bar: Int writable = 20 - #alt15#var bar: Int redef writable = 20 - #alt16#redef var bar: Int redef writable = 20 + #alt13#var bar: Int = 20 is writable + #alt14#redef var bar: Int = 20 is writable + #alt15#var bar: Int = 20 is redef writable + #alt16#redef var bar: Int = 20 is redef writable #alt17#redef var bar #alt21#var baz: Int = 30 #alt22#redef var baz: Int = 30 - #alt23#var baz: Int writable = 30 - #alt24#redef var baz: Int writable = 30 - #alt25#var baz: Int redef writable = 30 - #alt26#redef var baz: Int redef writable = 30 + #alt23#var baz: Int = 30 is writable + #alt24#redef var baz: Int = 30 is writable + #alt25#var baz: Int = 30 is redef writable + #alt26#redef var baz: Int = 30 is redef writable #alt27#redef var baz end diff --git a/tests/base_attr6.nit b/tests/base_attr6.nit index a83f792..03fe206 100644 --- a/tests/base_attr6.nit +++ b/tests/base_attr6.nit @@ -37,7 +37,7 @@ class B i.output super(i+30) end - redef var vaz: Int redef writable = 40 + redef var vaz: Int = 40 is redef writable end var b = new B diff --git a/tests/base_attr7.nit b/tests/base_attr7.nit index c3605cc..2aec253 100644 --- a/tests/base_attr7.nit +++ b/tests/base_attr7.nit @@ -32,8 +32,8 @@ end class B super A #alt1#redef var foo: Bool = true - #alt2#var bar: Bool redef writable = true - #alt3#redef var baz: Bool redef writable = true + #alt2#var bar: Bool = true is redef writable + #alt3#redef var baz: Bool = true is redef writable end var b = new B diff --git a/tests/base_prot_sig.nit b/tests/base_prot_sig.nit index 1adc321..f78b9b5 100644 --- a/tests/base_prot_sig.nit +++ b/tests/base_prot_sig.nit @@ -18,24 +18,24 @@ class A protected fun proA(a: A) do end private fun priA(a: A) do end - var vpubA: nullable A writable - protected var vproA: nullable A protected writable + var vpubA: nullable A is writable + protected var vproA: nullable A is protected writable private var vpriA: nullable A - var vpubA2 writable = new A - protected var vproA2 protected writable = new A + var vpubA2 = new A is writable + protected var vproA2 = new A is protected writable private var vpriA2 = new A #alt1#fun pubB(a: B) do end #alt2#protected fun proB(a: B) do end private fun priB(a: B) do end - #alt3#var vpubB: nullable B writable - #alt4#protected var vproB: nullable B protected writable + #alt3#var vpubB: nullable B is writable + #alt4#protected var vproB: nullable B is protected writable private var vpriB: nullable B - #alt5#var vpubB2 writable = new B - #alt6#protected var vproB2 protected writable = new B + #alt5#var vpubB2 = new B is writable + #alt6#protected var vproB2 = new B is protected writable private var vpriB2 = new B init do end @@ -46,24 +46,24 @@ private class B #alt7#protected fun proA(a: A) do end private fun priA(a: A) do end - var vpubA: nullable A writable - #alt7#protected var vproA: nullable A protected writable + var vpubA: nullable A is writable + #alt7#protected var vproA: nullable A is protected writable private var vpriA: nullable A - var vpubA2 writable = new A - #alt7#protected var vproA2 protected writable = new A + var vpubA2 = new A is writable + #alt7#protected var vproA2 = new A is protected writable private var vpriA2 = new A fun pubB(a: B) do end #alt7#protected fun proB(a: B) do end private fun priB(a: B) do end - var vpubB: nullable B writable - #alt7#protected var vproB: nullable B protected writable + var vpubB: nullable B is writable + #alt7#protected var vproB: nullable B is protected writable private var vpriB: nullable B - var vpubB2 writable = new B - #alt7#protected var vproB2 protected writable = new B + var vpubB2 = new B is writable + #alt7#protected var vproB2 = new B is protected writable private var vpriB2 = new B init do end diff --git a/tests/base_prot_sig2.nit b/tests/base_prot_sig2.nit index 9009a88..89fff9e 100644 --- a/tests/base_prot_sig2.nit +++ b/tests/base_prot_sig2.nit @@ -20,12 +20,12 @@ class C #alt2#protected fun proA(a: A) do end private fun priA(a: A) do end - #alt3#var vpubA: nullable A writable - #alt4#protected var vproA: nullable A protected writable + #alt3#var vpubA: nullable A is writable + #alt4#protected var vproA: nullable A is protected writable private var vpriA: nullable A - #alt5#var vpubA2 writable = new A - #alt6#protected var vproA2 protected writable = new A + #alt5#var vpubA2 = new A is writable + #alt6#protected var vproA2 = new A is protected writable private var vpriA2 = new A init do end @@ -35,10 +35,10 @@ private class D fun pubA(a: A) do end private fun priA(a: A) do end - var vpubA: nullable A writable + var vpubA: nullable A is writable private var vpriA: nullable A - var vpubA2 writable = new A + var vpubA2 = new A is writable private var vpriA2 = new A init do end diff --git a/tests/base_virtual_type.nit b/tests/base_virtual_type.nit index 2f2a73f..277cc6d 100644 --- a/tests/base_virtual_type.nit +++ b/tests/base_virtual_type.nit @@ -19,7 +19,7 @@ import kernel class A type E: T - var e: nullable E writable = null + var e: nullable E = null is writable end class B diff --git a/tests/base_virtual_type2.nit b/tests/base_virtual_type2.nit index af6da5c..5f86a26 100644 --- a/tests/base_virtual_type2.nit +++ b/tests/base_virtual_type2.nit @@ -19,7 +19,7 @@ import kernel class A type E: T - var e: nullable E writable = null + var e: nullable E = null is writable end class B diff --git a/tests/base_virtual_type3.nit b/tests/base_virtual_type3.nit index 6f66799..545092f 100644 --- a/tests/base_virtual_type3.nit +++ b/tests/base_virtual_type3.nit @@ -19,7 +19,7 @@ import base_virtual_type2 class C super A - var tab: nullable Array[E] writable + var tab: nullable Array[E] is writable init do end end diff --git a/tests/base_virtual_type6.nit b/tests/base_virtual_type6.nit index 4d5ce65..07d5fda 100644 --- a/tests/base_virtual_type6.nit +++ b/tests/base_virtual_type6.nit @@ -20,9 +20,9 @@ class G[E] type F: E type F2: F - var e: E writable - var f: F writable - var f2: F2 writable + var e: E is writable + var f: F is writable + var f2: F2 is writable init(e: E, f: F, f2: F2) do diff --git a/tests/base_virtual_type7.nit b/tests/base_virtual_type7.nit index b4a79d0..76fd5dc 100644 --- a/tests/base_virtual_type7.nit +++ b/tests/base_virtual_type7.nit @@ -19,7 +19,7 @@ import kernel class A type E: F type F: E - var e: nullable E writable = null + var e: nullable E = null is writable init do end end diff --git a/tests/sav/base_prot_sig_alt7.res b/tests/sav/base_prot_sig_alt7.res index 18547d4..a5c0088 100644 --- a/tests/sav/base_prot_sig_alt7.res +++ b/tests/sav/base_prot_sig_alt7.res @@ -1,10 +1,10 @@ alt/base_prot_sig_alt7.nit:46,2--10: Error: The only legal visibility for properties in a private class is private. alt/base_prot_sig_alt7.nit:50,2--10: Error: The only legal visibility for properties in a private class is private. -alt/base_prot_sig_alt7.nit:50,34--42: Error: The only legal visibility for properties in a private class is private. +alt/base_prot_sig_alt7.nit:50,37--45: Error: The only legal visibility for properties in a private class is private. alt/base_prot_sig_alt7.nit:54,2--10: Error: The only legal visibility for properties in a private class is private. -alt/base_prot_sig_alt7.nit:54,23--31: Error: The only legal visibility for properties in a private class is private. +alt/base_prot_sig_alt7.nit:54,34--42: Error: The only legal visibility for properties in a private class is private. alt/base_prot_sig_alt7.nit:58,2--10: Error: The only legal visibility for properties in a private class is private. alt/base_prot_sig_alt7.nit:62,2--10: Error: The only legal visibility for properties in a private class is private. -alt/base_prot_sig_alt7.nit:62,34--42: Error: The only legal visibility for properties in a private class is private. +alt/base_prot_sig_alt7.nit:62,37--45: Error: The only legal visibility for properties in a private class is private. alt/base_prot_sig_alt7.nit:66,2--10: Error: The only legal visibility for properties in a private class is private. -alt/base_prot_sig_alt7.nit:66,23--31: Error: The only legal visibility for properties in a private class is private. +alt/base_prot_sig_alt7.nit:66,34--42: Error: The only legal visibility for properties in a private class is private. diff --git a/tests/test_gen_inh.nit b/tests/test_gen_inh.nit index 24b69e2..cc99b1e 100644 --- a/tests/test_gen_inh.nit +++ b/tests/test_gen_inh.nit @@ -33,8 +33,8 @@ end class Gen3[H: Int] super Gen1[H, Char] - redef var e: H redef writable - redef var f_: Char redef writable = 'N' + redef var e: H is redef writable + redef var f_: Char = 'N' is redef writable redef fun f: Char do return f_ end redef fun f=(x: Char) do f_ = x end