all: add `nitish` tag for code-blocks skipped by nitunit
authorJean Privat <jean@pryen.org>
Fri, 28 Nov 2014 01:51:40 +0000 (20:51 -0500)
committerJean Privat <jean@pryen.org>
Fri, 28 Nov 2014 13:40:49 +0000 (08:40 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

24 files changed:
contrib/nitiwiki/src/wiki_html.nit
lib/ai/backtrack.nit
lib/ai/examples/queens.nit
lib/ai/search.nit
lib/android/intent/intent_api10.nit
lib/android/notification/notification.nit
lib/android/sensors.nit
lib/android/shared_preferences/shared_preferences_api10.nit
lib/android/shared_preferences/shared_preferences_api11.nit
lib/android/ui.nit
lib/jvm.nit
lib/markdown/markdown.nit
lib/mnit/mnit_injected_input.nit
lib/mnit_display.nit
lib/poset.nit
lib/sax/xml_reader.nit
lib/standard/collection/abstract_collection.nit
lib/template/macro.nit
src/astbuilder.nit
src/model/model.nit
src/model_utils.nit
src/neo.nit
src/nitpretty.nit
src/transform.nit

index c984bc8..266e1d9 100644 (file)
@@ -121,15 +121,17 @@ redef class WikiSection
        #
        # The generated tree will be something like this:
        #
-       #    <ul>
-       #     <li>section 1</li>
-       #     <li>section 2
-       #      <ul>
-       #       <li>section 2.1</li>
-       #       <li>section 2.2</li>
-       #      </ul>
-       #     </li>
-       #    </ul>
+       # ~~~html
+       # <ul>
+       #  <li>section 1</li>
+       #  <li>section 2
+       #   <ul>
+       #    <li>section 2.1</li>
+       #    <li>section 2.2</li>
+       #   </ul>
+       #  </li>
+       # </ul>
+       # ~~~
        fun tpl_tree(limit: Int): Template do
                return tpl_tree_intern(limit, 1)
        end
index 0232b4c..550df10 100644 (file)
@@ -86,7 +86,7 @@ end
 # 2. Apply the method `run`, that will search and return a solution.
 # 3. Retrieve information from the solution.
 #
-# ~~~~
+# ~~~~nitish
 # var p: BacktrackProblem = new MyProblem
 # var solver = p.solve
 # var res = solver.run
index d25e129..0e86903 100644 (file)
@@ -14,7 +14,7 @@
 # The constraint is that two queens cannot be on the same row, column or diagonal.
 #
 # Eg. a solution to the 8-queens problem is
-# ~~~
+# ~~~raw
 # +--------+
 # |Q.......|
 # |....Q...|
index 21a349d..64904ee 100644 (file)
@@ -199,7 +199,7 @@ end
 # 2. Apply the method `run`, that will search and return a solution.
 # 3. Retrieve information from the solution.
 #
-# ~~~~
+# ~~~~nitish
 # var p: SearchProblem = new MyProblem
 # var res = p.astar.run
 # if res != null then print "Found plan with {res.depth} actions, that cost {res.cost}: {res.plan.join(", ")}"
index 20c85dc..005b475 100644 (file)
@@ -646,8 +646,8 @@ class Intent
 
        # The general action to be performed
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
+       # # TODO better example
        # intent.action = intent_action.view.to_s
        # ~~~
        fun action=(action: String)
@@ -667,8 +667,8 @@ class Intent
        # Add category to the intent
        # Only activities providing all of the requested categories will be used
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
+       # # TODO better example
        # intent.add_category(intent_category.home.to_s)
        # ~~~
        # Returns `self` allowing fluent programming
@@ -720,8 +720,8 @@ class Intent
 
        # Add a flag to be used by the intent
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
+       # # TODO better example
        # intent.add_flags(intent_flag.activity_new_task)
        # ~~~
        # Returns `self` allowing fluent programming
index 07d1c00..a4d34d4 100644 (file)
@@ -16,7 +16,7 @@
 
 # Services to show notification in the Android status bar
 #
-# ~~~~
+# ~~~~nitish
 # # Create and show a notification
 # var notif = new Notification("My Title", "Some content")
 # notif.ticker = "Ticker text"
@@ -25,7 +25,7 @@
 # # Update the notification
 # notif.text = "New content!"
 # notif.ongoing = true # Make it un-dismissable
-# nofif.show
+# notif.show
 #
 # # Hide the notification
 # notif.cancel
index 4c28466..a38dd60 100644 (file)
@@ -18,7 +18,8 @@
 # The sensor support is implemented in android_app module, so the user can enable the type of sensor he wants to use.
 # There is an example of how you can use the android sensors in nit/examples/mnit_ballz :
 #
-# ~~~~
+# ~~~~nitish
+# #FIXME rewrite the example
 # var app = new MyApp
 # app.sensors_support_enabled = true
 # app.accelerometer.enabled = true
index 404aaea..94aac59 100644 (file)
@@ -205,15 +205,14 @@ class SharedPreferences
        #
        # User has to manage local stack deallocation himself
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
        # var foo = new HashMap[JavaString, JavaObject]
        # # ...
        # for key, value in foo do
        #      key.delete_local_ref
        #      value.delete_local_ref
        # end
-       # ~~~
+       # ~~~
        # *You should use Nit getters instead and get each value one by one* 
        fun all: nullable HashMap[JavaString, JavaObject]
        do 
index 50d88e9..cb55acc 100644 (file)
@@ -73,10 +73,9 @@ redef class SharedPreferences
        #
        # User has to manage local stack deallocation himself
        #
-       # Example :
-       # ~~~
-       # var a_hash_set = shared_preferences.string_set("A key")
-       # ...
+       # ~~~nitish
+       # var a_hash_set = app.shared_preferences.string_set("A key")
+       # # ...
        # for element in a_hash_set do element.delete_local_ref
        # ~~~
        fun string_set(key: String): HashSet[JavaString] 
@@ -92,10 +91,9 @@ redef class SharedPreferences
        #
        # User has to manage local stack deallocation himself
        #
-       # Example :
-       # ~~~
+       # ~~~nitish
        # var foo = new HashSet[JavaString]
-       # shared_preferences.add_string_set("A key", foo)
+       # app.shared_preferences.add_string_set("A key", foo)
        # for element in foo do element.delete_local_ref
        # ~~~
        fun add_string_set(key: String, value: HashSet[JavaString]): SharedPreferences
index b4ed822..98ee444 100644 (file)
@@ -21,7 +21,7 @@
 # methods of the main thread to customize the response to a given event.
 #
 # This graph shows the path of a button click:
-# ~~~
+# ~~~raw
 #     UI Thread     #   Main thread
 #
 #       User
index 8012746..6063f23 100644 (file)
@@ -30,7 +30,8 @@ in "C Header" `{
 # Utility to select options to create the VM using `create_jvm`
 #
 # Usage example:
-# ~~~~
+#
+# ~~~~nitish
 # var builder = new JavaVMBuilder
 # builder.options.add "-Djava.class.path=."
 # var jvm = builder.create_jvm
index 2f675d6..3d0a0a1 100644 (file)
@@ -555,9 +555,9 @@ end
 # A Link Reference.
 # Links that are specified somewhere in the mardown document to be reused as shortcuts.
 #
-# Example:
-#
-#    [1]: http://example.com/ "Optional title"
+# ~~~raw
+# [1]: http://example.com/ "Optional title"
+# ~~~
 class LinkRef
 
        # Link href
index a72b34d..9d8a819 100644 (file)
@@ -24,7 +24,7 @@
 #
 # The input event file is made of event descriptions, one event by line.
 #
-# ~~~
+# ~~~raw
 # 10 click 10.0 20.0
 # 20 quit
 # ~~~
index 7e474b7..fad361e 100644 (file)
@@ -84,7 +84,7 @@ interface Drawable
        # Draw image by specifying the positon of each image corners
        # Corners are in counter-clockwise order stating top left
        # a is top left, b is bottom left, c is bottom right and d is top right
-       # ~~~
+       # ~~~raw
        # a-d
        # | |
        # b-c
index 9549e48..cb4fa87 100644 (file)
@@ -52,12 +52,14 @@ class POSet[E: Object]
        # Return a view of `e` in the poset.
        # This allows to asks manipulate elements in thier relation with others elements.
        #
-       #     var poset: POSet[Something] # ...
-       #     for x in poset do
-       #         for y in poset[x].direct_greaters do
-       #             print "{x} -> {y}"
-       #         end
+       # ~~~nitish
+       # var poset: POSet[Something] # ...
+       # for x in poset do
+       #     for y in poset[x].direct_greaters do
+       #         print "{x} -> {y}"
        #     end
+       # end
+       # ~~~
        #
        # REQUIRE: has(e)
        fun [](e: E): POSetElement[E]
@@ -240,13 +242,15 @@ end
 #
 # For instance, one common usage is to add a specific attribute for each poset a class belong.
 #
-#     class Thing
-#         var in_some_relation: POSetElement[Thing]
-#         var in_other_relation: POSetElement[Thing]
-#     end
-#     var t: Thing # ...
-#     t.in_some_relation.greaters
-#
+# ~~~nitish
+# class Thing
+#     var in_some_relation: POSetElement[Thing]
+#     var in_other_relation: POSetElement[Thing]
+# end
+# var t: Thing
+# # ...
+# t.in_some_relation.greaters
+# ~~~
 class POSetElement[E: Object]
        # The poset self belong to
        var poset: POSet[E]
index c158532..6f80e77 100644 (file)
@@ -275,9 +275,11 @@ interface XMLReader
        # document from a system identifier. It is the exact
        # equivalent of the following:
        #
-       #     var source = new InputSouce
-       #     source.system_id = system_id
-       #     parse(source)
+       # ~~~nitish
+       # var source = new InputSouce
+       # source.system_id = system_id
+       # parse(source)
+       # ~~~
        #
        # If the system identifier is a URL, it must be fully resolved
        # by the application before it is passed to the parser.
index fa16295..3b7f908 100644 (file)
@@ -33,25 +33,29 @@ import kernel
 # Subclasses often provide a more efficient implementation.
 #
 # Because of the `iterator` method, Collections instances can use
-# the `for` control structure:
+# the `for` control structure.
 #
-#         var x: Collection[U]
-#         # ...
-#         for u in x do
-#             # u is a U
-#             # ...
-#         end
+# ~~~nitish
+# var x: Collection[U]
+# # ...
+# for u in x do
+#     # u is a U
+#     # ...
+# end
+# ~~~
 #
-# that is equivalent with
+# that is equivalent with the following:
 #
-#         var x: Collection[U]
-#         # ...
-#         var i = x.iterator
-#         while i.is_ok do
-#             var u = i.item # u is a U
-#             # ...
-#             i.next
-#         end
+# ~~~nitish
+# var x: Collection[U]
+# # ...
+# var i = x.iterator
+#     while i.is_ok do
+#     var u = i.item # u is a U
+#     # ...
+#     i.next
+# end
+# ~~~
 interface Collection[E]
        # Get a new iterator on the collection.
        fun iterator: Iterator[E] is abstract
index 0b1c9e4..2796a3c 100644 (file)
@@ -47,16 +47,18 @@ import template
 #
 # In external file `example.tpl`:
 #
-#    <!DOCTYPE html>
-#    <html lang="en">
-#     <head>
-#      <title>%TITLE%</title>
-#     </head>
-#     <body>
-#      <h1>%TITLE%</h1>
-#      <p>%ARTICLE%</p>
-#     </body>
-#    </html>
+# ~~~html
+# <!DOCTYPE html>
+# <html lang="en">
+#  <head>
+#   <title>%TITLE%</title>
+#  </head>
+#  <body>
+#   <h1>%TITLE%</h1>
+#   <p>%ARTICLE%</p>
+#  </body>
+# </html>
+# ~~~
 #
 # Loading the template file using `TemplateString`:
 #
index 620bf49..8aa0295 100644 (file)
@@ -134,11 +134,13 @@ redef class AExpr
        # To create the new node `n`, we need to attach the child to it.
        # But, to put `n` where `c` was in `p`, the place has to be remembered.
        #
-       #     var p: AExpr
-       #     var c = p.c
-       #     var h = c.detach_with_placeholder
-       #     var n = astbuilder.make_XXX(c)
-       #     h.replace_with(n)
+       # ~~~nitish
+       # var p: AExpr
+       # var c = p.c
+       # var h = c.detach_with_placeholder
+       # var n = astbuilder.make_XXX(c)
+       # h.replace_with(n)
+       # ~~~
        fun detach_with_placeholder: AExpr
        do
                var h = new APlaceholderExpr.make
index e709a6f..9be5738 100644 (file)
@@ -773,9 +773,13 @@ abstract class MType
        # In Nit, for each super-class of a type, there is a equivalent super-type.
        #
        # Example:
+       #
+       # ~~~nitish
        #     class G[T, U] end
        #     class H[V] super G[V, Bool] end
+       #
        # H[Int]  supertype_to  G  #->  G[Int, Bool]
+       # ~~~
        #
        # REQUIRE: `super_mclass` is a super-class of `self`
        # REQUIRE: `self.need_anchor implies anchor != null and self.can_resolve_for(anchor, null, mmodule)`
@@ -809,9 +813,11 @@ abstract class MType
        #
        # ## Example 1
        #
-       #     class G[E] end
-       #     class H[F] super G[F] end
-       #     class X[Z] end
+       # ~~~
+       # class G[E] end
+       # class H[F] super G[F] end
+       # class X[Z] end
+       # ~~~
        #
        #  * Array[E].resolve_for(H[Int])  #->  Array[Int]
        #  * Array[E].resolve_for(G[Z], X[Int]) #->  Array[Z]
@@ -829,30 +835,34 @@ abstract class MType
        #
        # ## Example 2
        #
-       #     class A[E]
-       #         fun foo(e:E):E is abstract
-       #     end
-       #     class B super A[Int] end
+       # ~~~
+       # class A[E]
+       #     fun foo(e:E):E is abstract
+       # end
+       # class B super A[Int] end
+       # ~~~
        #
        # The signature on foo is (e: E): E
        # If we resolve the signature for B, we get (e:Int):Int
        #
        # ## Example 3
        #
-       #     class A[E]
-       #         fun foo(e:E) is abstract
-       #     end
-       #     class B[F]
-       #         var a: A[Array[F]]
-       #         fun bar do a.foo(x) # <- x is here
-       #     end
+       # ~~~nitish
+       # class A[E]
+       #     fun foo(e:E):E is abstract
+       # end
+       # class C[F]
+       #     var a: A[Array[F]]
+       #     fun bar do a.foo(x) # <- x is here
+       # end
+       # ~~~
        #
        # The first question is: is foo available on `a`?
        #
        # The static type of a is `A[Array[F]]`, that is an open type.
        # in order to find a method `foo`, whe must look at a resolved type.
        #
-       #   A[Array[F]].anchor_to(B[nullable Object])  #->  A[Array[nullable Object]]
+       #   A[Array[F]].anchor_to(C[nullable Object])  #->  A[Array[nullable Object]]
        #
        # the method `foo` exists in `A[Array[nullable Object]]`, therefore `foo` exists for `a`.
        #
@@ -860,7 +870,7 @@ abstract class MType
        #
        # the signature of `foo` is `foo(e:E)`, thus we must resolve the type E
        #
-       #   E.resolve_for(A[Array[F]],B[nullable Object])  #->  Array[F]
+       #   E.resolve_for(A[Array[F]],C[nullable Object])  #->  Array[F]
        #
        # The resolution can be done because `E` make sense for the class A (see `can_resolve_for`)
        #
index 9297793..7af444d 100644 (file)
@@ -535,7 +535,9 @@ end
 #
 # Comparison is made with the formula:
 #
-#     a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~nitish
+# a.concern_rank + a.booster_rank <=> b.concern_rank + b.booster_ran
+# ~~~
 #
 # If both `a` and `b` have the same ranking,
 # ordering is based on lexicographic comparison of `a.name` and `b.name`
index a566f31..eebd408 100644 (file)
 #
 # For example, if the source code contains:
 #
+# ~~~nitish
 #     fun foo(a: A, b: B, c: C)
+# ~~~
 #
 # The `MSignature` node will contain a property
 # `parameter_names = ["a", "b", "c"]` so the MSignature can be reconstructed
index 32294c2..141ef1b 100644 (file)
 # `Licence comments` are attached to the top of the file
 # no blank line before, one after.
 #
-#     # This is a licence comment
+# ~~~nitish
+# # This is a licence comment
 #
-#     # Documentation for module `foo`
-#     module foo
+# # Documentation for module `foo`
+# module foo
+# ~~~
 #
 # `ADoc` are documentation comments attached to a `AModule`, `AClassdef`, `APropdef`.
 #
 # They are printed before the definition with a blank line before and no after
 # at the same indentation level than the definition.
 #
-#     # Documentation for module `foo`
-#     module foo
+# ~~~nitish
+# # Documentation for module `foo`
+# module foo
 #
-#     # Documentation for class `Bar`
-#     class Bar
-#          # Documentation for method `baz`
-#          fun baz do end
-#     end
+# # Documentation for class `Bar`
+# class Bar
+#      # Documentation for method `baz`
+#      fun baz do end
+# end
+# ~~~
 #
 # `Block comments` are comments composed of one or more line rattached to nothing.
 # They are displayed with one blank line before and after at current indent level.
 #
-#     <blank>
-#     # block
-#     # comment
-#     <blank>
+# ~~~nitish
+# <blank>
+# # block
+# # comment
+# <blank>
+# ~~~
 #
 # `Attached comments` are comments attached to a production.
 # They are printed as this.
 #
-#     fun foo do # attached comment
-#     end
+# ~~~nitish
+# fun foo do # attached comment
+# end
+# ~~~
 #
 # `nitpretty` automatically remove multiple blanks between comments:
 #
-#     # Licence
-#     # ...
-#     <blank>
-#     # Block comment
+# ~~~nitish
+# # Licence
+# # ...
+# <blank>
+# # Block comment
+# ~~~
 #
 # ### Inlining
 #
 # * There is a blank between each class definition
 # * There is no blank line at the end of the module
 #
-#     # Documentation for module `foo`
-#     module foo
+# ~~~nitish
+# # Documentation for module `foo`
+# module foo
 #
-#     import a
-#     # import b
-#     import c
+# import a
+# # import b
+# import c
 #
-#     # Documentation for class `Bar`
-#     class Bar end
+# # Documentation for class `Bar`
+# class Bar end
 #
-#     class Baz end # not a `ADoc` comment
+# class Baz end # not a `ADoc` comment
+# ~~~
 #
 #
 # ### Classes
 # * There is a blank between each block definition
 # * There no blank line at the end of the class definition
 #
-#     # Documentation for class `Bar`
-#     class Bar end
+# ~~~nitish
+# # Documentation for class `Bar`
+# class Bar end
 #
-#     class Baz
-#          super Bar
+# class Baz
+#     super Bar
 #
-#          fun a is abstract
-#          private fun b do end
+#      fun a is abstract
+#      private fun b do end
 #
-#          fun c do
-#               # ...
-#          end
-#     end
+#      fun c do
+#           # ...
+#      end
+# end
+# ~~~
 #
-# Generic types have no espace after or before brackets and are separated by a comma and a space:
+# Generic types have no space after or before brackets and are separated by a comma and a space:
 #
-#     class A[E: Type1, F: Type1] do end
+# ~~~nitish
+# class A[E: Type1, F: Type1] end
+# ~~~
 #
 # ### Blocks
 #
 # * Inlined productions have no blank lines between them
 # * Block productions have a blank before and after
 #
-#     var a = 10
-#     var b = 0
+# ~~~nitish
+# var a = 10
+# var b = 0
 #
-#     if a > b then
-#          # is positive
-#          print "positive"
-#     end
+# if a > b then
+#      # is positive
+#      print "positive"
+# end
 #
-#     print "end"
+# print "end"
+# ~~~
 #
 # ### Calls and Binary Ops
 #
 # Arguments are always printed separated with a comma and a space:
 #
-#     foo(a, b, c)
+# ~~~nitish
+# foo(a, b, c)
+# ~~~
 #
 # Binary ops are always printed wrapped with spaces:
 #
-#     var c = 1 + 2
+# ~~~nitish
+# var c = 1 + 2
+# ~~~
 #
 # Calls and binary ops can be splitted to fit the `max-size` constraint.
 # Breaking priority is given to arguments declaration after the comma.
 #
-#     return foo("aaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbb",
-#        "cccccccccccccccccccccccccc")
+# ~~~nitish
+# return foo("aaaaaaaaaaaaaaaaaaaaaaaaaa", "bbbbbbbbbbbbbbbbbbbbbbbbbbb",
+#     "cccccccccccccccccccccccccc")
+# ~~~
 #
 # Binary ops can also be broken to fit the `max-size` limit:
 #
-#     return "aaaaaaaaaaaaaaaaaaaaaaaaaa" + "bbbbbbbbbbbbbbbbbbbbbbbbbbb" +
-#        "cccccccccccccccccccccccccc"
-#
+# ~~~nitish
+# return "aaaaaaaaaaaaaaaaaaaaaaaaaa" + "bbbbbbbbbbbbbbbbbbbbbbbbbbb" +
+#     "cccccccccccccccccccccccccc"
+# ~~~
 module nitpretty
 
 import template
index 2212380..07acefb 100644 (file)
@@ -272,10 +272,12 @@ end
 redef class AArrayExpr
        # `[x,y]` is replaced with
        #
-       #     var t = new Array[X].with_capacity(2)
-       #     t.add(x)
-       #     t.add(y)
-       #     t
+       # ~~~nitish
+       # var t = new Array[X].with_capacity(2)
+       # t.add(x)
+       # t.add(y)
+       # t
+       # ~~~
        redef fun accept_transform_visitor(v)
        do
                var nblock = v.builder.make_block
@@ -323,11 +325,15 @@ end
 redef class ASendReassignFormExpr
        # `x.foo(y)+=z` is replaced with
        #
-       #     x.foo(y) = x.foo(y) + z
+       # ~~~nitish
+       # x.foo(y) = x.foo(y) + z
+       # ~~~
        #
        # witch is, in reality:
        #
-       #     x."foo="(y, x.foo(y)."+"(z))
+       # ~~~nitish
+       # x."foo="(y, x.foo(y)."+"(z))
+       # ~~~
        redef fun accept_transform_visitor(v)
        do
                var nblock = v.builder.make_block