src: transform all old writable in annotations
authorJean Privat <jean@pryen.org>
Fri, 5 Sep 2014 00:49:39 +0000 (20:49 -0400)
committerJean Privat <jean@pryen.org>
Fri, 5 Sep 2014 22:05:30 +0000 (18:05 -0400)
So just insert an `is`, and move it after the initial value if any.

~~~
sed -i '/ is /!s/\(\( redef\)\?\( protected\)\? writable\)\(.*\)/\4 is\1/'
~~~

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

39 files changed:
contrib/nitcc/src/grammar.nit
contrib/pep8analysis/src/ast/pretty_instructions.nit
contrib/pep8analysis/src/cfg/cfg_base.nit
contrib/pep8analysis/src/parser/xss/parser.xss
examples/leapfrog/leapfrog.nit
examples/mnit_dino/src/game_logic.nit
examples/shoot/src/shoot_logic.nit
lib/android/audio.nit
lib/android/sensors.nit
lib/bucketed_game.nit
lib/csv.nit
lib/curl/curl.nit
lib/for_abuse.nit
lib/ini.nit
lib/mnit/mnit_app.nit
lib/mnit/mnit_fps.nit
lib/mnit/mnit_null.nit
lib/mnit/tileset.nit
lib/neo4j/curl_json.nit
lib/nitcc_runtime.nit
lib/opts.nit
lib/scene2d.nit
lib/standard/collection/abstract_collection.nit
lib/standard/file.nit
lib/trees/abstract_tree.nit
src/common_ffi/c.nit
src/common_ffi/cpp.nit
src/compiler/abstract_compiler.nit
src/doc/doc_templates.nit
src/highlight.nit
src/model/mdoc.nit
src/model/mmodule.nit
src/model/model.nit
src/model/model_viz.nit
src/model/mproject.nit
src/model_utils.nit
src/modelize/modelize_property.nit
src/toolcontext.nit
tests/test_prog/rpg/character.nit

index 48c6195..fae7ed1 100644 (file)
@@ -330,11 +330,11 @@ class Production
 
        # Is self transformed to a other production for the AST
        # FIXME: cleaup AST
-       var spe: nullable Production writable = null
+       var spe: nullable Production = null is writable
 
        # Is self contains only a single alternative (then no need for a abstract production class in the AST)
        # FIXME cleanup AST
-       var altone writable = false
+       var altone = false is writable
 
        # The cname of the class in the AST
        # FIXME: cleanup AST
@@ -396,7 +396,7 @@ class Alternative
        var prod: Production
 
        # The name of the alternative
-       var name: String writable
+       var name: String is writable
 
        # The elements of the alternative
        var elems: Array[Element]
@@ -424,13 +424,13 @@ class Alternative
        end
 
        # The code for the reduction
-       var codes: nullable Array[Code] writable = null
+       var codes: nullable Array[Code] = null is writable
 
        # Is the alternative transformed (ie not in the AST)
-       var trans writable = false
+       var trans = false is writable
 
        # Is the alternative unparsable? (ie not in the automaton)
-       var phony writable = false
+       var phony = false is writable
 
        # Imitialize codes with the elements
        fun make_codes
index 488d382..98380f7 100644 (file)
@@ -23,7 +23,7 @@ end
 class ASTPrinter
        super Visitor
 
-       var str writable = ""
+       var str = "" is writable
 
        init do end
        redef fun visit(n) do n.accept_ast_printer(self)
index 4d7264b..c4de901 100644 (file)
@@ -306,7 +306,7 @@ class CFG
                end
        end
 
-       var watchdog writable = 0
+       var watchdog = 0 is writable
        fun link_ret_to_calls(b: BasicBlock, to_link_ori: List[BasicBlock], seq: List[BasicBlock], depth: Int): Bool
        do
                watchdog += 1
index 7e24374..435ced7 100644 (file)
@@ -20,10 +20,10 @@ $ template make_parser()
 # State of the parser automata as stored in the parser stack.
 private class State
        # The internal state number
-       readable writable var _state: Int
+       readable var _state: Int is writable
 
        # The node stored with the state in the stack
-       readable writable var _nodes: nullable Object
+       readable var _nodes: nullable Object is writable
 
        init(state: Int, nodes: nullable Object)
        do
index ac8cff0..6aa6f48 100644 (file)
@@ -34,7 +34,7 @@ class Animal
        # The value indicate the number of step that remain to be stunt
        #
        # If a animal is stunned, it cannot move horizontally
-       var stunt_ttl: Int writable = 0
+       var stunt_ttl: Int = 0 is writable
 
        # Common update for animal
        # handle stunt and edge collision
index b148778..1df0119 100644 (file)
@@ -182,7 +182,7 @@ end
 class MovingEntity
        super Entity
 
-       var going_to : nullable GamePos writable = null
+       var going_to : nullable GamePos = null is writable
 
        fun speed : Int is abstract
 
index 1aefc7b..838c78b 100644 (file)
@@ -36,17 +36,17 @@ class Player
        end
 
        # Current forture of the player
-       var money: Int writable = 0
+       var money: Int = 0 is writable
 
        # Number of basic bullets fired together
-       var nbshoots: Int writable = 1
+       var nbshoots: Int = 1 is writable
 
        # Time bebore the player shoot again a basic bullet (cooldown)
        # Shoot if 0
        var shoot_ttl = 0
 
        # Number of missiles
-       var nbmissiles: Int writable = 0
+       var nbmissiles: Int = 0 is writable
 
        # Time bebore the player shoot again a missile (cooldown)
        # Shoot if 0
@@ -152,7 +152,7 @@ class GoingTarget
        super Hitable
 
        # true in on move, false if player is at rest
-       var active writable = false
+       var active = false is writable
 
        init do
                self.width = 500
@@ -834,13 +834,13 @@ class ShotScene
        super Scene
 
        # When a scene need to be replaced, just assign the next_scene to a non null value
-       var next_scene: nullable ShotScene writable = null
+       var next_scene: nullable ShotScene = null is writable
 
        # The width of the whole scene
-       var width: Int writable
+       var width: Int is writable
 
        # The height of the whole scene
-       var height: Int writable
+       var height: Int is writable
 
        init(w,h: Int)
        do
@@ -1034,7 +1034,7 @@ class MenuScene
                end
        end
 
-       var play: Bool writable = false
+       var play: Bool = false is writable
        var ttl: Int = 50
 
        redef fun update
index 9fe93e9..8d3264f 100644 (file)
@@ -137,25 +137,25 @@ end
 class SoundPool
        private var nsoundpool: NativeSoundPool is noinit
        # The maximum number of simultaneous streams for this SoundPool
-       var max_streams writable = 10
+       var max_streams = 10 is writable
 
        # The audio stream type, 3 is STREAM_MUSIC, default for game application
-       var stream_type writable = 3
+       var stream_type = 3 is writable
 
        # The sample-rate converter quality, currently has no effect
-       var src_quality writable = 0
+       var src_quality = 0 is writable
 
        # Left volume value, range 0.0 to 1.0
-       var left_volume writable = 1.0
+       var left_volume = 1.0 is writable
 
        # Right volume value, range 0.0 to 1.0
-       var right_volume writable = 1.0
+       var right_volume = 1.0 is writable
 
        # Playback rate, 1.0 = normal playback, range 0.5 to 2.0
-       var rate writable = 1.0
+       var rate = 1.0 is writable
 
        # Loop mode, 0 = no loop, -1 = loop forever
-       var looping writable = 0
+       var looping = 0 is writable
 
        # Stream priority
        private var priority = 1
index 2246298..4c28466 100644 (file)
@@ -128,9 +128,9 @@ end
 # NIT representation of an Android Sensor used in android_app to initialize sensors
 class AndroidSensor
 
-       var asensor writable = new ASensor
-       var enabled writable = false
-       var event_rate writable = 100000
+       var asensor = new ASensor is writable
+       var enabled = false is writable
+       var event_rate = 100000 is writable
 
        fun name: String do return asensor.name.to_s
        fun vendor: String do return asensor.vendor.to_s
@@ -234,7 +234,7 @@ redef class App
        var proximity = new AndroidSensor
        var sensormanager: ASensorManager
        var eventqueue: ASensorEventQueue
-       var sensors_support_enabled writable = false
+       var sensors_support_enabled = false is writable
 
        private fun extern_input_sensor_accelerometer(event: ASensorAccelerometer) do input(event)
        private fun extern_input_sensor_magnetic_field(event: ASensorMagneticField) do input(event)
index cdedc32..b680079 100644 (file)
@@ -104,14 +104,14 @@ end
 
 # Game logic on the client
 class ThinGame
-       var tick: Int protected writable = 0
+       var tick: Int = 0 is protected writable
 end
 
 # Game turn on the client
 class ThinGameTurn[G: ThinGame]
-       var tick: Int protected writable = 0
+       var tick: Int = 0 is protected writable
 
-       var events: List[GameEvent] protected writable = new List[GameEvent]
+       var events: List[GameEvent] = new List[GameEvent] is protected writable
 
        init (t: Int) do tick = t
 end
index 9b4da2f..82fbb05 100644 (file)
@@ -19,7 +19,7 @@ module csv
 class CSVDocument
        super Streamable
 
-       var header: Array[String] writable = new Array[String]
+       var header: Array[String] = new Array[String] is writable
        var lines: Array[Array[String]] = new Array[Array[String]]
 
        fun set_header(values: Object...) do
index d0c445d..bca105c 100644 (file)
@@ -40,7 +40,7 @@ end
 # CURL Request
 class CurlRequest
 
-       var verbose: Bool writable = false
+       var verbose: Bool = false is writable
        private var curl: nullable Curl = null
 
        # Launch request method
@@ -76,8 +76,8 @@ class CurlHTTPRequest
        super CurlCallbacksRegisterIntern
 
        var url: String
-       var datas: nullable HeaderMap writable = null
-       var headers: nullable HeaderMap writable = null
+       var datas: nullable HeaderMap = null is writable
+       var headers: nullable HeaderMap = null is writable
 
        # Set the user agent for all following HTTP requests
        fun user_agent=(name: String)
@@ -201,14 +201,14 @@ class CurlMailRequest
        super CurlRequest
        super CCurlCallbacks
 
-       var headers: nullable HeaderMap writable = null
-       var headers_body: nullable HeaderMap writable = null
-       var from: nullable String writable = null
-       var to: nullable Array[String] writable = null
-       var cc: nullable Array[String] writable = null
-       var bcc: nullable Array[String] writable = null
-       var subject: nullable String writable = ""
-       var body: nullable String writable = ""
+       var headers: nullable HeaderMap = null is writable
+       var headers_body: nullable HeaderMap = null is writable
+       var from: nullable String = null is writable
+       var to: nullable Array[String] = null is writable
+       var cc: nullable Array[String] = null is writable
+       var bcc: nullable Array[String] = null is writable
+       var subject: nullable String = "" is writable
+       var body: nullable String = "" is writable
        private var supported_outgoing_protocol: Array[String] = ["smtp", "smtps"]
 
        init (curl: nullable Curl)
@@ -338,7 +338,7 @@ end
 
 # Callbacks attributes
 abstract class CurlCallbacksRegisterIntern
-       var delegate: nullable CurlCallbacks writable = null
+       var delegate: nullable CurlCallbacks = null is writable
 end
 
 # Abstract Curl request response
index 40cb1bf..2ee4d28 100644 (file)
@@ -79,7 +79,7 @@ class CompareQuery[E]
        # The second element to compare
        var b: E
        # The result of the comparison (according to the user)
-       var res writable = 0
+       var res = 0 is writable
 end
 
 # Abuser for sorting array, see `sort_fa`
index 232e7c5..a6de8f1 100644 (file)
@@ -284,7 +284,7 @@ end
 private class ConfigNode
        var parent: nullable ConfigNode
        var children = new HashMap[String, ConfigNode]
-       var name: String writable
+       var name: String is writable
        var value: nullable String
 
        init(name: String) do
index 4c003a6..9987b8c 100644 (file)
@@ -30,10 +30,10 @@ redef class App
 
        # Display to use by apps
        # Is null if the display is not available or not yet ready
-       var display: nullable D protected writable = null
+       var display: nullable D = null is protected writable
 
        # Received quit order
-       var quit: Bool writable = false
+       var quit: Bool = false is writable
 
        # App is visible? (vs minimized or in background)
        fun visible: Bool is abstract
index cd30e83..2b2abf1 100644 (file)
@@ -24,7 +24,7 @@ redef class App
        # Zero (or a negative value) means no limit.
        #
        # Applications can modify this value even during the main-loop.
-       var maximum_fps writable = 60
+       var maximum_fps = 60 is writable
 
        # Current frame-rate
        # Updated each 5 seconds.
index c966769..91bc359 100644 (file)
@@ -77,7 +77,7 @@ class NullImage
        super Image
        var path: String
        redef fun to_s do return path
-       redef var scale redef writable = 1.0
+       redef var scale = 1.0 is redef writable
        redef var width = 32
        redef var height = 32
 end
index 7b473f3..b0eae74 100644 (file)
@@ -80,11 +80,11 @@ class TileSetFont
 
        # Additional space to insert horizontally between characters
        # A negave value will display tile overlaped
-       var hspace: Int writable = 0
+       var hspace: Int = 0 is writable
 
        # Additional space to insert vertically between characters
        # A negave value will display tile overlaped
-       var vspace: Int writable = 0
+       var vspace: Int = 0 is writable
 
        # The glyph (tile) associated to the caracter `c` according to `chars`
        # Returns null if `c` is not in `chars`
index 77d3650..f1a1da8 100644 (file)
@@ -35,14 +35,14 @@ abstract class JsonCurlRequest
        end
 
        # OAuth token
-       var auth: nullable String writable
+       var auth: nullable String is writable
 
        # User agent (is used by github to contact devs in case of problems)
        # Eg. "Awesome-Octocat-App"
-       var user_agent: nullable String writable
+       var user_agent: nullable String is writable
 
        # HTTP headers to send
-       var headers: nullable HeaderMap writable = null
+       var headers: nullable HeaderMap = null is writable
 
 
        # init HTTP headers for Neo4j REST API
@@ -125,7 +125,7 @@ end
 class JsonPOST
        super JsonCurlRequest
 
-       var data: nullable Jsonable writable = null
+       var data: nullable Jsonable = null is writable
 
        redef fun init_headers do
                super
@@ -160,7 +160,7 @@ end
 class JsonPUT
        super JsonCurlRequest
 
-       var data: nullable Jsonable writable = null
+       var data: nullable Jsonable = null is writable
 
        redef fun init_headers do
                super
index c71ea6b..74dcd43 100644 (file)
@@ -116,7 +116,7 @@ abstract class Parser
 
        # Should the parser stop
        # Used by generated parsers
-       var stop writable = true
+       var stop = true is writable
 
        # Parse a full sequence of tokens and return a complete syntactic tree
        fun parse: Node
@@ -318,7 +318,7 @@ abstract class Node
        end
 
        # The position of the node in the input stream
-       var position: nullable Position writable = null
+       var position: nullable Position = null is writable
 
        # Produce a graphiz file for the syntaxtic tree rooted at `self`.
        fun to_dot(filepath: String)
@@ -423,7 +423,7 @@ abstract class NToken
        end
 
        # The text associated with the token
-       var text: String writable = ""
+       var text: String = "" is writable
 
        redef fun to_s do
                var res = super
index 19b8ff3..a1bffc1 100644 (file)
@@ -29,19 +29,19 @@ abstract class Option
        var errors: Array[String] = new Array[String]
 
        # Is this option mandatory?
-       var mandatory: Bool writable = false
+       var mandatory: Bool = false is writable
 
        # Is this option hidden from `usage`?
-       var hidden: Bool writable = false
+       var hidden: Bool = false is writable
 
        # Has this option been read?
-       var read: Bool writable = false
+       var read: Bool = false is writable
 
        # Current value of this option
-       var value: VALUE writable
+       var value: VALUE is writable
 
        # Default value of this option
-       var default_value: VALUE writable
+       var default_value: VALUE is writable
 
        # Create a new option
        init(help: String, default: VALUE, names: nullable Array[String])
@@ -138,7 +138,7 @@ abstract class OptionParameter
        protected fun convert(str: String): VALUE is abstract
 
        # Is the parameter mandatory?
-       var parameter_mandatory: Bool writable = true
+       var parameter_mandatory: Bool = true is writable
 
        redef fun read_param(it)
        do
index 18a5d13..ac5a571 100644 (file)
@@ -23,7 +23,7 @@ abstract class LiveObject
        fun update do end
 
        # Controls whether `update' and `draw' are automatically called by `LiveGroup'
-       var exists writable = true
+       var exists = true is writable
 
        # Redefine this method to asks how to draw on a view
        fun draw(view: View) is abstract
@@ -37,16 +37,16 @@ class Sprite
        super LiveObject
 
        # x coordinate of the center point
-       var x: Int writable = 0
+       var x: Int = 0 is writable
 
        # y coordinate of the center point
-       var y: Int writable = 0
+       var y: Int = 0 is writable
 
        # width of the sprite
-       var width: Int writable = 100
+       var width: Int = 100 is writable
 
        # height of the sprite
-       var height: Int writable = 100
+       var height: Int = 100 is writable
 
        fun left: Int do return x - width/2
        fun right: Int do return x + width/2
@@ -54,10 +54,10 @@ class Sprite
        fun bottom: Int do return y + height/2
 
        # x velocity (applied by `update')
-       var vx: Int writable = 0
+       var vx: Int = 0 is writable
 
        # y velocity (applied by `update')
-       var vy: Int writable = 0
+       var vy: Int = 0 is writable
 
        redef fun update
        do
index 9d37e15..7320e83 100644 (file)
@@ -188,7 +188,7 @@ class Container[E]
        init(e: E) do item = e
 
        # The stored item
-       var item: E writable
+       var item: E is writable
 end
 
 # This iterator is quite stupid since it is used for only one item.
@@ -940,10 +940,10 @@ end
 class Couple[F, S]
 
        # The first element of the couple.
-       var first: F writable
+       var first: F is writable
 
        # The second element of the couple.
-       var second: S writable
+       var second: S is writable
 
        # Create a new instance with a first and a second object.
        init(f: F, s: S)
index 3443105..06001df 100644 (file)
@@ -526,13 +526,13 @@ end
 redef class Sys
 
        # Standard input
-       var stdin: PollableIStream protected writable = new Stdin
+       var stdin: PollableIStream = new Stdin is protected writable
 
        # Standard output
-       var stdout: OStream protected writable = new Stdout
+       var stdout: OStream = new Stdout is protected writable
 
        # Standard output for errors
-       var stderr: OStream protected writable = new Stderr
+       var stderr: OStream = new Stderr is protected writable
 
 end
 
index 0b79490..d05663e 100644 (file)
@@ -28,7 +28,7 @@ abstract class TreeMap[K: Comparable, E]
        protected type N: TreeNode[K, E]
 
        # The `root` node of the tree (null if tree is empty)
-       protected var root: nullable N protected writable = null
+       protected var root: nullable N = null is protected writable
 
        # Display the tree in a gaphical windows
        # Graphviz with a working -Txlib is expected
@@ -51,7 +51,7 @@ class TreeNode[K: Comparable, E]
        var value: E
 
        # Direct parent of this node (null if the node is root)
-       var parent: nullable SELF writable = null
+       var parent: nullable SELF = null is writable
 
        redef fun to_s do return "\{{value or else ""}\}"
 
index 4e4402c..92697f5 100644 (file)
@@ -72,8 +72,8 @@ redef class Location
 end
 
 redef class MModule
-       var c_compiler_options writable = ""
-       var c_linker_options writable = ""
+       var c_compiler_options = "" is writable
+       var c_linker_options = "" is writable
 end
 
 class ForeignCType
index 8cdce81..06f8f25 100644 (file)
@@ -27,7 +27,7 @@ end
 redef class MModule
        private var cpp_file: nullable CPPCompilationUnit = null
 
-       var cpp_compiler_options writable = ""
+       var cpp_compiler_options = "" is writable
 end
 
 class CPPLanguage
index c1d1120..89254d4 100644 (file)
@@ -444,13 +444,13 @@ abstract class AbstractCompiler
 
        # The main module of the program currently compiled
        # Is assigned during the separate compilation
-       var mainmodule: MModule writable
+       var mainmodule: MModule is writable
 
        # The real main module of the program
        var realmainmodule: MModule
 
        # The modeulbuilder used to know the model and the AST
-       var modelbuilder: ModelBuilder protected writable
+       var modelbuilder: ModelBuilder is protected writable
 
        # Is hardening asked? (see --hardening)
        fun hardening: Bool do return self.modelbuilder.toolcontext.opt_hardening.value
@@ -479,7 +479,7 @@ abstract class AbstractCompiler
        fun new_visitor: VISITOR is abstract
 
        # Where global declaration are stored (the main .h)
-       var header: CodeWriter writable
+       var header: CodeWriter is writable
 
        # Provide a declaration that can be requested (before or latter) by a visitor
        fun provide_declaration(key: String, s: String)
@@ -1017,10 +1017,10 @@ abstract class AbstractCompilerVisitor
        var compiler: COMPILER
 
        # The current visited AST node
-       var current_node: nullable ANode writable = null
+       var current_node: nullable ANode = null is writable
 
        # The current `Frame`
-       var frame: nullable Frame writable
+       var frame: nullable Frame is writable
 
        # Alias for self.compiler.mainmodule.object_type
        fun object_type: MClassType do return self.compiler.mainmodule.object_type
@@ -1523,7 +1523,7 @@ abstract class AbstractRuntimeFunction
        # Non cached version of `c_name`
        protected fun build_c_name: String is abstract
 
-       protected var c_name_cache: nullable String writable = null
+       protected var c_name_cache: nullable String = null is writable
 
        # Implements a call of the runtime_function
        # May inline the body or generate a C function call
@@ -1546,11 +1546,11 @@ class RuntimeVariable
        var mtype: MType
 
        # The current casted type of the variable (as known in Nit)
-       var mcasttype: MType writable
+       var mcasttype: MType is writable
 
        # If the variable exaclty a mcasttype?
        # false (usual value) means that the variable is a mcasttype or a subtype.
-       var is_exact: Bool writable = false
+       var is_exact: Bool = false is writable
 
        init(name: String, mtype: MType, mcasttype: MType)
        do
@@ -1600,10 +1600,10 @@ class Frame
        var arguments: Array[RuntimeVariable]
 
        # The runtime_variable associated to the return (in a function)
-       var returnvar: nullable RuntimeVariable writable = null
+       var returnvar: nullable RuntimeVariable = null is writable
 
        # The label at the end of the property
-       var returnlabel: nullable String writable = null
+       var returnlabel: nullable String = null is writable
 end
 
 redef class MType
@@ -1614,7 +1614,7 @@ redef class MType
 
        # Return the name of the C structure associated to a Nit live type
        fun c_name: String is abstract
-       protected var c_name_cache: nullable String protected writable
+       protected var c_name_cache: nullable String is protected writable
 end
 
 redef class MClassType
index 4d3b253..1d1fb45 100644 (file)
@@ -274,11 +274,11 @@ class TplSideBox
 
        # Content to display in the box
        # box will not be rendered if the content is null
-       var content: nullable Streamable writable
+       var content: nullable Streamable is writable
 
        # Is the box opened by default
        # otherwise, the user will have to clic on the title to display the content
-       var is_open writable = false
+       var is_open = false is writable
 
        init(title: String) do
                self.title = title
@@ -383,14 +383,14 @@ class TplSectionElt
        # Title to display if any
        # if both `title` and `summary_title` are null then
        # the section will not appear in the summary
-       var title: nullable Streamable writable
+       var title: nullable Streamable is writable
 
        # Subtitle to display if any
-       var subtitle: nullable Streamable writable
+       var subtitle: nullable Streamable is writable
 
        # Title that appear in the summary
        # if null use `title` instead
-       var summary_title: nullable String writable
+       var summary_title: nullable String is writable
 
        # CSS classes to apply on the section element
        var css_classes = new Array[String]
@@ -471,8 +471,8 @@ class TplArticle
        super TplSectionElt
 
        # Content for this article
-       var content: nullable Streamable writable = null
-       var source_link: nullable Streamable writable = null
+       var content: nullable Streamable = null is writable
+       var source_link: nullable Streamable = null is writable
 
        init with_content(id: String, title: Streamable, content: Streamable) do
                with_title(id, title)
@@ -652,13 +652,13 @@ class TplLink
        super Template
 
        # Link href
-       var href: String writable
+       var href: String is writable
 
        # Text to display in the link
-       var text: Streamable writable
+       var text: Streamable is writable
 
        # Optional title
-       var title: nullable String writable
+       var title: nullable String is writable
 
        init(href, text: String) do
                self.href = href
index a93fec9..4922a79 100644 (file)
@@ -27,13 +27,13 @@ class HighlightVisitor
 
        # Is the HTML include a nested `<span class"{type_of_node}">` element for each `ANode` of the AST?
        # Used to have a really huge and verbose HTML (mainly for debug)
-       var with_ast writable = false
+       var with_ast = false is writable
 
        # The first line to generate, null if start at the first line
-       var first_line: nullable Int writable = null
+       var first_line: nullable Int = null is writable
 
        # The last line to generate, null if finish at the last line
-       var last_line: nullable Int writable = null
+       var last_line: nullable Int = null is writable
 
        init
        do
index 44ddfea..2817a1b 100644 (file)
@@ -26,10 +26,10 @@ class MDoc
 
        # The entity where the documentation is originally attached to.
        # This gives some context to resolve identifiers or to run examples.
-       var original_mentity: nullable MEntity writable = null
+       var original_mentity: nullable MEntity = null is writable
 end
 
 redef class MEntity
        # The documentation assiciated to the entity
-       var mdoc: nullable MDoc writable
+       var mdoc: nullable MDoc is writable
 end
index 596ea9d..5cce237 100644 (file)
@@ -224,7 +224,7 @@ class MModule
        # Is the mmodule created for internal purpose?
        # Fictive module are instantied internally but they should not be
        # exposed to the final user
-       var is_fictive: Bool writable = false
+       var is_fictive: Bool = false is writable
 
        redef fun parent_concern do return mgroup
 end
index d4d2c1c..765e601 100644 (file)
@@ -1818,18 +1818,18 @@ class MMethod
 
        # Is the property defined at the top_level of the module?
        # Currently such a property are stored in `Object`
-       var is_toplevel: Bool writable = false
+       var is_toplevel: Bool = false is writable
 
        # Is the property a constructor?
        # Warning, this property can be inherited by subclasses with or without being a constructor
        # therefore, you should use `is_init_for` the verify if the property is a legal constructor for a given class
-       var is_init: Bool writable = false
+       var is_init: Bool = false is writable
 
        # The constructor is a (the) root init with empty signature but a set of initializers
-       var is_root_init: Bool writable = false
+       var is_root_init: Bool = false is writable
 
        # The the property a 'new' contructor?
-       var is_new: Bool writable = false
+       var is_new: Bool = false is writable
 
        # Is the property a legal constructor for a given class?
        # As usual, visibility is not considered.
@@ -1944,13 +1944,13 @@ class MMethodDef
        end
 
        # The signature attached to the property definition
-       var msignature: nullable MSignature writable = null
+       var msignature: nullable MSignature = null is writable
 
        # The signature attached to the `new` call on a root-init
        # This is a concatenation of the signatures of the initializers
        #
        # REQUIRE `mproperty.is_root_init == (new_msignature != null)`
-       var new_msignature: nullable MSignature writable = null
+       var new_msignature: nullable MSignature = null is writable
 
        # List of initialisers to call in root-inits
        #
@@ -1960,13 +1960,13 @@ class MMethodDef
        var initializers = new Array[MProperty]
 
        # Is the method definition abstract?
-       var is_abstract: Bool writable = false
+       var is_abstract: Bool = false is writable
 
        # Is the method definition intern?
-       var is_intern writable = false
+       var is_intern = false is writable
 
        # Is the method definition extern?
-       var is_extern writable = false
+       var is_extern = false is writable
 end
 
 # A local definition of an attribute
@@ -1982,7 +1982,7 @@ class MAttributeDef
        end
 
        # The static type of the attribute
-       var static_mtype: nullable MType writable = null
+       var static_mtype: nullable MType = null is writable
 end
 
 # A local definition of a virtual type
@@ -1998,10 +1998,10 @@ class MVirtualTypeDef
        end
 
        # The bound of the virtual type
-       var bound: nullable MType writable = null
+       var bound: nullable MType = null is writable
 
        # Is the bound fixed?
-       var is_fixed writable = false
+       var is_fixed = false is writable
 end
 
 # A kind of class.
index 20be8c3..a8a1345 100644 (file)
@@ -154,10 +154,10 @@ class MProjectDot
        end
 
        # Should groups be shown as clusters?
-       var cluster_group writable = true
+       var cluster_group = true is writable
 
        # Should projects be shown as clusters?
-       var project_group writable = true
+       var project_group = true is writable
 
        # Recursively generate noed ans clusters for a mroup
        private fun dot_cluster(o: OStream, mgroup: MGroup)
index 0b8010e..72f2114 100644 (file)
@@ -30,7 +30,7 @@ class MProject
        redef var model: Model
 
        # The root of the group tree
-       var root: nullable MGroup writable = null
+       var root: nullable MGroup = null is writable
 
        # The group tree, as a POSet
        var mgroups = new POSet[MGroup]
@@ -81,7 +81,7 @@ class MGroup
        fun is_root: Bool do return mproject.root == self
 
        # The filepath (usualy a directory) of the group, if any
-       var filepath: nullable String writable
+       var filepath: nullable String is writable
 
        init (name: String, mproject: MProject, parent: nullable MGroup)
        do
index 51c643c..12c07e3 100644 (file)
@@ -25,7 +25,7 @@ redef class MConcern
        # see: `MConcernRankSorter`
        # Use a positive booster to push down a result in the list
        # A negative booster can be used to push up the result
-       var booster_rank: Int writable = 0
+       var booster_rank: Int = 0 is writable
 
        # Concern ranking used for ordering
        # see: `MConcernRankSorter`
index 57e847b..bc82610 100644 (file)
@@ -337,7 +337,7 @@ end
 redef class MPropDef
        # Does the MPropDef contains a call to super or a call of a super-constructor?
        # Subsequent phases of the frontend (esp. typing) set it if required
-       var has_supercall: Bool writable = false
+       var has_supercall: Bool = false is writable
 end
 
 redef class AClassdef
@@ -383,7 +383,7 @@ redef class APropdef
        type MPROPDEF: MPropDef
 
        # The associated propdef once build by a `ModelBuilder`
-       var mpropdef: nullable MPROPDEF writable
+       var mpropdef: nullable MPROPDEF is writable
 
        private fun build_property(modelbuilder: ModelBuilder, mclassdef: MClassDef) is abstract
        private fun build_signature(modelbuilder: ModelBuilder) is abstract
@@ -789,9 +789,9 @@ redef class AAttrPropdef
        var mlazypropdef: nullable MAttributeDef
 
        # The associated getter (read accessor) if any
-       var mreadpropdef: nullable MMethodDef writable
+       var mreadpropdef: nullable MMethodDef is writable
        # The associated setter (write accessor) if any
-       var mwritepropdef: nullable MMethodDef writable
+       var mwritepropdef: nullable MMethodDef is writable
 
        redef fun build_property(modelbuilder, mclassdef)
        do
index 5bfd18d..dd1d2c1 100644 (file)
@@ -213,14 +213,14 @@ class ToolContext
        # A multi-line string is recommmended.
        #
        # eg. `"Usage: tool [OPTION]... [FILE]...\nDo some things."`
-       var tooldescription: String writable = "Usage: [OPTION]... [ARG]..."
+       var tooldescription: String = "Usage: [OPTION]... [ARG]..." is writable
 
        # Does `process_options` should accept an empty sequence of arguments.
        # ie. nothing except options.
        # Is `false` by default.
        #
        # If required, if should be set by the client before calling `process_options`
-       var accept_no_arguments writable = false
+       var accept_no_arguments = false is writable
 
        # print the full usage of the tool.
        # Is called by `process_option` on `--help`.
index a494875..d97bf9a 100644 (file)
@@ -26,7 +26,7 @@ class Character
 
        # The current `Career` of the character.
        # Returns `null` if character is unemployed.
-       var career: nullable Career writable = null
+       var career: nullable Career = null is writable
 
        fun quit do
                career = null