Merge: gitignore: ignore nit_compile folders and contents
authorJean Privat <jean@pryen.org>
Fri, 6 Apr 2018 02:04:36 +0000 (22:04 -0400)
committerJean Privat <jean@pryen.org>
Fri, 6 Apr 2018 02:04:36 +0000 (22:04 -0400)
nit_compile are a series of generated intermediate C files that should
not be versioned.

We therefore add them to the .gitignore to eliminate them from the
index.

Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>

Pull-Request: #2627
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

41 files changed:
lib/console.nit
lib/core/posix.nit
lib/curl/curl.nit
lib/curl/native_curl.nit
lib/popcorn/examples/middlewares/tests/test_example_advanced_logger.res
lib/rubix.nit
share/android-bdwgc/setup.sh
share/man/nitpm.md [new file with mode: 0644]
share/man/picnit.md [deleted file]
src/Makefile
src/compiler/abstract_compiler.nit
src/loader.nit
src/nitpm.nit [moved from src/picnit.nit with 54% similarity]
src/nitpm_shared.nit [new file with mode: 0644]
tests/niti.skip
tests/nitpm.args [new file with mode: 0644]
tests/nitvm.skip
tests/picnit.args [deleted file]
tests/sav/neo_doxygen_dump.res
tests/sav/nitlight_args4.res
tests/sav/nitls_args1.res
tests/sav/nitls_args2.res
tests/sav/nitls_args3.res
tests/sav/nitls_args4.res
tests/sav/nitls_args6.res
tests/sav/nitls_args7.res
tests/sav/nitls_args8.res
tests/sav/nitpm.res [new file with mode: 0644]
tests/sav/nitpm_args2.res [new file with mode: 0644]
tests/sav/nitpm_args3.res [moved from tests/sav/picnit_args4.res with 100% similarity]
tests/sav/nitpm_args5.res [new file with mode: 0644]
tests/sav/nitpm_args8.res [new file with mode: 0644]
tests/sav/picnit.res [deleted file]
tests/sav/picnit_args2.res [deleted file]
tests/sav/picnit_args3.res [deleted file]
tests/sav/picnit_args5.res [deleted file]
tests/sav/test_catch_multi_threaded.res [new file with mode: 0644]
tests/sav/test_parser_args1.res
tests/sav/test_parser_args6.res
tests/sav/test_parser_args7.res
tests/test_catch_multi_threaded.nit [moved from src/picnit_shared.nit with 50% similarity]

index b8fe277..1a68ff3 100644 (file)
 # limitations under the License.
 
 # Defines some ANSI Terminal Control Escape Sequences.
+#
+# The color methods (e.g. `Text::green`) format the text to appear colored
+# in a ANSI/VT100 terminal. By default, this coloring is skipped if stdout
+# is not a TTY, but it can be forced by setting `force_console_colors = true`.
 module console
 
 # A ANSI/VT100 escape sequence.
@@ -60,7 +64,7 @@ class TermMoveDown
        redef fun code do return "B"
 end
 
-# ANSI/VT100 code to move the cursor foward by `magnitude` columns (CUF).
+# ANSI/VT100 code to move the cursor forward by `magnitude` columns (CUF).
 class TermMoveFoward
        super TermDirectionalMove
 
@@ -189,7 +193,7 @@ class TermCharFormat
                attributes.add_all(format.attributes)
        end
 
-       redef fun to_s: String do return "{csi}{attributes.join(";")}m"
+       redef fun to_s do return "{csi}{attributes.join(";")}m"
 
        # Apply the specified SGR and return `self`.
        private fun apply(sgr: String): TermCharFormat do
@@ -215,7 +219,7 @@ class TermCharFormat
        # Apply normal weight and return `self`.
        fun normal_weight: TermCharFormat do return apply("22")
 
-       # Add the attribute that disable inderlining and return `self`.
+       # Add the attribute that disable underlining and return `self`.
        fun not_underlined: TermCharFormat do return apply("24")
 
        # Add the attribute that disable blinking and return `self`.
@@ -239,7 +243,7 @@ class TermCharFormat
        # Apply a blue foreground and return `self`.
        fun blue_fg: TermCharFormat do return apply("34")
 
-       # Apply a mangenta foreground and return `self`.
+       # Apply a magenta foreground and return `self`.
        fun magenta_fg: TermCharFormat do return apply("35")
 
        # Apply a cyan foreground and return `self`.
@@ -251,94 +255,96 @@ class TermCharFormat
        # Apply the default foreground and return `self`.
        fun default_fg: TermCharFormat do return apply("39")
 
-       # Apply a black backgroud and return `self`.
+       # Apply a black background and return `self`.
        fun black_bg: TermCharFormat do return apply("40")
 
-       # Apply a red backgroud and return `self`.
+       # Apply a red background and return `self`.
        fun red_bg: TermCharFormat do return apply("41")
 
-       # Apply a green backgroud and return `self`.
+       # Apply a green background and return `self`.
        fun green_bg: TermCharFormat do return apply("42")
 
-       # Apply a yellow backgroud and return `self`.
+       # Apply a yellow background and return `self`.
        fun yellow_bg: TermCharFormat do return apply("43")
 
-       # Apply a blue backgroud and return `self`.
+       # Apply a blue background and return `self`.
        fun blue_bg: TermCharFormat do return apply("44")
 
-       # Apply a mangenta backgroud and return `self`.
+       # Apply a magenta background and return `self`.
        fun magenta_bg: TermCharFormat do return apply("45")
 
-       # Apply a cyan backgroud and return `self`.
+       # Apply a cyan background and return `self`.
        fun cyan_bg: TermCharFormat do return apply("46")
 
-       # Apply a white backgroud and return `self`.
+       # Apply a white background and return `self`.
        fun white_bg: TermCharFormat do return apply("47")
 
-       # Apply the default backgroud and return `self`.
+       # Apply the default background and return `self`.
        fun default_bg: TermCharFormat do return apply("49")
 end
 
-# Redefine the `String` class to add functions to color the string.
-redef class String
+# Services to color terminal output
+redef class Text
        private fun apply_format(f: TermCharFormat): String do
-               return "{f}{self}{normal}"
+               if stdout_isatty or force_console_colors then
+                       return "{f}{self}{normal}"
+               else return to_s
        end
 
        private fun normal: TermCharFormat do return new TermCharFormat
 
        # Make the text appear in dark gray (or black) in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun gray: String do return apply_format(normal.black_fg)
 
        # Make the text appear in red in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun red: String do return apply_format(normal.red_fg)
 
        # Make the text appear in green in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun green: String do return apply_format(normal.green_fg)
 
        # Make the text appear in yellow in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun yellow: String do return apply_format(normal.yellow_fg)
 
        # Make the text appear in blue in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun blue: String do return apply_format(normal.blue_fg)
 
-       # Make the text appear in mangenta in a ANSI/VT100 terminal.
+       # Make the text appear in magenta in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun purple: String do return apply_format(normal.magenta_fg)
 
        # Make the text appear in cyan in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun cyan: String do return apply_format(normal.cyan_fg)
 
        # Make the text appear in light gray (or white) in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun light_gray: String do return apply_format(normal.white_fg)
 
        # Make the text appear in bold in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun bold: String do return apply_format(normal.bold)
 
        # Make the text underlined in a ANSI/VT100 terminal.
        #
-       # WARNING: SEE: `TermCharFormat`
+       # SEE: `TermCharFormat`
        fun underline: String do return apply_format(normal.underline)
 end
 
-# A dynamic progressbar displayable in console.
+# A dynamic progress bar displayable in console.
 #
 # Example:
 # ~~~nitish
@@ -355,7 +361,7 @@ end
 # print "\ndone"
 # ~~~
 #
-# Progressbar can accept metadata to display a small amount of data.
+# Progress bar can accept metadata to display a small amount of data.
 #
 # Example with metadata:
 # ~~~nitish
@@ -383,7 +389,7 @@ class TermProgress
        # Display the progress bar.
        #
        # `metadata`  can be used to pass a small amount of data to display after
-       # the progressbar.
+       # the progress bar.
        fun display(metadata: nullable String) do
                var percent = current_percentage
                var p = current_value * max_columns / max_value
@@ -401,7 +407,7 @@ class TermProgress
                if metadata != null then printn " ({metadata})"
        end
 
-       # Update and display the progresssbar.
+       # Update and display the progress bar.
        #
        # See `display`.
        fun update(new_current: Int, metadata: nullable String) do
@@ -409,3 +415,12 @@ class TermProgress
                display(metadata)
        end
 end
+
+redef class Sys
+       private var stdout_isatty: Bool = 1.isatty is lazy
+
+       # Force coloring terminal output, even if stdout is not a TTY?
+       #
+       # Defaults to `false`.
+       var force_console_colors = false is writable
+end
index 2969830..587e606 100644 (file)
@@ -111,3 +111,8 @@ extern class Group `{struct group*`}
                return ret;
        `}
 end
+
+redef class Int
+       # Does the file descriptor `self` refer to a terminal?
+       fun isatty: Bool `{ return isatty(self); `}
+end
index 57a2423..64fbff2 100644 (file)
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Data transfer with URL syntax
+# Data transfer powered by the native curl library
 #
 # Download or upload over HTTP with `CurlHTTPRequest` and send emails with `CurlMail`.
 module curl
@@ -116,6 +116,12 @@ class CurlHTTPRequest
        # Set the user agent for all following HTTP requests
        var user_agent: nullable String is writable
 
+       # Set the Unix domain socket path to use
+       #
+       # When not null, enables using a Unix domain socket
+       # instead of a TCP connection and DNS hostname resolution.
+       var unix_socket_path: nullable String is writable
+
        # Execute HTTP request
        #
        # By default, the response body is returned in an instance of `CurlResponse`.
@@ -142,6 +148,12 @@ class CurlHTTPRequest
                        if not err.is_ok then return answer_failure(err.to_i, err.to_s)
                end
 
+               var unix_socket_path = unix_socket_path
+               if unix_socket_path != null then
+                       err = self.curl.native.easy_setopt(new CURLOption.unix_socket_path, unix_socket_path)
+                       if not err.is_ok then return answer_failure(err.to_i, err.to_s)
+               end
+
                # Callbacks
                err = self.curl.native.register_callback_header(callback_receiver)
                if not err.is_ok then return answer_failure(err.to_i, err.to_s)
index 1f5cd11..d3ed43a 100644 (file)
@@ -89,7 +89,7 @@ extern class NativeCurl `{ CURL * `}
                if obj isa Int then return native_setopt_int(opt, obj)
                if obj == true then return native_setopt_int(opt, 1)
                if obj == false then return native_setopt_int(opt, 0)
-               if obj isa String then return native_setopt_string(opt, obj)
+               if obj isa String then return native_setopt_string(opt, obj.to_cstring)
                if obj isa FileWriter then return native_setopt_file(opt, obj._file.as(not null))
                if obj isa CURLSList then return native_setopt_slist(opt, obj)
                return once new CURLCode.unknown_option
@@ -107,9 +107,8 @@ extern class NativeCurl `{ CURL * `}
        private fun native_setopt_slist(opt: CURLOption, list: CURLSList): CURLCode `{ return curl_easy_setopt( self, opt, list); `}
 
        # Internal method to set options to CURL using String parameter.
-       private fun native_setopt_string(opt: CURLOption, str: String): CURLCode import String.to_cstring `{
-               char *rStr = String_to_cstring(str);
-               return curl_easy_setopt( self, opt, rStr);
+       private fun native_setopt_string(opt: CURLOption, str: CString): CURLCode `{
+               return curl_easy_setopt( self, opt, str);
        `}
 
        # Request Chars internal information from the CURL session
@@ -121,7 +120,7 @@ extern class NativeCurl `{ CURL * `}
                 return answ.item.to_s
        end
 
-       # Internal method used to get String object information initially knowns as C Chars type
+       # Internal method used to get String object information initially known as C Chars type
        private fun native_getinfo_chars(opt: CURLInfoChars, res: Ref[CString]): CURLCode
        import Ref[CString].item= `{
                char *r;
@@ -753,6 +752,10 @@ extern class CURLOption `{ CURLoption `}
 #      new     `{ return CURLOPT_SSH_KEYFUNCTION; `}
 #      new     `{ return CURLOPT_SSH_KEYDATA; `}
 
+       # TELNET Options
+
+#      new     `{ return CURLOPT_TELNETOPTIONS; `}
+
        # Other Options
 
 #      new     `{ return CURLOPT_PRIVATE; `}
@@ -760,7 +763,6 @@ extern class CURLOption `{ CURLoption `}
 #      new     `{ return CURLOPT_NEW_FILE_PERMS; `}
 #      new     `{ return CURLOPT_NEW_DIRECTORY_PERMS; `}
 
-       # TELNET Options
-
-#      new     `{ return CURLOPT_TELNETOPTIONS; `}
+       # Set the Unix domain socket
+       new unix_socket_path `{ return CURLOPT_UNIX_SOCKET_PATH; `}
 end
index ac28033..55cf4e1 100644 (file)
@@ -1,9 +1,9 @@
 
 [Client] curl -s localhost:*****/
-GET / \e[32m200\e[m (0.0s)
+GET / 200 (0.0s)
 Hello World!
 [Client] curl -s localhost:*****/about
-GET /about \e[33m404\e[m (0.0s)
+GET /about 404 (0.0s)
                <!DOCTYPE html>
                <html>
                <head>
index 8e63784..51cb05e 100644 (file)
@@ -664,3 +664,5 @@ class RubixCube
                return iters
        end
 end
+
+redef fun force_console_colors do return true
index fcfbab3..7ea0c27 100755 (executable)
@@ -20,9 +20,9 @@ cd "`dirname "${BASH_SOURCE[0]}"`"
 
 # Download or redownload
 rm -rf bdwgc
-git clone -b android https://github.com/xymus/bdwgc.git || exit 1
+git clone --depth=1 -b android https://github.com/xymus/bdwgc.git || exit 1
 
 # Setup libatomic_ops too
 cd bdwgc || exit 1
 git submodule init || exit 1
-git submodule update || exit 1
+git submodule update --depth=1 || exit 1
diff --git a/share/man/nitpm.md b/share/man/nitpm.md
new file mode 100644 (file)
index 0000000..b0f222f
--- /dev/null
@@ -0,0 +1,63 @@
+# NAME
+
+nitpm - Nit package manager
+
+# SYNOPSIS
+
+nitpm [--help] [--verbose] <command> [<args>]
+
+# OPTIONS
+
+### `-h`, `--help`
+Show help message.
+
+### `-v`, `--verbose`
+Print more information.
+
+# COMMANDS
+
+### `install`
+Install packages by name, Git repository address or from the local package.ini.
+
+       # Search and install package by name, e.g. hello_nitpm:
+       nitpm install hello_nitpm
+
+       # Install package from a Git repository:
+       nitpm install https://gitlab.com/xymus/hello_nitpm.git
+
+       # Search and install a specific branch or tag of a package, e.g. 1.0:
+       nitpm install nitpm_test_versions=1.0
+
+       # Install all packages declared in the local package.ini file:
+       nitpm install
+
+To support the last command, the package.ini file should list the required packages after `[package]` on an `import=` line:
+
+       [package]
+       name=my_package
+       import=nitpm_test_versions=1.0,gamnit
+
+### `list`
+List installed packages.
+
+       nitpm list
+
+### `upgrade`
+Upgrade a package.
+
+       nitpm upgrade hello_nitpm
+
+### `uninstall`
+Uninstall packages.
+
+       nitpm uninstall hello_nitpm
+
+### `help`
+Show general help message or the help for a command.
+
+       nitpm help
+       nitpm help install
+
+# SEE ALSO
+
+The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>
diff --git a/share/man/picnit.md b/share/man/picnit.md
deleted file mode 100644 (file)
index 6b353d1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-# NAME
-
-picnit - Nit package manager
-
-# SYNOPSIS
-
-picnit [--help] [--verbose] <command> [<args>]
-
-# OPTIONS
-
-### `-h`, `--help`
-
-Show the help message.
-
-### `-v`, `--verbose`
-
-Print more information, may be useful for debugging.
-
-# COMMANDS
-
-### install
-
-Install a package by searching for its name or directly from a Git repository URL.
-
-       picnit install hello_picnit
-       picnit install https://gitlab.com/xymus/hello_picnit.git
-
-### list
-
-List installed packages.
-
-       picnit list
-
-### upgrade
-
-Upgrade a package.
-
-       picnit upgrade hello_picnit
-
-### uninstall
-
-Uninstall a package.
-
-       picnit uninstall hello_picnit
-
-### help
-
-Show general help message or the help for a command.
-
-       picnit help
-       picnit help install
-
-# SEE ALSO
-
-The Nit language documentation and the source code of its tools and libraries may be downloaded from <http://nitlanguage.org>
index 96ac02e..8d3b867 100644 (file)
@@ -16,7 +16,7 @@
 
 NITCOPT=--semi-global
 OLDNITCOPT=--semi-global
-OBJS=nitc nitpick nit nitls nitunit picnit nitx nitlight nitserial nitrestful
+OBJS=nitc nitpick nit nitls nitunit nitpm nitx nitlight nitserial nitrestful
 SRCS=$(patsubst %,%.nit,$(OBJS))
 BINS=$(patsubst %,../bin/%,$(OBJS))
 MOREOBJS=nitdoc nitweb nitcatalog nitmetrics nitpretty nitweb
index d93eba1..11e4790 100644 (file)
@@ -767,9 +767,10 @@ abstract class AbstractCompiler
                self.header.add_decl """
 struct catch_stack_t {
        int cursor;
-       jmp_buf envs[100];
+       int currentSize;
+       jmp_buf *envs;
 };
-extern struct catch_stack_t catchStack;
+extern __thread struct catch_stack_t catchStack;
 """
        end
 
@@ -870,7 +871,7 @@ extern void nitni_global_ref_decr( struct nitni_ref *ref );
                v.add_decl("int glob_argc;")
                v.add_decl("char **glob_argv;")
                v.add_decl("val *glob_sys;")
-               v.add_decl("struct catch_stack_t catchStack;")
+               v.add_decl("__thread struct catch_stack_t catchStack = \{-1, 0, NULL\};")
 
                if self.modelbuilder.toolcontext.opt_typing_test_metrics.value then
                        for tag in count_type_test_tags do
@@ -971,7 +972,6 @@ extern void nitni_global_ref_decr( struct nitni_ref *ref );
                v.add "#endif"
 
                v.add("glob_argc = argc; glob_argv = argv;")
-               v.add("catchStack.cursor = -1;")
                v.add("initialize_gc_option();")
 
                v.add "initialize_nitni_global_refs();"
@@ -3504,6 +3504,14 @@ redef class ADoExpr
        redef fun stmt(v)
        do
                if self.n_catch != null then
+                       v.add("if(catchStack.currentSize == 0) \{")
+                       v.add("         catchStack.cursor = -1;")
+                       v.add("         catchStack.currentSize = 100;")
+                       v.add("         catchStack.envs = malloc(sizeof(jmp_buf)*100);")
+                       v.add("\} else if(catchStack.cursor == catchStack.currentSize - 1) \{")
+                       v.add("         catchStack.currentSize *= 2;")
+                       v.add("         catchStack.envs = realloc(catchStack.envs, sizeof(jmp_buf)*catchStack.currentSize);")
+                       v.add("\}")
                        v.add("catchStack.cursor += 1;")
                        v.add("if(!setjmp(catchStack.envs[catchStack.cursor]))\{")
                        v.stmt(self.n_block)
index f18d7be..8bdfcb2 100644 (file)
@@ -39,7 +39,7 @@ module loader
 
 import modelbuilder_base
 import ini
-import picnit_shared
+import nitpm_shared
 
 redef class ToolContext
        # Option --path
@@ -66,9 +66,9 @@ redef class ModelBuilder
                # Setup the paths value
                paths.append(toolcontext.opt_path.value)
 
-               # Packages managed by picnit, only use when not testing with tests.sh
+               # Packages managed by nitpm, only use when not testing with tests.sh
                if "NIT_TESTING_TESTS_SH".environ != "true" then
-                       paths.add picnit_lib_dir
+                       paths.add nitpm_lib_dir
                end
 
                var path_env = "NIT_PATH".environ
@@ -255,6 +255,11 @@ redef class ModelBuilder
                        end
                end
 
+               if mgroup != null then
+                       var alias = mgroup.mpackage.import_alias(name)
+                       if alias != null then name = alias
+               end
+
                var loc = null
                if anode != null then loc = anode.hot_location
                var candidate = search_module_in_paths(loc, name, lookpaths)
@@ -287,6 +292,11 @@ redef class ModelBuilder
        # If found, the module is returned.
        private fun search_module_in_paths(location: nullable Location, name: String, lookpaths: Collection[String]): nullable MModule
        do
+               var name_no_version
+               if name.has('=') then
+                       name_no_version = name.split('=').first
+               else name_no_version = name
+
                var res = new ArraySet[MModule]
                for dirname in lookpaths do
                        # Try a single module file
@@ -296,7 +306,7 @@ redef class ModelBuilder
                        var g = identify_group((dirname/name).simplify_path)
                        if g != null then
                                scan_group(g)
-                               res.add_all g.mmodules_by_name(name)
+                               res.add_all g.mmodules_by_name(name_no_version)
                        end
                end
                if res.is_empty then return null
@@ -826,7 +836,7 @@ redef class ModelBuilder
        # Resolve the module identification for a given `AModuleName`.
        #
        # This method handles qualified names as used in `AModuleName`.
-       fun seach_module_by_amodule_name(n_name: AModuleName, mgroup: nullable MGroup): nullable MModule
+       fun search_module_by_amodule_name(n_name: AModuleName, mgroup: nullable MGroup): nullable MModule
        do
                var mod_name = n_name.n_id.text
 
@@ -860,6 +870,13 @@ redef class ModelBuilder
                # If no module yet, then assume that the first element of the path
                # Is to be searched in the path.
                var root_name = n_name.n_path.first.text
+
+               # Search for an alias in required external packages
+               if mgroup != null then
+                       var alias = mgroup.mpackage.import_alias(root_name)
+                       if alias != null then root_name = alias
+               end
+
                var roots = search_group_in_paths(root_name, paths)
                if roots.is_empty then
                        error(n_name, "Error: cannot find `{root_name}`. Tried: {paths.join(", ")}.")
@@ -889,7 +906,7 @@ redef class ModelBuilder
        # Basically it check that `bar::foo` matches `bar/foo.nit` and `bar/baz/foo.nit`
        # but not `baz/foo.nit` nor `foo/bar.nit`
        #
-       # Is used by `seach_module_by_amodule_name` to validate qualified names.
+       # Is used by `search_module_by_amodule_name` to validate qualified names.
        private fun match_amodulename(n_name: AModuleName, m: MModule): Bool
        do
                var g: nullable MGroup = m.mgroup
@@ -925,7 +942,7 @@ redef class ModelBuilder
                        end
 
                        # Load the imported module
-                       var sup = seach_module_by_amodule_name(aimport.n_name, mmodule.mgroup)
+                       var sup = search_module_by_amodule_name(aimport.n_name, mmodule.mgroup)
                        if sup == null then
                                mmodule.is_broken = true
                                nmodule.mmodule = null # invalidate the module
@@ -979,7 +996,7 @@ redef class ModelBuilder
                        var atconditionals = aimport.get_annotations("conditional")
                        if atconditionals.is_empty then continue
 
-                       var suppath = seach_module_by_amodule_name(aimport.n_name, mmodule.mgroup)
+                       var suppath = search_module_by_amodule_name(aimport.n_name, mmodule.mgroup)
                        if suppath == null then continue # skip error
 
                        for atconditional in atconditionals do
@@ -1183,6 +1200,31 @@ redef class MPackage
                end
                return true
        end
+
+       # Get the name to search for, for a `root_name` declared as `import` in `ini`
+       fun import_alias(root_name: String): nullable String
+       do
+               var map = import_aliases_parsed
+               if map == null then return null
+
+               var val = map.get_or_null(root_name)
+               if val == null then return null
+
+               return val.dir_name
+       end
+
+       private var import_aliases_parsed: nullable Map[String, ExternalPackage] is lazy do
+               var ini = ini
+               if ini == null then return null
+
+               var import_line = ini["package.import"]
+               if import_line == null then return null
+
+               var map = import_line.parse_import
+               if map.is_empty then return null
+
+               return map
+       end
 end
 
 redef class MGroup
similarity index 54%
rename from src/picnit.nit
rename to src/nitpm.nit
index f5e28c8..df2aaa5 100644 (file)
 # limitations under the License.
 
 # Nit package manager command line interface
-module picnit
+module nitpm
 
 import opts
 import prompt
 import ini
 import curl
 
-import picnit_shared
-
-redef class Text
-
-       # Does `self` look like a package name?
-       #
-       # ~~~
-       # assert "gamnit".is_package_name
-       # assert "n1t".is_package_name
-       # assert not ".".is_package_name
-       # assert not "./gamnit".is_package_name
-       # assert not "https://github.com/nitlang/nit.git".is_package_name
-       # assert not "git://github.com/nitlang/nit".is_package_name
-       # assert not "git@gitlab.com:xymus/gamnit.git".is_package_name
-       # assert not "4it".is_package_name
-       # ~~~
-       private fun is_package_name: Bool
-       do
-               if is_empty then return false
-               if not chars.first.is_alpha then return false
-
-               for c in chars do
-                       if not (c.is_alphanumeric or c == '_') then return false
-               end
-
-               return true
-       end
+import nitpm_shared
 
-       # Get package name from the Git address `self`
-       #
-       # Return `null` on failure.
-       #
-       # ~~~
-       # assert "https://github.com/nitlang/nit.git".git_name == "nit"
-       # assert "git://github.com/nitlang/nit".git_name == "nit"
-       # assert "gamnit".git_name == "gamnit"
-       # assert "///".git_name == null
-       # assert "file:///".git_name == "file:"
-       # ~~~
-       private fun git_name: nullable String
-       do
-               var parts = split("/")
-               for part in parts.reverse_iterator do
-                       if not part.is_empty then
-                               return part.strip_extension(".git")
-                       end
-               end
-
-               return null
-       end
-end
-
-# Command line action, passed after `picnit`
+# Command line action, passed after `nitpm`
 abstract class Command
 
        # Short name of the command, specified in the command line
@@ -105,24 +55,60 @@ class CommandInstall
        super Command
 
        redef fun name do return "install"
-       redef fun usage do return "picnit install [package or git-repository]"
-       redef fun description do return "Install a package by its name or from a git-repository"
+       redef fun usage do return "nitpm install [package0[=version] [package1 ...]]"
+       redef fun description do return "Install packages by name, Git repository address or from the local package.ini"
+
+       # Packages installed in this run (identified by the full path)
+       private var installed = new Array[String]
 
        redef fun apply(args)
        do
-               if args.length != 1 then
-                       print_local_help
-                       exit 1
+               if args.not_empty then
+                       # Install each package
+                       for arg in args do
+                               # Parse each arg as an import string, with versions and commas
+                               install_packages arg
+                       end
+               else
+                       # Install packages from local package.ini
+                       var ini_path = "package.ini"
+                       if not ini_path.file_exists then
+                               print_error "Local `package.ini` not found."
+                               print_local_help
+                               exit 1
+                       end
+
+                       var ini = new ConfigTree(ini_path)
+                       var import_line = ini["package.import"]
+                       if import_line == null then
+                               print_error "The local `package.ini` declares no external dependencies."
+                               exit 0
+                               abort
+                       end
+
+                       install_packages import_line
+               end
+       end
+
+       # Install packages defined by the `import_line`
+       private fun install_packages(import_line: String)
+       do
+               var imports = import_line.parse_import
+               for name, ext_package in imports do
+                       install_package(ext_package.id, ext_package.version)
                end
+       end
 
-               var package_id = args.first
+       # Install the `package_id` at `version`
+       private fun install_package(package_id: String, version: nullable String)
+       do
                if package_id.is_package_name then
                        # Ask a centralized server
                        # TODO choose a future safe URL
                        # TODO customizable server list
                        # TODO parse ini file in memory
 
-                       var url = "https://xymus.net/picnit/{package_id}.ini"
+                       var url = "https://xymus.net/nitpm/{package_id}.ini"
                        var ini_path = "/tmp/{package_id}.ini"
 
                        if verbose then print "Looking for a package description at '{url}'"
@@ -138,7 +124,7 @@ class CommandInstall
 
                        assert response isa CurlFileResponseSuccess
                        if response.status_code == 404 then
-                               print_error "Package not found by the server"
+                               print_error "Package '{package_id}' not found on the server"
                                exit 1
                        else if response.status_code != 200 then
                                print_error "Server side error: {response.status_code}"
@@ -158,12 +144,12 @@ class CommandInstall
                                abort
                        end
 
-                       install_from_git(git_repo, package_id)
+                       install_from_git(git_repo, package_id, version)
                else
                        var name = package_id.git_name
                        if name != null and name != "." and not name.is_empty then
                                name = name.to_lower
-                               install_from_git(package_id, name)
+                               install_from_git(package_id, name, version)
                        else
                                print_error "Failed to infer the package name"
                                exit 1
@@ -171,30 +157,49 @@ class CommandInstall
                end
        end
 
-       private fun install_from_git(git_repo, name: String)
+       private fun install_from_git(git_repo, name: String, version: nullable String)
        do
                check_git
 
-               var target_dir = picnit_lib_dir / name
-               if target_dir.file_exists then
-                       print_error "Already installed"
-                       exit 1
+               var target_dir = nitpm_lib_dir / name
+               if version != null then target_dir += "=" + version
+               if installed.has(target_dir) then
+                       # Ignore packages installed in this run
+                       return
                end
+               installed.add target_dir
 
-               var cmd = "git clone {git_repo.escape_to_sh} {target_dir.escape_to_sh}"
-               if verbose then print "+ {cmd}"
+               if target_dir.file_exists then
+                       # Warn about packages previously installed,
+                       # install dependencies anyway in case of a previous error.
+                       print_error "Package '{name}' is already installed"
+               else
+                       # Actually install it
+                       var cmd_branch = ""
+                       if version != null then cmd_branch = "--branch '{version}'"
 
-               if "NIT_TESTING".environ == "true" then
-                       # Silence git output when testing
-                       cmd += " 2> /dev/null"
-               end
+                       var cmd = "git clone --depth 1 {cmd_branch} {git_repo.escape_to_sh} {target_dir.escape_to_sh}"
+                       if verbose then print "+ {cmd}"
 
-               var proc = new Process("sh", "-c", cmd)
-               proc.wait
+                       if "NIT_TESTING".environ == "true" then
+                               # Silence git output when testing
+                               cmd += " 2> /dev/null"
+                       end
 
-               if proc.status != 0 then
-                       print_error "Install failed"
-                       exit 1
+                       var proc = new Process("sh", "-c", cmd)
+                       proc.wait
+
+                       if proc.status != 0 then
+                               print_error "Install of '{name}' failed"
+                               exit 1
+                       end
+               end
+
+               # Recursive install
+               var ini = new ConfigTree(target_dir/"package.ini")
+               var import_line = ini["package.import"]
+               if import_line != null then
+                       install_packages import_line
                end
        end
 end
@@ -204,7 +209,7 @@ class CommandUpgrade
        super Command
 
        redef fun name do return "upgrade"
-       redef fun usage do return "picnit upgrade <package>"
+       redef fun usage do return "nitpm upgrade <package>"
        redef fun description do return "Upgrade a package"
 
        redef fun apply(args)
@@ -215,7 +220,7 @@ class CommandUpgrade
                end
 
                var name = args.first
-               var target_dir = picnit_lib_dir / name
+               var target_dir = nitpm_lib_dir / name
 
                if not target_dir.file_exists or not target_dir.to_path.is_dir then
                        print_error "Package not found"
@@ -242,39 +247,58 @@ class CommandUninstall
        super Command
 
        redef fun name do return "uninstall"
-       redef fun usage do return "picnit uninstall <package>"
-       redef fun description do return "Uninstall a package"
+       redef fun usage do return "nitpm uninstall [-f] <package0>[=version] [package1 ...]"
+       redef fun description do return "Uninstall packages"
 
        redef fun apply(args)
        do
-               if args.length != 1 then
+               var opt_force = "-f"
+               var force = args.has(opt_force)
+               if force then args.remove(opt_force)
+
+               if args.is_empty then
                        print_local_help
                        exit 1
                end
 
-               var name = args.first
-               var target_dir = picnit_lib_dir / name
+               for name in args do
 
-               if not target_dir.file_exists or not target_dir.to_path.is_dir then
-                       print_error "Package not found"
-                       exit 1
-               end
+                       var clean_nitpm_lib_dir = nitpm_lib_dir.simplify_path
+                       var target_dir = clean_nitpm_lib_dir / name
+
+                       # Check validity of the package to delete
+                       target_dir = target_dir.simplify_path
+                       var within_dir = target_dir.has_prefix(clean_nitpm_lib_dir + "/") and
+                               target_dir.length > clean_nitpm_lib_dir.length + 1
+                       var valid_name = name.length > 0 and name.chars.first.is_lower
+                       if not valid_name or not within_dir then
+                               print_error "Package name '{name}' is invalid"
+                               continue
+                       end
 
-               # Ask confirmation
-               var response = prompt("Delete {target_dir.escape_to_sh}? [Y/n] ")
-               var accept = response != null and
-                       (response.to_lower == "y" or response.to_lower == "yes" or response == "")
-               if not accept then return
+                       if not target_dir.file_exists or not target_dir.to_path.is_dir then
+                               print_error "Package not found"
+                               exit 1
+                       end
 
-               var cmd = "rm -rf {target_dir.escape_to_sh}"
-               if verbose then print "+ {cmd}"
+                       # Ask confirmation
+                       if not force then
+                               var response = prompt("Delete {target_dir.escape_to_sh}? [Y/n] ")
+                               var accept = response != null and
+                                       (response.to_lower == "y" or response.to_lower == "yes" or response == "")
+                               if not accept then return
+                       end
 
-               var proc = new Process("sh", "-c", cmd)
-               proc.wait
+                       var cmd = "rm -rf {target_dir.escape_to_sh}"
+                       if verbose then print "+ {cmd}"
 
-               if proc.status != 0 then
-                       print_error "Uninstall failed"
-                       exit 1
+                       var proc = new Process("sh", "-c", cmd)
+                       proc.wait
+
+                       if proc.status != 0 then
+                               print_error "Uninstall failed"
+                               exit 1
+                       end
                end
        end
 end
@@ -284,23 +308,36 @@ class CommandList
        super Command
 
        redef fun name do return "list"
-       redef fun usage do return "picnit list"
+       redef fun usage do return "nitpm list"
        redef fun description do return "List installed packages"
 
        redef fun apply(args)
        do
-               var files = picnit_lib_dir.files
+               var files = nitpm_lib_dir.files
+               var name_to_desc = new Map[String, nullable String]
+               var max_name_len = 0
+
+               # Collect package info
                for file in files do
-                       var ini_path = picnit_lib_dir / file / "package.ini"
+                       var ini_path = nitpm_lib_dir / file / "package.ini"
                        if verbose then print "- Reading ini file at {ini_path}"
                        var ini = new ConfigTree(ini_path)
                        var tags = ini["package.tags"]
 
-                       if tags != null then
-                               print "{file.justify(15, 0.0)} {tags}"
-                       else
-                               print file
-                       end
+                       name_to_desc[file] = tags
+                       max_name_len = max_name_len.max(file.length)
+               end
+
+               # Sort in alphabetical order
+               var sorted_names = name_to_desc.keys.to_a
+               alpha_comparator.sort sorted_names
+
+               # Print with clear columns
+               for name in sorted_names do
+                       var col0 = name.justify(max_name_len+1, 0.0)
+                       var col1 = name_to_desc[name] or else ""
+                       var line = col0 + col1
+                       print line.trim
                end
        end
 end
@@ -310,7 +347,7 @@ class CommandHelp
        super Command
 
        redef fun name do return "help"
-       redef fun usage do return "picnit help [command]"
+       redef fun usage do return "nitpm help [command]"
        redef fun description do return "Show general help message or the help for a command"
 
        redef fun apply(args)
@@ -334,10 +371,10 @@ redef class Sys
        var opts = new OptionContext
 
        # Help option
-       var opt_help = new OptionBool("Show this help message", "--help", "-h")
+       var opt_help = new OptionBool("Show help message", "-h", "--help")
 
        # Verbose mode option
-       var opt_verbose = new OptionBool("Print more information", "--verbose", "-v")
+       var opt_verbose = new OptionBool("Print more information", "-v", "--verbose")
        private fun verbose: Bool do return opt_verbose.value
 
        # All command line actions, mapped to their short `name`
@@ -350,17 +387,17 @@ redef class Sys
        private var command_help = new CommandHelp(commands)
 end
 
-redef fun picnit_lib_dir
+redef fun nitpm_lib_dir
 do
        if "NIT_TESTING".environ == "true" then
-               return "/tmp/picnit-test-" + "NIT_TESTING_ID".environ
+               return "/tmp/nitpm-test-" + "NIT_TESTING_ID".environ
        else return super
 end
 
 # Print the general help message
 private fun print_help
 do
-       print "usage: picnit <command> [options]"
+       print "usage: nitpm <command> [options]"
        print ""
 
        print "commands:"
diff --git a/src/nitpm_shared.nit b/src/nitpm_shared.nit
new file mode 100644 (file)
index 0000000..2a93c17
--- /dev/null
@@ -0,0 +1,137 @@
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Services related to the Nit package manager
+module nitpm_shared
+
+# Folder where are downloaded nitpm packages
+fun nitpm_lib_dir: String
+do
+       var dir = "NITPM_PATH".environ
+       if not dir.is_empty then return dir
+
+       return "HOME".environ / ".local/lib/nit/"
+end
+
+redef class Text
+
+       # Does `self` look like a package name?
+       #
+       # ~~~
+       # assert "gamnit".is_package_name
+       # assert "n1t".is_package_name
+       # assert not ".".is_package_name
+       # assert not "./gamnit".is_package_name
+       # assert not "https://github.com/nitlang/nit.git".is_package_name
+       # assert not "git://github.com/nitlang/nit".is_package_name
+       # assert not "git@gitlab.com:xymus/gamnit.git".is_package_name
+       # assert not "4it".is_package_name
+       # ~~~
+       fun is_package_name: Bool
+       do
+               if is_empty then return false
+               if not chars.first.is_alpha then return false
+
+               for c in chars do
+                       if not (c.is_alphanumeric or c == '_') then return false
+               end
+
+               return true
+       end
+
+       # Get package name from the Git address `self`
+       #
+       # Return `null` on failure.
+       #
+       # ~~~
+       # assert "https://github.com/nitlang/nit.git".git_name == "nit"
+       # assert "git://github.com/nitlang/nit".git_name == "nit"
+       # assert "gamnit".git_name == "gamnit"
+       # assert "///".git_name == null
+       # assert "file:///".git_name == "file:"
+       # ~~~
+       fun git_name: nullable String
+       do
+               var parts = split("/")
+               for part in parts.reverse_iterator do
+                       if not part.is_empty then
+                               return part.strip_extension(".git")
+                       end
+               end
+
+               return null
+       end
+
+       # Parse the external package declaration, as declared in package.ini
+       #
+       # Return a map of `ExternalPackage` organized by the short package name,
+       # as used in imports from Nit code.
+       fun parse_import: Map[String, ExternalPackage]
+       do
+               var res = new Map[String, ExternalPackage]
+               var ids = self.split(",")
+               for id in ids do
+                       id = id.chomp
+                       if id.is_empty then continue
+
+                       # Check version suffix (e.g. gamnit=1.0)
+                       var match = id.search_last("=")
+                       var package_name
+                       var version = null
+                       if match != null then
+                               # There's a version suffix
+                               package_name = id.substring(0, match.from)
+                               version = id.substring_from(match.after)
+                               id = package_name
+                       else
+                               package_name = id
+                       end
+
+                       # Extract a package name from a Git address
+                       if not package_name.is_package_name then
+                               # Assume it's a Git repository
+                               var git_name = package_name.git_name
+                               if git_name == null then
+                                       # Invalid name
+                                       # TODO report error only when used by the parser
+                                       continue
+                               end
+                               package_name = git_name
+                       end
+
+                       res[package_name] = new ExternalPackage(id, package_name, version)
+               end
+               return res
+       end
+end
+
+# Reference to a nitpm package
+class ExternalPackage
+
+       # Package identifier (name or Git address), without the version
+       var id: String
+
+       # Standard Nit package name, as used in importations from Nit
+       var name: String
+
+       # Version string of the package
+       var version: nullable String
+
+       # Expected folder name for this package
+       var dir_name: String is lazy do
+               var version = version
+               if version == null then return name
+               return name + "=" + version
+       end
+end
index b3a9b20..7a451c4 100644 (file)
@@ -43,3 +43,4 @@ test_rubix_cube
 test_rubix_visual
 test_csv
 repeating_key_xor_solve
+nitpm
diff --git a/tests/nitpm.args b/tests/nitpm.args
new file mode 100644 (file)
index 0000000..3d57c9e
--- /dev/null
@@ -0,0 +1,8 @@
+install https://gitlab.com/xymus/hello_nitpm.git
+install hello_nitpm
+upgrade hello_nitpm
+install nitpm_test_versions=1.0 nitpm_test_versions=stable nitpm_test_imports
+list
+uninstall -f nitpm_test_versions=1.0 nitpm_test_versions=2.0 nitpm_test_versions=stable nitpm_test_imports nitpm_test_cycle hello_nitpm
+list
+uninstall . .. 0invalid _invalid a/../
index 08a50fd..d346e2c 100644 (file)
@@ -46,3 +46,4 @@ repeating_key_xor_solve
 test_explain_assert
 base_notnull_lit_alt2
 assertions
+nitpm
diff --git a/tests/picnit.args b/tests/picnit.args
deleted file mode 100644 (file)
index 35da5ee..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-install https://gitlab.com/xymus/hello_picnit.git
-install hello_picnit
-list
-upgrade hello_picnit
index 74384a4..c5d08b8 100644 (file)
@@ -1,16 +1,16 @@
-\e[1mNAME\e[m
+NAME
   %PROGRAM_NAME% â€” Doxygen XML to Neo4j.
 
-\e[1mSYNOPSIS\e[m
+SYNOPSIS
   %PROGRAM_NAME% [--dest <url>] [--src-lang <lang>]
     [--] <project_name> <doxml_dir>
   %PROGRAM_NAME% [-h|--help]
 
-\e[1mDESCRIPTION\e[m
+DESCRIPTION
   Convert a Doxygen XML output into a model in Neo4j that is readable by the
   `nx` tool.
 
-\e[1mARGUMENTS\e[m
+ARGUMENTS
   <project_name>  The internal name of the project. Must the same name as the
                   one specified to the `nx` tool. Must not begin by an upper
                   case letter.
@@ -18,7 +18,7 @@
   <doxml_dir>     The directory where the XML documents generated by Doxygen are
                   located.
 
-\e[1mOPTIONS\e[m
+OPTIONS
 
   --dest       The URL of the destination graph. `http://localhost:7474` by
                default.
index 9104b4b..8bb2bc8 100644 (file)
@@ -1,66 +1,66 @@
-\e[34m# This file is part of NIT ( http://www.nitlanguage.org ).
-\e[m\e[34m#
-\e[m\e[34m# Copyright 2006-2008 Jean Privat <jean@pryen.org>
-\e[m\e[34m#
-\e[m\e[34m# Licensed under the Apache License, Version 2.0 (the "License");
-\e[m\e[34m# you may not use this file except in compliance with the License.
-\e[m\e[34m# You may obtain a copy of the License at
-\e[m\e[34m#
-\e[m\e[34m#     http://www.apache.org/licenses/LICENSE-2.0
-\e[m\e[34m#
-\e[m\e[34m# Unless required by applicable law or agreed to in writing, software
-\e[m\e[34m# distributed under the License is distributed on an "AS IS" BASIS,
-\e[m\e[34m# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-\e[m\e[34m# See the License for the specific language governing permissions and
-\e[m\e[34m# limitations under the License.
-\e[m
-\e[33mimport\e[m \e[33mend\e[m
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Copyright 2006-2008 Jean Privat <jean@pryen.org>
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
-\e[33minterface\e[m \e[32mObject\e[m
-\e[33mend\e[m
+import end
 
-\e[33menum\e[m \e[32mBool\e[m
-\e[33mend\e[m
+interface Object
+end
 
-\e[33menum\e[m \e[32mInt\e[m
-       \e[33mfun\e[m output \e[33mis\e[m intern
-\e[33mend\e[m
+enum Bool
+end
 
-\e[33mclass\e[m \e[32mA\e[m
-       \e[33minit\e[m \e[33mdo\e[m \e[31m5\e[m.output
-       \e[33mfun\e[m run \e[33mdo\e[m \e[31m6\e[m.output
-\e[33mend\e[m
+enum Int
+       fun output is intern
+end
 
-\e[33mclass\e[m \e[32mB\e[m
-       \e[33mvar\e[m val: \e[32mInt\e[m
-       \e[33minit\e[m(v: \e[32mInt\e[m)
-       \e[33mdo\e[m
-               \e[31m7\e[m.output
-               \e[33mself\e[m.val = v
-       \e[33mend\e[m
-       \e[33mfun\e[m run \e[33mdo\e[m val.output
-\e[33mend\e[m
+class A
+       init do 5.output
+       fun run do 6.output
+end
 
-\e[33mclass\e[m \e[32mC\e[m
-       \e[33mvar\e[m val1: \e[32mInt\e[m
-       \e[33mvar\e[m val2: \e[32mInt\e[m = \e[31m10\e[m
-\e[33mend\e[m
+class B
+       var val: Int
+       init(v: Int)
+       do
+               7.output
+               self.val = v
+       end
+       fun run do val.output
+end
 
-\e[33mfun\e[m foo \e[33mdo\e[m \e[31m2\e[m.output
-\e[33mfun\e[m bar(i: \e[32mInt\e[m) \e[33mdo\e[m i.output
-\e[33mfun\e[m baz: \e[32mInt\e[m \e[33mdo\e[m \e[33mreturn\e[m \e[31m4\e[m
+class C
+       var val1: Int
+       var val2: Int = 10
+end
 
-\e[31m1\e[m.output
+fun foo do 2.output
+fun bar(i: Int) do i.output
+fun baz: Int do return 4
+
+1.output
 foo
-bar(\e[31m3\e[m)
+bar(3)
 baz.output
 
-\e[33mvar\e[m a = \e[33mnew\e[m \e[32mA\e[m
+var a = new A
 a.run
 
-\e[33mvar\e[m b = \e[33mnew\e[m \e[32mB\e[m(\e[31m8\e[m)
+var b = new B(8)
 b.run
 
-\e[33mvar\e[m c = \e[33mnew\e[m \e[32mC\e[m(\e[31m9\e[m)
+var c = new C(9)
 c.val1.output
 c.val2.output
index 2e6f89d..4bfdf90 100644 (file)
@@ -1,15 +1,15 @@
-\e[1mbase_simple3\e[m (\e[33mbase_simple3.nit\e[m)
-project1 (\e[33mproject1\e[m)
-|--\e[1mmodule1\e[m (\e[33mproject1/module1.nit\e[m)
-|--\e[1mmodule2\e[m (\e[33mproject1/module2.nit\e[m)
-|--\e[1mmodule3\e[m (\e[33mproject1/module3.nit\e[m)
-|--\e[1mmodule_0\e[m (\e[33mproject1/module_0.nit\e[m)
-|--\e[1mmodule_01\e[m (\e[33mproject1/module_01.nit\e[m)
-|--\e[1mmodule_02\e[m (\e[33mproject1/module_02.nit\e[m)
-|--\e[1mproject1\e[m (\e[33mproject1/project1.nit\e[m)
-`--subdir (\e[33mproject1/subdir\e[m)
-   |--\e[1mmodule4\e[m (\e[33mproject1/subdir/module4.nit\e[m)
-   |--\e[1mmodule_0\e[m (\e[33mproject1/subdir/module_0.nit\e[m)
-   `--subdir2 (\e[33mproject1/subdir/subdir2\e[m)
-      `--subdir3 (\e[33mproject1/subdir/subdir2/subdir3\e[m)
-         `--\e[1msubmodule\e[m (\e[33mproject1/subdir/subdir2/subdir3/submodule.nit\e[m)
+base_simple3 (base_simple3.nit)
+project1 (project1)
+|--module1 (project1/module1.nit)
+|--module2 (project1/module2.nit)
+|--module3 (project1/module3.nit)
+|--module_0 (project1/module_0.nit)
+|--module_01 (project1/module_01.nit)
+|--module_02 (project1/module_02.nit)
+|--project1 (project1/project1.nit)
+`--subdir (project1/subdir)
+   |--module4 (project1/subdir/module4.nit)
+   |--module_0 (project1/subdir/module_0.nit)
+   `--subdir2 (project1/subdir/subdir2)
+      `--subdir3 (project1/subdir/subdir2/subdir3)
+         `--submodule (project1/subdir/subdir2/subdir3/submodule.nit)
index 2e6f89d..4bfdf90 100644 (file)
@@ -1,15 +1,15 @@
-\e[1mbase_simple3\e[m (\e[33mbase_simple3.nit\e[m)
-project1 (\e[33mproject1\e[m)
-|--\e[1mmodule1\e[m (\e[33mproject1/module1.nit\e[m)
-|--\e[1mmodule2\e[m (\e[33mproject1/module2.nit\e[m)
-|--\e[1mmodule3\e[m (\e[33mproject1/module3.nit\e[m)
-|--\e[1mmodule_0\e[m (\e[33mproject1/module_0.nit\e[m)
-|--\e[1mmodule_01\e[m (\e[33mproject1/module_01.nit\e[m)
-|--\e[1mmodule_02\e[m (\e[33mproject1/module_02.nit\e[m)
-|--\e[1mproject1\e[m (\e[33mproject1/project1.nit\e[m)
-`--subdir (\e[33mproject1/subdir\e[m)
-   |--\e[1mmodule4\e[m (\e[33mproject1/subdir/module4.nit\e[m)
-   |--\e[1mmodule_0\e[m (\e[33mproject1/subdir/module_0.nit\e[m)
-   `--subdir2 (\e[33mproject1/subdir/subdir2\e[m)
-      `--subdir3 (\e[33mproject1/subdir/subdir2/subdir3\e[m)
-         `--\e[1msubmodule\e[m (\e[33mproject1/subdir/subdir2/subdir3/submodule.nit\e[m)
+base_simple3 (base_simple3.nit)
+project1 (project1)
+|--module1 (project1/module1.nit)
+|--module2 (project1/module2.nit)
+|--module3 (project1/module3.nit)
+|--module_0 (project1/module_0.nit)
+|--module_01 (project1/module_01.nit)
+|--module_02 (project1/module_02.nit)
+|--project1 (project1/project1.nit)
+`--subdir (project1/subdir)
+   |--module4 (project1/subdir/module4.nit)
+   |--module_0 (project1/subdir/module_0.nit)
+   `--subdir2 (project1/subdir/subdir2)
+      `--subdir3 (project1/subdir/subdir2/subdir3)
+         `--submodule (project1/subdir/subdir2/subdir3/submodule.nit)
index ed5df5e..c72a594 100644 (file)
@@ -1,18 +1,18 @@
-\e[1mbase_simple3\e[m (\e[33mbase_simple3.nit\e[m)
-project1 (\e[33mproject1\e[m)
-|--\e[1mmodule1\e[m (\e[33mproject1/module1.nit\e[m)
-|--\e[1mmodule2\e[m (\e[33mproject1/module2.nit\e[m)
-|--\e[1mmodule3\e[m (\e[33mproject1/module3.nit\e[m)
-|--\e[1mmodule_0\e[m (\e[33mproject1/module_0.nit\e[m)
-|--\e[1mmodule_01\e[m (\e[33mproject1/module_01.nit\e[m)
-|--\e[1mmodule_02\e[m (\e[33mproject1/module_02.nit\e[m)
-|--\e[1mproject1\e[m (\e[33mproject1/project1.nit\e[m)
-`--subdir (\e[33mproject1/subdir\e[m)
-   |--\e[1mmodule4\e[m (\e[33mproject1/subdir/module4.nit\e[m)
-   |--\e[1mmodule_0\e[m (\e[33mproject1/subdir/module_0.nit\e[m)
-   `--subdir2 (\e[33mproject1/subdir/subdir2\e[m)
-      `--subdir3 (\e[33mproject1/subdir/subdir2/subdir3\e[m)
-         `--\e[1msubmodule\e[m (\e[33mproject1/subdir/subdir2/subdir3/submodule.nit\e[m)
-project2 (\e[33mproject1/project2\e[m)
-|--\e[1mfoo\e[m (\e[33mproject1/project2/foo.nit\e[m)
-`--\e[1mproject2\e[m (\e[33mproject1/project2/project2.nit\e[m)
+base_simple3 (base_simple3.nit)
+project1 (project1)
+|--module1 (project1/module1.nit)
+|--module2 (project1/module2.nit)
+|--module3 (project1/module3.nit)
+|--module_0 (project1/module_0.nit)
+|--module_01 (project1/module_01.nit)
+|--module_02 (project1/module_02.nit)
+|--project1 (project1/project1.nit)
+`--subdir (project1/subdir)
+   |--module4 (project1/subdir/module4.nit)
+   |--module_0 (project1/subdir/module_0.nit)
+   `--subdir2 (project1/subdir/subdir2)
+      `--subdir3 (project1/subdir/subdir2/subdir3)
+         `--submodule (project1/subdir/subdir2/subdir3/submodule.nit)
+project2 (project1/project2)
+|--foo (project1/project2/foo.nit)
+`--project2 (project1/project2/project2.nit)
index 64895a3..7d1bc05 100644 (file)
@@ -1,11 +1,11 @@
-base_simple3>\e[1mbase_simple3\e[m (\e[33mbase_simple3.nit\e[m)
-project1>\e[1mmodule1\e[m (\e[33mproject1/module1.nit\e[m)
-project1>\e[1mmodule2\e[m (\e[33mproject1/module2.nit\e[m)
-project1>\e[1mmodule3\e[m (\e[33mproject1/module3.nit\e[m)
-project1>subdir>\e[1mmodule4\e[m (\e[33mproject1/subdir/module4.nit\e[m)
-project1>\e[1mmodule_0\e[m (\e[33mproject1/module_0.nit\e[m)
-project1>subdir>\e[1mmodule_0\e[m (\e[33mproject1/subdir/module_0.nit\e[m)
-project1>\e[1mmodule_01\e[m (\e[33mproject1/module_01.nit\e[m)
-project1>\e[1mmodule_02\e[m (\e[33mproject1/module_02.nit\e[m)
-project1>\e[1mproject1\e[m (\e[33mproject1/project1.nit\e[m)
-project1>subdir>subdir2>subdir3>\e[1msubmodule\e[m (\e[33mproject1/subdir/subdir2/subdir3/submodule.nit\e[m)
+base_simple3>base_simple3 (base_simple3.nit)
+project1>module1 (project1/module1.nit)
+project1>module2 (project1/module2.nit)
+project1>module3 (project1/module3.nit)
+project1>subdir>module4 (project1/subdir/module4.nit)
+project1>module_0 (project1/module_0.nit)
+project1>subdir>module_0 (project1/subdir/module_0.nit)
+project1>module_01 (project1/module_01.nit)
+project1>module_02 (project1/module_02.nit)
+project1>project1 (project1/project1.nit)
+project1>subdir>subdir2>subdir3>submodule (project1/subdir/subdir2/subdir3/submodule.nit)
index 7cf6fd3..2bef1de 100644 (file)
@@ -1,8 +1,8 @@
-project1 (\e[33mproject1\e[m)
-|--\e[1mmodule1\e[m (\e[33mproject1/module1.nit\e[m)
-|--\e[1mmodule3\e[m (\e[33mproject1/module3.nit\e[m)\e[37m (module4)\e[m
-`--subdir (\e[33mproject1/subdir\e[m)
-   |--\e[1mmodule4\e[m (\e[33mproject1/subdir/module4.nit\e[m)\e[37m (module1)\e[m
-   `--subdir2 (\e[33mproject1/subdir/subdir2\e[m)
-      `--subdir3 (\e[33mproject1/subdir/subdir2/subdir3\e[m)
-         `--\e[1msubmodule\e[m (\e[33mproject1/subdir/subdir2/subdir3/submodule.nit\e[m)
+project1 (project1)
+|--module1 (project1/module1.nit)
+|--module3 (project1/module3.nit) (module4)
+`--subdir (project1/subdir)
+   |--module4 (project1/subdir/module4.nit) (module1)
+   `--subdir2 (project1/subdir/subdir2)
+      `--subdir3 (project1/subdir/subdir2/subdir3)
+         `--submodule (project1/subdir/subdir2/subdir3/submodule.nit)
index 9a0889d..49f93f6 100644 (file)
@@ -1,14 +1,14 @@
 test_prog: Test program for model tools. (test_prog)
 |--examples (test_prog/examples)
-|  `--\e[1mgame_examples\e[m (test_prog/examples/game_examples.nit)
+|  `--game_examples (test_prog/examples/game_examples.nit)
 |--game: Gaming group (test_prog/game)
-|  `--\e[1mgame\e[m: A game abstraction for RPG. (test_prog/game/game.nit)
+|  `--game: A game abstraction for RPG. (test_prog/game/game.nit)
 |--platform: Fictive Crappy Platform. (test_prog/platform)
-|  `--\e[1mplatform\e[m: Declares base types allowed on the platform. (test_prog/platform/platform.nit)
+|  `--platform: Declares base types allowed on the platform. (test_prog/platform/platform.nit)
 |--rpg: Role Playing Game group (test_prog/rpg)
-|  |--\e[1mcareers\e[m: Careers of the game. (test_prog/rpg/careers.nit)
-|  |--\e[1mcharacter\e[m: Characters are playable entity in the world. (test_prog/rpg/character.nit)
-|  |--\e[1mcombat\e[m: COmbat interactions between characters. (test_prog/rpg/combat.nit)
-|  |--\e[1mraces\e[m: Races of the game. (test_prog/rpg/races.nit)
-|  `--\e[1mrpg\e[m: A worlg RPG abstraction. (test_prog/rpg/rpg.nit)
-`--\e[1mtest_prog\e[m: A test program with a fake model to check model tools. (test_prog/test_prog.nit)
+|  |--careers: Careers of the game. (test_prog/rpg/careers.nit)
+|  |--character: Characters are playable entity in the world. (test_prog/rpg/character.nit)
+|  |--combat: COmbat interactions between characters. (test_prog/rpg/combat.nit)
+|  |--races: Races of the game. (test_prog/rpg/races.nit)
+|  `--rpg: A worlg RPG abstraction. (test_prog/rpg/rpg.nit)
+`--test_prog: A test program with a fake model to check model tools. (test_prog/test_prog.nit)
index b80e7ce..b254696 100644 (file)
@@ -1,2 +1,2 @@
-\e[1mexcluded\e[m (test_prog/game/excluded.nit)
-\e[1mmore\e[m (test_prog/game/excluded_dir/more.nit)
+excluded (test_prog/game/excluded.nit)
+more (test_prog/game/excluded_dir/more.nit)
diff --git a/tests/sav/nitpm.res b/tests/sav/nitpm.res
new file mode 100644 (file)
index 0000000..c10cc0f
--- /dev/null
@@ -0,0 +1,12 @@
+usage: nitpm <command> [options]
+
+commands:
+  install     Install packages by name, Git repository address or from the local package.ini
+  list        List installed packages
+  upgrade     Upgrade a package
+  uninstall   Uninstall packages
+  help        Show general help message or the help for a command
+
+options:
+  -h, --help      Show help message
+  -v, --verbose   Print more information
diff --git a/tests/sav/nitpm_args2.res b/tests/sav/nitpm_args2.res
new file mode 100644 (file)
index 0000000..a9f808e
--- /dev/null
@@ -0,0 +1 @@
+Package 'hello_nitpm' is already installed
diff --git a/tests/sav/nitpm_args5.res b/tests/sav/nitpm_args5.res
new file mode 100644 (file)
index 0000000..822769d
--- /dev/null
@@ -0,0 +1,6 @@
+hello_nitpm                example
+nitpm_test_cycle
+nitpm_test_imports
+nitpm_test_versions=1.0
+nitpm_test_versions=2.0
+nitpm_test_versions=stable
diff --git a/tests/sav/nitpm_args8.res b/tests/sav/nitpm_args8.res
new file mode 100644 (file)
index 0000000..dc13ee1
--- /dev/null
@@ -0,0 +1,5 @@
+Package name '.' is invalid
+Package name '..' is invalid
+Package name '0invalid' is invalid
+Package name '_invalid' is invalid
+Package name 'a/../' is invalid
diff --git a/tests/sav/picnit.res b/tests/sav/picnit.res
deleted file mode 100644 (file)
index 952c1c1..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-usage: picnit <command> [options]
-
-commands:
-  install     Install a package by its name or from a git-repository
-  list        List installed packages
-  upgrade     Upgrade a package
-  uninstall   Uninstall a package
-  help        Show general help message or the help for a command
-
-options:
-  --help, -h      Show this help message
-  --verbose, -v   Print more information
diff --git a/tests/sav/picnit_args2.res b/tests/sav/picnit_args2.res
deleted file mode 100644 (file)
index 8fba0b7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Already installed
diff --git a/tests/sav/picnit_args3.res b/tests/sav/picnit_args3.res
deleted file mode 100644 (file)
index 81eb1a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-hello_picnit    example
diff --git a/tests/sav/picnit_args5.res b/tests/sav/picnit_args5.res
deleted file mode 100644 (file)
index 2a7bfed..0000000
+++ /dev/null
@@ -1 +0,0 @@
-Already up-to-date.
diff --git a/tests/sav/test_catch_multi_threaded.res b/tests/sav/test_catch_multi_threaded.res
new file mode 100644 (file)
index 0000000..04f734e
--- /dev/null
@@ -0,0 +1,10 @@
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
+caught 100000 aborts
index b181fe0..cedd01e 100644 (file)
@@ -1,38 +1,38 @@
-\e[37m17        # Program used to test the NIT parser
-\e[mStart  @../src/test_parser.nit:17,1--139,1
+17     # Program used to test the NIT parser
+Start  @../src/test_parser.nit:17,1--139,1
 |--AModule  @../src/test_parser.nit:17,1--138,3
 |  |--AModuledecl  @../src/test_parser.nit:17,1--18,18
 |  |  |--ADoc  @../src/test_parser.nit:17,1--18,0
 |  |  |  `--TComment  # Program used to test the NIT parser\n @../src/test_parser.nit:17,1--18,0
-\e[37m18        module test_parser
-\e[m|  |  |--APublicVisibility  @../src/test_parser.nit:18,1
+18     module test_parser
+|  |  |--APublicVisibility  @../src/test_parser.nit:18,1
 |  |  |--TKwmodule  module @../src/test_parser.nit:18,1--6
 |  |  `--AModuleName  @../src/test_parser.nit:18,8--18
 |  |     `--TId  test_parser @../src/test_parser.nit:18,8--18
-\e[37m19        
+19     
 import parser
-\e[m\e[37m20     import parser
-\e[m|  |--AStdImport  @../src/test_parser.nit:20,1--13
+20     import parser
+|  |--AStdImport  @../src/test_parser.nit:20,1--13
 |  |  |--APublicVisibility  @../src/test_parser.nit:20,1
 |  |  |--TKwimport  import @../src/test_parser.nit:20,1--6
 |  |  `--AModuleName  @../src/test_parser.nit:20,8--13
 |  |     `--TId  parser @../src/test_parser.nit:20,8--13
-\e[37m21        import parser_util
-\e[m|  |--AStdImport  @../src/test_parser.nit:21,1--18
+21     import parser_util
+|  |--AStdImport  @../src/test_parser.nit:21,1--18
 |  |  |--APublicVisibility  @../src/test_parser.nit:21,1
 |  |  |--TKwimport  import @../src/test_parser.nit:21,1--6
 |  |  `--AModuleName  @../src/test_parser.nit:21,8--18
 |  |     `--TId  parser_util @../src/test_parser.nit:21,8--18
-\e[37m22        import astutil
-\e[m|  |--AStdImport  @../src/test_parser.nit:22,1--14
+22     import astutil
+|  |--AStdImport  @../src/test_parser.nit:22,1--14
 |  |  |--APublicVisibility  @../src/test_parser.nit:22,1
 |  |  |--TKwimport  import @../src/test_parser.nit:22,1--6
 |  |  `--AModuleName  @../src/test_parser.nit:22,8--14
 |  |     `--TId  astutil @../src/test_parser.nit:22,8--14
-\e[37m23        
+23     
 var no_print = false
-\e[m\e[37m24     var no_print = false
-\e[m|  `--AMainClassdef  @../src/test_parser.nit:24,1--138,3
+24     var no_print = false
+|  `--AMainClassdef  @../src/test_parser.nit:24,1--138,3
 |     `--AMainMethPropdef  @../src/test_parser.nit:24,1--138,3
 |        `--ABlockExpr  @../src/test_parser.nit:24,1--138,3
 |           |--AVardeclExpr  @../src/test_parser.nit:24,1--20
@@ -41,45 +41,45 @@ var no_print = false
 |           |  |--TAssign  = @../src/test_parser.nit:24,14
 |           |  `--AFalseExpr  @../src/test_parser.nit:24,16--20
 |           |     `--TKwfalse  false @../src/test_parser.nit:24,16--20
-\e[37m25        var only_lexer = false
-\e[m|           |--AVardeclExpr  @../src/test_parser.nit:25,1--22
+25     var only_lexer = false
+|           |--AVardeclExpr  @../src/test_parser.nit:25,1--22
 |           |  |--TKwvar  var @../src/test_parser.nit:25,1--3
 |           |  |--TId  only_lexer @../src/test_parser.nit:25,5--14
 |           |  |--TAssign  = @../src/test_parser.nit:25,16
 |           |  `--AFalseExpr  @../src/test_parser.nit:25,18--22
 |           |     `--TKwfalse  false @../src/test_parser.nit:25,18--22
-\e[37m26        var need_help = false
-\e[m|           |--AVardeclExpr  @../src/test_parser.nit:26,1--21
+26     var need_help = false
+|           |--AVardeclExpr  @../src/test_parser.nit:26,1--21
 |           |  |--TKwvar  var @../src/test_parser.nit:26,1--3
 |           |  |--TId  need_help @../src/test_parser.nit:26,5--13
 |           |  |--TAssign  = @../src/test_parser.nit:26,15
 |           |  `--AFalseExpr  @../src/test_parser.nit:26,17--21
 |           |     `--TKwfalse  false @../src/test_parser.nit:26,17--21
-\e[37m27        var no_file = false
-\e[m|           |--AVardeclExpr  @../src/test_parser.nit:27,1--19
+27     var no_file = false
+|           |--AVardeclExpr  @../src/test_parser.nit:27,1--19
 |           |  |--TKwvar  var @../src/test_parser.nit:27,1--3
 |           |  |--TId  no_file @../src/test_parser.nit:27,5--11
 |           |  |--TAssign  = @../src/test_parser.nit:27,13
 |           |  `--AFalseExpr  @../src/test_parser.nit:27,15--19
 |           |     `--TKwfalse  false @../src/test_parser.nit:27,15--19
-\e[37m28        var interactive = false
-\e[m|           |--AVardeclExpr  @../src/test_parser.nit:28,1--23
+28     var interactive = false
+|           |--AVardeclExpr  @../src/test_parser.nit:28,1--23
 |           |  |--TKwvar  var @../src/test_parser.nit:28,1--3
 |           |  |--TId  interactive @../src/test_parser.nit:28,5--15
 |           |  |--TAssign  = @../src/test_parser.nit:28,17
 |           |  `--AFalseExpr  @../src/test_parser.nit:28,19--23
 |           |     `--TKwfalse  false @../src/test_parser.nit:28,19--23
-\e[37m29        var xml = false
-\e[m|           |--AVardeclExpr  @../src/test_parser.nit:29,1--15
+29     var xml = false
+|           |--AVardeclExpr  @../src/test_parser.nit:29,1--15
 |           |  |--TKwvar  var @../src/test_parser.nit:29,1--3
 |           |  |--TId  xml @../src/test_parser.nit:29,5--7
 |           |  |--TAssign  = @../src/test_parser.nit:29,9
 |           |  `--AFalseExpr  @../src/test_parser.nit:29,11--15
 |           |     `--TKwfalse  false @../src/test_parser.nit:29,11--15
-\e[37m30        
+30     
 while not args.is_empty and args.first.chars.first == '-' do
-\e[m\e[37m31     while not args.is_empty and args.first.chars.first == '-' do
-\e[m|           |--AWhileExpr  @../src/test_parser.nit:31,1--51,3
+31     while not args.is_empty and args.first.chars.first == '-' do
+|           |--AWhileExpr  @../src/test_parser.nit:31,1--51,3
 |           |  |--TKwwhile  while @../src/test_parser.nit:31,1--5
 |           |  |--AAndExpr  @../src/test_parser.nit:31,7--57
 |           |  |  |--ANotExpr  @../src/test_parser.nit:31,7--23
@@ -116,8 +116,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |  |     `--ACharExpr  @../src/test_parser.nit:31,55--57
 |           |  |        `--TChar  \'-\' @../src/test_parser.nit:31,55--57
 |           |  |--TKwdo  do @../src/test_parser.nit:31,59--60
-\e[37m32                if args.first == "-n" then
-\e[m|           |  `--ABlockExpr  @../src/test_parser.nit:32,2--51,3
+32             if args.first == "-n" then
+|           |  `--ABlockExpr  @../src/test_parser.nit:32,2--51,3
 |           |     |--AIfExpr  @../src/test_parser.nit:32,2--49,4
 |           |     |  |--TKwif  if @../src/test_parser.nit:32,2--3
 |           |     |  |--AEqExpr  @../src/test_parser.nit:32,5--22
@@ -134,8 +134,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |  |  `--AStringExpr  @../src/test_parser.nit:32,19--22
 |           |     |  |     `--TString  \"-n\" @../src/test_parser.nit:32,19--22
 |           |     |  |--TKwthen  then @../src/test_parser.nit:32,24--27
-\e[37m33                        no_print = true
-\e[m|           |     |  |--ABlockExpr  @../src/test_parser.nit:33,3--17
+33                     no_print = true
+|           |     |  |--ABlockExpr  @../src/test_parser.nit:33,3--17
 |           |     |  |  `--ACallAssignExpr  @../src/test_parser.nit:33,3--17
 |           |     |  |     |--AImplicitSelfExpr  @../src/test_parser.nit:33,3
 |           |     |  |     |--AQid  @../src/test_parser.nit:33,3--10
@@ -144,8 +144,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |  |     |--TAssign  = @../src/test_parser.nit:33,12
 |           |     |  |     `--ATrueExpr  @../src/test_parser.nit:33,14--17
 |           |     |  |        `--TKwtrue  true @../src/test_parser.nit:33,14--17
-\e[37m34                else if args.first == "-l" then
-\e[m|           |     |  |--TKwelse  else @../src/test_parser.nit:34,2--5
+34             else if args.first == "-l" then
+|           |     |  |--TKwelse  else @../src/test_parser.nit:34,2--5
 |           |     |  `--AIfExpr  @../src/test_parser.nit:34,7--49,4
 |           |     |     |--TKwif  if @../src/test_parser.nit:34,7--8
 |           |     |     |--AEqExpr  @../src/test_parser.nit:34,10--27
@@ -162,8 +162,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |     |  `--AStringExpr  @../src/test_parser.nit:34,24--27
 |           |     |     |     `--TString  \"-l\" @../src/test_parser.nit:34,24--27
 |           |     |     |--TKwthen  then @../src/test_parser.nit:34,29--32
-\e[37m35                        only_lexer = true
-\e[m|           |     |     |--ABlockExpr  @../src/test_parser.nit:35,3--19
+35                     only_lexer = true
+|           |     |     |--ABlockExpr  @../src/test_parser.nit:35,3--19
 |           |     |     |  `--ACallAssignExpr  @../src/test_parser.nit:35,3--19
 |           |     |     |     |--AImplicitSelfExpr  @../src/test_parser.nit:35,3
 |           |     |     |     |--AQid  @../src/test_parser.nit:35,3--12
@@ -172,8 +172,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |     |     |--TAssign  = @../src/test_parser.nit:35,14
 |           |     |     |     `--ATrueExpr  @../src/test_parser.nit:35,16--19
 |           |     |     |        `--TKwtrue  true @../src/test_parser.nit:35,16--19
-\e[37m36                else if args.first == "-p" then
-\e[m|           |     |     |--TKwelse  else @../src/test_parser.nit:36,2--5
+36             else if args.first == "-p" then
+|           |     |     |--TKwelse  else @../src/test_parser.nit:36,2--5
 |           |     |     `--AIfExpr  @../src/test_parser.nit:36,7--49,4
 |           |     |        |--TKwif  if @../src/test_parser.nit:36,7--8
 |           |     |        |--AEqExpr  @../src/test_parser.nit:36,10--27
@@ -190,8 +190,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |        |  `--AStringExpr  @../src/test_parser.nit:36,24--27
 |           |     |        |     `--TString  \"-p\" @../src/test_parser.nit:36,24--27
 |           |     |        |--TKwthen  then @../src/test_parser.nit:36,29--32
-\e[37m37                        only_lexer = false
-\e[m|           |     |        |--ABlockExpr  @../src/test_parser.nit:37,3--20
+37                     only_lexer = false
+|           |     |        |--ABlockExpr  @../src/test_parser.nit:37,3--20
 |           |     |        |  `--ACallAssignExpr  @../src/test_parser.nit:37,3--20
 |           |     |        |     |--AImplicitSelfExpr  @../src/test_parser.nit:37,3
 |           |     |        |     |--AQid  @../src/test_parser.nit:37,3--12
@@ -200,8 +200,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |        |     |--TAssign  = @../src/test_parser.nit:37,14
 |           |     |        |     `--AFalseExpr  @../src/test_parser.nit:37,16--20
 |           |     |        |        `--TKwfalse  false @../src/test_parser.nit:37,16--20
-\e[37m38                else if args.first == "-x" then
-\e[m|           |     |        |--TKwelse  else @../src/test_parser.nit:38,2--5
+38             else if args.first == "-x" then
+|           |     |        |--TKwelse  else @../src/test_parser.nit:38,2--5
 |           |     |        `--AIfExpr  @../src/test_parser.nit:38,7--49,4
 |           |     |           |--TKwif  if @../src/test_parser.nit:38,7--8
 |           |     |           |--AEqExpr  @../src/test_parser.nit:38,10--27
@@ -218,8 +218,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |           |  `--AStringExpr  @../src/test_parser.nit:38,24--27
 |           |     |           |     `--TString  \"-x\" @../src/test_parser.nit:38,24--27
 |           |     |           |--TKwthen  then @../src/test_parser.nit:38,29--32
-\e[37m39                        xml = true
-\e[m|           |     |           |--ABlockExpr  @../src/test_parser.nit:39,3--12
+39                     xml = true
+|           |     |           |--ABlockExpr  @../src/test_parser.nit:39,3--12
 |           |     |           |  `--ACallAssignExpr  @../src/test_parser.nit:39,3--12
 |           |     |           |     |--AImplicitSelfExpr  @../src/test_parser.nit:39,3
 |           |     |           |     |--AQid  @../src/test_parser.nit:39,3--5
@@ -228,8 +228,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |           |     |--TAssign  = @../src/test_parser.nit:39,7
 |           |     |           |     `--ATrueExpr  @../src/test_parser.nit:39,9--12
 |           |     |           |        `--TKwtrue  true @../src/test_parser.nit:39,9--12
-\e[37m40                else if args.first == "-e" then
-\e[m|           |     |           |--TKwelse  else @../src/test_parser.nit:40,2--5
+40             else if args.first == "-e" then
+|           |     |           |--TKwelse  else @../src/test_parser.nit:40,2--5
 |           |     |           `--AIfExpr  @../src/test_parser.nit:40,7--49,4
 |           |     |              |--TKwif  if @../src/test_parser.nit:40,7--8
 |           |     |              |--AEqExpr  @../src/test_parser.nit:40,10--27
@@ -246,8 +246,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |              |  `--AStringExpr  @../src/test_parser.nit:40,24--27
 |           |     |              |     `--TString  \"-e\" @../src/test_parser.nit:40,24--27
 |           |     |              |--TKwthen  then @../src/test_parser.nit:40,29--32
-\e[37m41                        no_file = true
-\e[m|           |     |              |--ABlockExpr  @../src/test_parser.nit:41,3--16
+41                     no_file = true
+|           |     |              |--ABlockExpr  @../src/test_parser.nit:41,3--16
 |           |     |              |  `--ACallAssignExpr  @../src/test_parser.nit:41,3--16
 |           |     |              |     |--AImplicitSelfExpr  @../src/test_parser.nit:41,3
 |           |     |              |     |--AQid  @../src/test_parser.nit:41,3--9
@@ -256,8 +256,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |              |     |--TAssign  = @../src/test_parser.nit:41,11
 |           |     |              |     `--ATrueExpr  @../src/test_parser.nit:41,13--16
 |           |     |              |        `--TKwtrue  true @../src/test_parser.nit:41,13--16
-\e[37m42                else if args.first == "-i" then
-\e[m|           |     |              |--TKwelse  else @../src/test_parser.nit:42,2--5
+42             else if args.first == "-i" then
+|           |     |              |--TKwelse  else @../src/test_parser.nit:42,2--5
 |           |     |              `--AIfExpr  @../src/test_parser.nit:42,7--49,4
 |           |     |                 |--TKwif  if @../src/test_parser.nit:42,7--8
 |           |     |                 |--AEqExpr  @../src/test_parser.nit:42,10--27
@@ -274,8 +274,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                 |  `--AStringExpr  @../src/test_parser.nit:42,24--27
 |           |     |                 |     `--TString  \"-i\" @../src/test_parser.nit:42,24--27
 |           |     |                 |--TKwthen  then @../src/test_parser.nit:42,29--32
-\e[37m43                        interactive = true
-\e[m|           |     |                 |--ABlockExpr  @../src/test_parser.nit:43,3--20
+43                     interactive = true
+|           |     |                 |--ABlockExpr  @../src/test_parser.nit:43,3--20
 |           |     |                 |  `--ACallAssignExpr  @../src/test_parser.nit:43,3--20
 |           |     |                 |     |--AImplicitSelfExpr  @../src/test_parser.nit:43,3
 |           |     |                 |     |--AQid  @../src/test_parser.nit:43,3--13
@@ -284,8 +284,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                 |     |--TAssign  = @../src/test_parser.nit:43,15
 |           |     |                 |     `--ATrueExpr  @../src/test_parser.nit:43,17--20
 |           |     |                 |        `--TKwtrue  true @../src/test_parser.nit:43,17--20
-\e[37m44                else if args.first == "-h" or args.first == "-?" then
-\e[m|           |     |                 |--TKwelse  else @../src/test_parser.nit:44,2--5
+44             else if args.first == "-h" or args.first == "-?" then
+|           |     |                 |--TKwelse  else @../src/test_parser.nit:44,2--5
 |           |     |                 `--AIfExpr  @../src/test_parser.nit:44,7--49,4
 |           |     |                    |--TKwif  if @../src/test_parser.nit:44,7--8
 |           |     |                    |--AOrExpr  @../src/test_parser.nit:44,10--49
@@ -317,8 +317,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                    |     `--AStringExpr  @../src/test_parser.nit:44,46--49
 |           |     |                    |        `--TString  \"-?\" @../src/test_parser.nit:44,46--49
 |           |     |                    |--TKwthen  then @../src/test_parser.nit:44,51--54
-\e[37m45                        need_help = true
-\e[m|           |     |                    |--ABlockExpr  @../src/test_parser.nit:45,3--18
+45                     need_help = true
+|           |     |                    |--ABlockExpr  @../src/test_parser.nit:45,3--18
 |           |     |                    |  `--ACallAssignExpr  @../src/test_parser.nit:45,3--18
 |           |     |                    |     |--AImplicitSelfExpr  @../src/test_parser.nit:45,3
 |           |     |                    |     |--AQid  @../src/test_parser.nit:45,3--11
@@ -327,10 +327,10 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                    |     |--TAssign  = @../src/test_parser.nit:45,13
 |           |     |                    |     `--ATrueExpr  @../src/test_parser.nit:45,15--18
 |           |     |                    |        `--TKwtrue  true @../src/test_parser.nit:45,15--18
-\e[37m46                else
-\e[m|           |     |                    |--TKwelse  else @../src/test_parser.nit:46,2--5
-\e[37m47                        stderr.write("Unknown option {args.first}.\n")
-\e[m|           |     |                    `--ABlockExpr  @../src/test_parser.nit:47,3--49,4
+46             else
+|           |     |                    |--TKwelse  else @../src/test_parser.nit:46,2--5
+47                     stderr.write("Unknown option {args.first}.\n")
+|           |     |                    `--ABlockExpr  @../src/test_parser.nit:47,3--49,4
 |           |     |                       |--ACallExpr  @../src/test_parser.nit:47,3--48
 |           |     |                       |  |--ACallExpr  @../src/test_parser.nit:47,3--8
 |           |     |                       |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:47,3
@@ -356,8 +356,8 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                       |     |  `--AEndStringExpr  @../src/test_parser.nit:47,43--47
 |           |     |                       |     |     `--TEndString  }.\\n\" @../src/test_parser.nit:47,43--47
 |           |     |                       |     `--TCpar  ) @../src/test_parser.nit:47,48
-\e[37m48                        exit(0)
-\e[m|           |     |                       |--ACallExpr  @../src/test_parser.nit:48,3--9
+48                     exit(0)
+|           |     |                       |--ACallExpr  @../src/test_parser.nit:48,3--9
 |           |     |                       |  |--AImplicitSelfExpr  @../src/test_parser.nit:48,3
 |           |     |                       |  |--AQid  @../src/test_parser.nit:48,3--6
 |           |     |                       |  |  `--TId  exit @../src/test_parser.nit:48,3--6
@@ -366,10 +366,10 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |                       |     |--AIntegerExpr  @../src/test_parser.nit:48,8
 |           |     |                       |     |  `--TInteger  0 @../src/test_parser.nit:48,8
 |           |     |                       |     `--TCpar  ) @../src/test_parser.nit:48,9
-\e[37m49                end
-\e[m|           |     |                       `--TKwend  end @../src/test_parser.nit:49,2--4
-\e[37m50                args.shift
-\e[m|           |     |--ACallExpr  @../src/test_parser.nit:50,2--11
+49             end
+|           |     |                       `--TKwend  end @../src/test_parser.nit:49,2--4
+50             args.shift
+|           |     |--ACallExpr  @../src/test_parser.nit:50,2--11
 |           |     |  |--ACallExpr  @../src/test_parser.nit:50,2--5
 |           |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:50,2
 |           |     |  |  |--AQid  @../src/test_parser.nit:50,2--5
@@ -378,12 +378,12 @@ while not args.is_empty and args.first.chars.first == '-' do
 |           |     |  |--AQid  @../src/test_parser.nit:50,7--11
 |           |     |  |  `--TId  shift @../src/test_parser.nit:50,7--11
 |           |     |  `--AListExprs  @../src/test_parser.nit:50,11
-\e[37m51        end
-\e[m|           |     `--TKwend  end @../src/test_parser.nit:51,1--3
-\e[37m52        
+51     end
+|           |     `--TKwend  end @../src/test_parser.nit:51,1--3
+52     
 if (args.is_empty and not interactive) or need_help then
-\e[m\e[37m53     if (args.is_empty and not interactive) or need_help then
-\e[m|           `--AIfExpr  @../src/test_parser.nit:53,1--138,3
+53     if (args.is_empty and not interactive) or need_help then
+|           `--AIfExpr  @../src/test_parser.nit:53,1--138,3
 |              |--TKwif  if @../src/test_parser.nit:53,1--2
 |              |--AOrExpr  @../src/test_parser.nit:53,4--51
 |              |  |--AParExpr  @../src/test_parser.nit:53,4--38
@@ -414,8 +414,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |     |  `--TId  need_help @../src/test_parser.nit:53,43--51
 |              |     `--AListExprs  @../src/test_parser.nit:53,51
 |              |--TKwthen  then @../src/test_parser.nit:53,53--56
-\e[37m54                print("usage:")
-\e[m|              |--ABlockExpr  @../src/test_parser.nit:54,2--65,30
+54             print("usage:")
+|              |--ABlockExpr  @../src/test_parser.nit:54,2--65,30
 |              |  |--ACallExpr  @../src/test_parser.nit:54,2--16
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:54,2
 |              |  |  |--AQid  @../src/test_parser.nit:54,2--6
@@ -425,8 +425,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:54,8--15
 |              |  |     |  `--TString  \"usage:\" @../src/test_parser.nit:54,8--15
 |              |  |     `--TCpar  ) @../src/test_parser.nit:54,16
-\e[37m55                print("  test_parser [options]... <filename.nit>...")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:55,2--54
+55             print("  test_parser [options]... <filename.nit>...")
+|              |  |--ACallExpr  @../src/test_parser.nit:55,2--54
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:55,2
 |              |  |  |--AQid  @../src/test_parser.nit:55,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:55,2--6
@@ -435,8 +435,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:55,8--53
 |              |  |     |  `--TString  \"  test_parser [options]... <filename.nit>...\" @../src/test_parser.nit:55,8--53
 |              |  |     `--TCpar  ) @../src/test_parser.nit:55,54
-\e[37m56                print("  test_parser -e [options]... <text>...")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:56,2--49
+56             print("  test_parser -e [options]... <text>...")
+|              |  |--ACallExpr  @../src/test_parser.nit:56,2--49
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:56,2
 |              |  |  |--AQid  @../src/test_parser.nit:56,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:56,2--6
@@ -445,8 +445,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:56,8--48
 |              |  |     |  `--TString  \"  test_parser -e [options]... <text>...\" @../src/test_parser.nit:56,8--48
 |              |  |     `--TCpar  ) @../src/test_parser.nit:56,49
-\e[37m57                print("  test_parser -i [options]...")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:57,2--39
+57             print("  test_parser -i [options]...")
+|              |  |--ACallExpr  @../src/test_parser.nit:57,2--39
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:57,2
 |              |  |  |--AQid  @../src/test_parser.nit:57,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:57,2--6
@@ -455,8 +455,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:57,8--38
 |              |  |     |  `--TString  \"  test_parser -i [options]...\" @../src/test_parser.nit:57,8--38
 |              |  |     `--TCpar  ) @../src/test_parser.nit:57,39
-\e[37m58                print("options:")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:58,2--18
+58             print("options:")
+|              |  |--ACallExpr  @../src/test_parser.nit:58,2--18
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:58,2
 |              |  |  |--AQid  @../src/test_parser.nit:58,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:58,2--6
@@ -465,8 +465,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:58,8--17
 |              |  |     |  `--TString  \"options:\" @../src/test_parser.nit:58,8--17
 |              |  |     `--TCpar  ) @../src/test_parser.nit:58,18
-\e[37m59                print("  -n     do not print anything")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:59,2--36
+59             print("  -n     do not print anything")
+|              |  |--ACallExpr  @../src/test_parser.nit:59,2--36
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:59,2
 |              |  |  |--AQid  @../src/test_parser.nit:59,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:59,2--6
@@ -475,8 +475,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:59,8--35
 |              |  |     |  `--TString  \"  -n\tdo not print anything\" @../src/test_parser.nit:59,8--35
 |              |  |     `--TCpar  ) @../src/test_parser.nit:59,36
-\e[37m60                print("  -l     only lexer")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:60,2--25
+60             print("  -l     only lexer")
+|              |  |--ACallExpr  @../src/test_parser.nit:60,2--25
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:60,2
 |              |  |  |--AQid  @../src/test_parser.nit:60,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:60,2--6
@@ -485,8 +485,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:60,8--24
 |              |  |     |  `--TString  \"  -l\tonly lexer\" @../src/test_parser.nit:60,8--24
 |              |  |     `--TCpar  ) @../src/test_parser.nit:60,25
-\e[37m61                print("  -p     lexer and parser (default)")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:61,2--41
+61             print("  -p     lexer and parser (default)")
+|              |  |--ACallExpr  @../src/test_parser.nit:61,2--41
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:61,2
 |              |  |  |--AQid  @../src/test_parser.nit:61,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:61,2--6
@@ -495,8 +495,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:61,8--40
 |              |  |     |  `--TString  \"  -p\tlexer and parser (default)\" @../src/test_parser.nit:61,8--40
 |              |  |     `--TCpar  ) @../src/test_parser.nit:61,41
-\e[37m62                print("  -x     instead of a ascii tree, output a XML document")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:62,2--61
+62             print("  -x     instead of a ascii tree, output a XML document")
+|              |  |--ACallExpr  @../src/test_parser.nit:62,2--61
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:62,2
 |              |  |  |--AQid  @../src/test_parser.nit:62,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:62,2--6
@@ -505,8 +505,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:62,8--60
 |              |  |     |  `--TString  \"  -x\tinstead of a ascii tree, output a XML document\" @../src/test_parser.nit:62,8--60
 |              |  |     `--TCpar  ) @../src/test_parser.nit:62,61
-\e[37m63                print("  -e     instead on files, each argument is a content to parse")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:63,2--68
+63             print("  -e     instead on files, each argument is a content to parse")
+|              |  |--ACallExpr  @../src/test_parser.nit:63,2--68
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:63,2
 |              |  |  |--AQid  @../src/test_parser.nit:63,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:63,2--6
@@ -515,8 +515,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:63,8--67
 |              |  |     |  `--TString  \"  -e\tinstead on files, each argument is a content to parse\" @../src/test_parser.nit:63,8--67
 |              |  |     `--TCpar  ) @../src/test_parser.nit:63,68
-\e[37m64                print("  -i     tree to parse are read interactively")
-\e[m|              |  |--ACallExpr  @../src/test_parser.nit:64,2--51
+64             print("  -i     tree to parse are read interactively")
+|              |  |--ACallExpr  @../src/test_parser.nit:64,2--51
 |              |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:64,2
 |              |  |  |--AQid  @../src/test_parser.nit:64,2--6
 |              |  |  |  `--TId  print @../src/test_parser.nit:64,2--6
@@ -525,8 +525,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |  |     |--AStringExpr  @../src/test_parser.nit:64,8--50
 |              |  |     |  `--TString  \"  -i\ttree to parse are read interactively\" @../src/test_parser.nit:64,8--50
 |              |  |     `--TCpar  ) @../src/test_parser.nit:64,51
-\e[37m65                print("  -h     print this help")
-\e[m|              |  `--ACallExpr  @../src/test_parser.nit:65,2--30
+65             print("  -h     print this help")
+|              |  `--ACallExpr  @../src/test_parser.nit:65,2--30
 |              |     |--AImplicitSelfExpr  @../src/test_parser.nit:65,2
 |              |     |--AQid  @../src/test_parser.nit:65,2--6
 |              |     |  `--TId  print @../src/test_parser.nit:65,2--6
@@ -535,8 +535,8 @@ if (args.is_empty and not interactive) or need_help then
 |              |        |--AStringExpr  @../src/test_parser.nit:65,8--29
 |              |        |  `--TString  \"  -h\tprint this help\" @../src/test_parser.nit:65,8--29
 |              |        `--TCpar  ) @../src/test_parser.nit:65,30
-\e[37m66        else if interactive then
-\e[m|              |--TKwelse  else @../src/test_parser.nit:66,1--4
+66     else if interactive then
+|              |--TKwelse  else @../src/test_parser.nit:66,1--4
 |              `--AIfExpr  @../src/test_parser.nit:66,6--138,3
 |                 |--TKwif  if @../src/test_parser.nit:66,6--7
 |                 |--ACallExpr  @../src/test_parser.nit:66,9--19
@@ -545,8 +545,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |  `--TId  interactive @../src/test_parser.nit:66,9--19
 |                 |  `--AListExprs  @../src/test_parser.nit:66,19
 |                 |--TKwthen  then @../src/test_parser.nit:66,21--24
-\e[37m67                if only_lexer then
-\e[m|                 |--ABlockExpr  @../src/test_parser.nit:67,2--100,4
+67             if only_lexer then
+|                 |--ABlockExpr  @../src/test_parser.nit:67,2--100,4
 |                 |  |--AIfExpr  @../src/test_parser.nit:67,2--76,4
 |                 |  |  |--TKwif  if @../src/test_parser.nit:67,2--3
 |                 |  |  |--ACallExpr  @../src/test_parser.nit:67,5--14
@@ -555,8 +555,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |  |  |  `--TId  only_lexer @../src/test_parser.nit:67,5--14
 |                 |  |  |  `--AListExprs  @../src/test_parser.nit:67,14
 |                 |  |  |--TKwthen  then @../src/test_parser.nit:67,16--19
-\e[37m68                        print "Error: -l and -i are incompatible"
-\e[m|                 |  |  |--ABlockExpr  @../src/test_parser.nit:68,3--69,8
+68                     print "Error: -l and -i are incompatible"
+|                 |  |  |--ABlockExpr  @../src/test_parser.nit:68,3--69,8
 |                 |  |  |  |--ACallExpr  @../src/test_parser.nit:68,3--43
 |                 |  |  |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:68,3
 |                 |  |  |  |  |--AQid  @../src/test_parser.nit:68,3--7
@@ -564,16 +564,16 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |  |  |  `--AListExprs  @../src/test_parser.nit:68,9--43
 |                 |  |  |  |     `--AStringExpr  @../src/test_parser.nit:68,9--43
 |                 |  |  |  |        `--TString  \"Error: -l and -i are incompatible\" @../src/test_parser.nit:68,9--43
-\e[37m69                        exit 1
-\e[m|                 |  |  |  `--ACallExpr  @../src/test_parser.nit:69,3--8
+69                     exit 1
+|                 |  |  |  `--ACallExpr  @../src/test_parser.nit:69,3--8
 |                 |  |  |     |--AImplicitSelfExpr  @../src/test_parser.nit:69,3
 |                 |  |  |     |--AQid  @../src/test_parser.nit:69,3--6
 |                 |  |  |     |  `--TId  exit @../src/test_parser.nit:69,3--6
 |                 |  |  |     `--AListExprs  @../src/test_parser.nit:69,8
 |                 |  |  |        `--AIntegerExpr  @../src/test_parser.nit:69,8
 |                 |  |  |           `--TInteger  1 @../src/test_parser.nit:69,8
-\e[37m70                else if no_file then
-\e[m|                 |  |  |--TKwelse  else @../src/test_parser.nit:70,2--5
+70             else if no_file then
+|                 |  |  |--TKwelse  else @../src/test_parser.nit:70,2--5
 |                 |  |  `--AIfExpr  @../src/test_parser.nit:70,7--76,4
 |                 |  |     |--TKwif  if @../src/test_parser.nit:70,7--8
 |                 |  |     |--ACallExpr  @../src/test_parser.nit:70,10--16
@@ -582,8 +582,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |     |  |  `--TId  no_file @../src/test_parser.nit:70,10--16
 |                 |  |     |  `--AListExprs  @../src/test_parser.nit:70,16
 |                 |  |     |--TKwthen  then @../src/test_parser.nit:70,18--21
-\e[37m71                        print "Error: -e and -i are incompatible"
-\e[m|                 |  |     |--ABlockExpr  @../src/test_parser.nit:71,3--72,8
+71                     print "Error: -e and -i are incompatible"
+|                 |  |     |--ABlockExpr  @../src/test_parser.nit:71,3--72,8
 |                 |  |     |  |--ACallExpr  @../src/test_parser.nit:71,3--43
 |                 |  |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:71,3
 |                 |  |     |  |  |--AQid  @../src/test_parser.nit:71,3--7
@@ -591,16 +591,16 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |     |  |  `--AListExprs  @../src/test_parser.nit:71,9--43
 |                 |  |     |  |     `--AStringExpr  @../src/test_parser.nit:71,9--43
 |                 |  |     |  |        `--TString  \"Error: -e and -i are incompatible\" @../src/test_parser.nit:71,9--43
-\e[37m72                        exit 1
-\e[m|                 |  |     |  `--ACallExpr  @../src/test_parser.nit:72,3--8
+72                     exit 1
+|                 |  |     |  `--ACallExpr  @../src/test_parser.nit:72,3--8
 |                 |  |     |     |--AImplicitSelfExpr  @../src/test_parser.nit:72,3
 |                 |  |     |     |--AQid  @../src/test_parser.nit:72,3--6
 |                 |  |     |     |  `--TId  exit @../src/test_parser.nit:72,3--6
 |                 |  |     |     `--AListExprs  @../src/test_parser.nit:72,8
 |                 |  |     |        `--AIntegerExpr  @../src/test_parser.nit:72,8
 |                 |  |     |           `--TInteger  1 @../src/test_parser.nit:72,8
-\e[37m73                else if not args.is_empty then
-\e[m|                 |  |     |--TKwelse  else @../src/test_parser.nit:73,2--5
+73             else if not args.is_empty then
+|                 |  |     |--TKwelse  else @../src/test_parser.nit:73,2--5
 |                 |  |     `--AIfExpr  @../src/test_parser.nit:73,7--76,4
 |                 |  |        |--TKwif  if @../src/test_parser.nit:73,7--8
 |                 |  |        |--ANotExpr  @../src/test_parser.nit:73,10--26
@@ -615,8 +615,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |        |     |  `--TId  is_empty @../src/test_parser.nit:73,19--26
 |                 |  |        |     `--AListExprs  @../src/test_parser.nit:73,26
 |                 |  |        |--TKwthen  then @../src/test_parser.nit:73,28--31
-\e[37m74                        print "Error: -i works without arguments"
-\e[m|                 |  |        |--ABlockExpr  @../src/test_parser.nit:74,3--75,8
+74                     print "Error: -i works without arguments"
+|                 |  |        |--ABlockExpr  @../src/test_parser.nit:74,3--75,8
 |                 |  |        |  |--ACallExpr  @../src/test_parser.nit:74,3--43
 |                 |  |        |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:74,3
 |                 |  |        |  |  |--AQid  @../src/test_parser.nit:74,3--7
@@ -624,21 +624,21 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |        |  |  `--AListExprs  @../src/test_parser.nit:74,9--43
 |                 |  |        |  |     `--AStringExpr  @../src/test_parser.nit:74,9--43
 |                 |  |        |  |        `--TString  \"Error: -i works without arguments\" @../src/test_parser.nit:74,9--43
-\e[37m75                        exit 1
-\e[m|                 |  |        |  `--ACallExpr  @../src/test_parser.nit:75,3--8
+75                     exit 1
+|                 |  |        |  `--ACallExpr  @../src/test_parser.nit:75,3--8
 |                 |  |        |     |--AImplicitSelfExpr  @../src/test_parser.nit:75,3
 |                 |  |        |     |--AQid  @../src/test_parser.nit:75,3--6
 |                 |  |        |     |  `--TId  exit @../src/test_parser.nit:75,3--6
 |                 |  |        |     `--AListExprs  @../src/test_parser.nit:75,8
 |                 |  |        |        `--AIntegerExpr  @../src/test_parser.nit:75,8
 |                 |  |        |           `--TInteger  1 @../src/test_parser.nit:75,8
-\e[37m76                end
-\e[m|                 |  |        `--ABlockExpr  @../src/test_parser.nit:76,2--4
+76             end
+|                 |  |        `--ABlockExpr  @../src/test_parser.nit:76,2--4
 |                 |  |           `--TKwend  end @../src/test_parser.nit:76,2--4
-\e[37m77        
+77     
        var tc = new ToolContext
-\e[m\e[37m78             var tc = new ToolContext
-\e[m|                 |  |--AVardeclExpr  @../src/test_parser.nit:78,2--25
+78             var tc = new ToolContext
+|                 |  |--AVardeclExpr  @../src/test_parser.nit:78,2--25
 |                 |  |  |--TKwvar  var @../src/test_parser.nit:78,2--4
 |                 |  |  |--TId  tc @../src/test_parser.nit:78,6--7
 |                 |  |  |--TAssign  = @../src/test_parser.nit:78,9
@@ -648,13 +648,13 @@ if (args.is_empty and not interactive) or need_help then
 |                 |  |     |  `--AQclassid  @../src/test_parser.nit:78,15--25
 |                 |  |     |     `--TClassid  ToolContext @../src/test_parser.nit:78,15--25
 |                 |  |     `--AListExprs  @../src/test_parser.nit:78,25
-\e[37m79        
+79     
        loop
-\e[m\e[37m80             loop
-\e[m|                 |  `--ALoopExpr  @../src/test_parser.nit:80,2--100,4
+80             loop
+|                 |  `--ALoopExpr  @../src/test_parser.nit:80,2--100,4
 |                 |     |--TKwloop  loop @../src/test_parser.nit:80,2--5
-\e[37m81                        var n = tc.interactive_parse("-->")
-\e[m|                 |     `--ABlockExpr  @../src/test_parser.nit:81,3--100,4
+81                     var n = tc.interactive_parse("-->")
+|                 |     `--ABlockExpr  @../src/test_parser.nit:81,3--100,4
 |                 |        |--AVardeclExpr  @../src/test_parser.nit:81,3--37
 |                 |        |  |--TKwvar  var @../src/test_parser.nit:81,3--5
 |                 |        |  |--TId  n @../src/test_parser.nit:81,7
@@ -672,8 +672,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |        |--AStringExpr  @../src/test_parser.nit:81,32--36
 |                 |        |        |  `--TString  \"-->\" @../src/test_parser.nit:81,32--36
 |                 |        |        `--TCpar  ) @../src/test_parser.nit:81,37
-\e[37m82                        if n isa TString then
-\e[m|                 |        |--AIfExpr  @../src/test_parser.nit:82,3--90,5
+82                     if n isa TString then
+|                 |        |--AIfExpr  @../src/test_parser.nit:82,3--90,5
 |                 |        |  |--TKwif  if @../src/test_parser.nit:82,3--4
 |                 |        |  |--AIsaExpr  @../src/test_parser.nit:82,6--18
 |                 |        |  |  |--ACallExpr  @../src/test_parser.nit:82,6
@@ -686,8 +686,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |     `--AQclassid  @../src/test_parser.nit:82,12--18
 |                 |        |  |        `--TClassid  TString @../src/test_parser.nit:82,12--18
 |                 |        |  |--TKwthen  then @../src/test_parser.nit:82,20--23
-\e[37m83                                var s = n.text
-\e[m|                 |        |  |--ABlockExpr  @../src/test_parser.nit:83,4--89,11
+83                             var s = n.text
+|                 |        |  |--ABlockExpr  @../src/test_parser.nit:83,4--89,11
 |                 |        |  |  |--AVardeclExpr  @../src/test_parser.nit:83,4--17
 |                 |        |  |  |  |--TKwvar  var @../src/test_parser.nit:83,4--6
 |                 |        |  |  |  |--TId  s @../src/test_parser.nit:83,8
@@ -701,8 +701,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |  |     |--AQid  @../src/test_parser.nit:83,14--17
 |                 |        |  |  |     |  `--TId  text @../src/test_parser.nit:83,14--17
 |                 |        |  |  |     `--AListExprs  @../src/test_parser.nit:83,17
-\e[37m84                                if s == ":q" then
-\e[m|                 |        |  |  |--AIfExpr  @../src/test_parser.nit:84,4--88,6
+84                             if s == ":q" then
+|                 |        |  |  |--AIfExpr  @../src/test_parser.nit:84,4--88,6
 |                 |        |  |  |  |--TKwif  if @../src/test_parser.nit:84,4--5
 |                 |        |  |  |  |--AEqExpr  @../src/test_parser.nit:84,7--15
 |                 |        |  |  |  |  |--ACallExpr  @../src/test_parser.nit:84,7
@@ -714,14 +714,14 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |  |  |  `--AStringExpr  @../src/test_parser.nit:84,12--15
 |                 |        |  |  |  |     `--TString  \":q\" @../src/test_parser.nit:84,12--15
 |                 |        |  |  |  |--TKwthen  then @../src/test_parser.nit:84,17--20
-\e[37m85                                        break
-\e[m|                 |        |  |  |  |--ABlockExpr  @../src/test_parser.nit:85,5--9
+85                                     break
+|                 |        |  |  |  |--ABlockExpr  @../src/test_parser.nit:85,5--9
 |                 |        |  |  |  |  `--ABreakExpr  @../src/test_parser.nit:85,5--9
 |                 |        |  |  |  |     `--TKwbreak  break @../src/test_parser.nit:85,5--9
-\e[37m86                                else
-\e[m|                 |        |  |  |  |--TKwelse  else @../src/test_parser.nit:86,4--7
-\e[37m87                                        print "`:q` to quit"
-\e[m|                 |        |  |  |  `--ABlockExpr  @../src/test_parser.nit:87,5--88,6
+86                             else
+|                 |        |  |  |  |--TKwelse  else @../src/test_parser.nit:86,4--7
+87                                     print "`:q` to quit"
+|                 |        |  |  |  `--ABlockExpr  @../src/test_parser.nit:87,5--88,6
 |                 |        |  |  |     |--ACallExpr  @../src/test_parser.nit:87,5--24
 |                 |        |  |  |     |  |--AImplicitSelfExpr  @../src/test_parser.nit:87,5
 |                 |        |  |  |     |  |--AQid  @../src/test_parser.nit:87,5--9
@@ -729,18 +729,18 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |  |     |  `--AListExprs  @../src/test_parser.nit:87,11--24
 |                 |        |  |  |     |     `--AStringExpr  @../src/test_parser.nit:87,11--24
 |                 |        |  |  |     |        `--TString  \"`:q` to quit\" @../src/test_parser.nit:87,11--24
-\e[37m88                                end
-\e[m|                 |        |  |  |     `--TKwend  end @../src/test_parser.nit:88,4--6
-\e[37m89                                continue
-\e[m|                 |        |  |  `--AContinueExpr  @../src/test_parser.nit:89,4--11
+88                             end
+|                 |        |  |  |     `--TKwend  end @../src/test_parser.nit:88,4--6
+89                             continue
+|                 |        |  |  `--AContinueExpr  @../src/test_parser.nit:89,4--11
 |                 |        |  |     `--TKwcontinue  continue @../src/test_parser.nit:89,4--11
-\e[37m90                        end
-\e[m|                 |        |  `--ABlockExpr  @../src/test_parser.nit:90,3--5
+90                     end
+|                 |        |  `--ABlockExpr  @../src/test_parser.nit:90,3--5
 |                 |        |     `--TKwend  end @../src/test_parser.nit:90,3--5
-\e[37m91        
+91     
                if n isa AError then
-\e[m\e[37m92                     if n isa AError then
-\e[m|                 |        |--AIfExpr  @../src/test_parser.nit:92,3--95,5
+92                     if n isa AError then
+|                 |        |--AIfExpr  @../src/test_parser.nit:92,3--95,5
 |                 |        |  |--TKwif  if @../src/test_parser.nit:92,3--4
 |                 |        |  |--AIsaExpr  @../src/test_parser.nit:92,6--17
 |                 |        |  |  |--ACallExpr  @../src/test_parser.nit:92,6
@@ -753,8 +753,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |     `--AQclassid  @../src/test_parser.nit:92,12--17
 |                 |        |  |        `--TClassid  AError @../src/test_parser.nit:92,12--17
 |                 |        |  |--TKwthen  then @../src/test_parser.nit:92,19--22
-\e[37m93                                print "{n.location.colored_line("0;31")}: {n.message}"
-\e[m|                 |        |  |--ABlockExpr  @../src/test_parser.nit:93,4--94,11
+93                             print "{n.location.colored_line("0;31")}: {n.message}"
+|                 |        |  |--ABlockExpr  @../src/test_parser.nit:93,4--94,11
 |                 |        |  |  |--ACallExpr  @../src/test_parser.nit:93,4--57
 |                 |        |  |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:93,4
 |                 |        |  |  |  |--AQid  @../src/test_parser.nit:93,4--8
@@ -793,16 +793,16 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |  |        |  `--AListExprs  @../src/test_parser.nit:93,55
 |                 |        |  |  |        `--AEndStringExpr  @../src/test_parser.nit:93,56--57
 |                 |        |  |  |           `--TEndString  }\" @../src/test_parser.nit:93,56--57
-\e[37m94                                continue
-\e[m|                 |        |  |  `--AContinueExpr  @../src/test_parser.nit:94,4--11
+94                             continue
+|                 |        |  |  `--AContinueExpr  @../src/test_parser.nit:94,4--11
 |                 |        |  |     `--TKwcontinue  continue @../src/test_parser.nit:94,4--11
-\e[37m95                        end
-\e[m|                 |        |  `--ABlockExpr  @../src/test_parser.nit:95,3--5
+95                     end
+|                 |        |  `--ABlockExpr  @../src/test_parser.nit:95,3--5
 |                 |        |     `--TKwend  end @../src/test_parser.nit:95,3--5
-\e[37m96        
+96     
                if not no_print then
-\e[m\e[37m97                     if not no_print then
-\e[m|                 |        |--AIfExpr  @../src/test_parser.nit:97,3--99,5
+97                     if not no_print then
+|                 |        |--AIfExpr  @../src/test_parser.nit:97,3--99,5
 |                 |        |  |--TKwif  if @../src/test_parser.nit:97,3--4
 |                 |        |  |--ANotExpr  @../src/test_parser.nit:97,6--17
 |                 |        |  |  |--TKwnot  not @../src/test_parser.nit:97,6--8
@@ -812,8 +812,8 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |     |  `--TId  no_print @../src/test_parser.nit:97,10--17
 |                 |        |  |     `--AListExprs  @../src/test_parser.nit:97,17
 |                 |        |  |--TKwthen  then @../src/test_parser.nit:97,19--22
-\e[37m98                                n.dump_tree
-\e[m|                 |        |  |--ABlockExpr  @../src/test_parser.nit:98,4--14
+98                             n.dump_tree
+|                 |        |  |--ABlockExpr  @../src/test_parser.nit:98,4--14
 |                 |        |  |  `--ACallExpr  @../src/test_parser.nit:98,4--14
 |                 |        |  |     |--ACallExpr  @../src/test_parser.nit:98,4
 |                 |        |  |     |  |--AImplicitSelfExpr  @../src/test_parser.nit:98,4
@@ -823,15 +823,15 @@ if (args.is_empty and not interactive) or need_help then
 |                 |        |  |     |--AQid  @../src/test_parser.nit:98,6--14
 |                 |        |  |     |  `--TId  dump_tree @../src/test_parser.nit:98,6--14
 |                 |        |  |     `--AListExprs  @../src/test_parser.nit:98,14
-\e[37m99                        end
-\e[m|                 |        |  `--ABlockExpr  @../src/test_parser.nit:99,3--5
+99                     end
+|                 |        |  `--ABlockExpr  @../src/test_parser.nit:99,3--5
 |                 |        |     `--TKwend  end @../src/test_parser.nit:99,3--5
-\e[37m100               end
-\e[m|                 |        `--TKwend  end @../src/test_parser.nit:100,2--4
-\e[37m101       else
-\e[m|                 |--TKwelse  else @../src/test_parser.nit:101,1--4
-\e[37m102               for a in args do
-\e[m|                 `--ABlockExpr  @../src/test_parser.nit:102,2--138,3
+100            end
+|                 |        `--TKwend  end @../src/test_parser.nit:100,2--4
+101    else
+|                 |--TKwelse  else @../src/test_parser.nit:101,1--4
+102            for a in args do
+|                 `--ABlockExpr  @../src/test_parser.nit:102,2--138,3
 |                    |--AForExpr  @../src/test_parser.nit:102,2--137,4
 |                    |  |--TKwfor  for @../src/test_parser.nit:102,2--4
 |                    |  |--AForGroup  @../src/test_parser.nit:102,6--14
@@ -843,13 +843,13 @@ if (args.is_empty and not interactive) or need_help then
 |                    |  |     |  `--TId  args @../src/test_parser.nit:102,11--14
 |                    |  |     `--AListExprs  @../src/test_parser.nit:102,14
 |                    |  |--TKwdo  do @../src/test_parser.nit:102,16--17
-\e[37m103                       var source
-\e[m|                    |  `--ABlockExpr  @../src/test_parser.nit:103,3--137,4
+103                    var source
+|                    |  `--ABlockExpr  @../src/test_parser.nit:103,3--137,4
 |                    |     |--AVardeclExpr  @../src/test_parser.nit:103,3--12
 |                    |     |  |--TKwvar  var @../src/test_parser.nit:103,3--5
 |                    |     |  `--TId  source @../src/test_parser.nit:103,7--12
-\e[37m104                       if no_file then
-\e[m|                    |     |--AIfExpr  @../src/test_parser.nit:104,3--110,5
+104                    if no_file then
+|                    |     |--AIfExpr  @../src/test_parser.nit:104,3--110,5
 |                    |     |  |--TKwif  if @../src/test_parser.nit:104,3--4
 |                    |     |  |--ACallExpr  @../src/test_parser.nit:104,6--12
 |                    |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:104,6
@@ -857,8 +857,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |  |  `--TId  no_file @../src/test_parser.nit:104,6--12
 |                    |     |  |  `--AListExprs  @../src/test_parser.nit:104,12
 |                    |     |  |--TKwthen  then @../src/test_parser.nit:104,14--17
-\e[37m105                               source = new SourceFile.from_string("", a)
-\e[m|                    |     |  |--ABlockExpr  @../src/test_parser.nit:105,4--45
+105                            source = new SourceFile.from_string("", a)
+|                    |     |  |--ABlockExpr  @../src/test_parser.nit:105,4--45
 |                    |     |  |  `--ACallAssignExpr  @../src/test_parser.nit:105,4--45
 |                    |     |  |     |--AImplicitSelfExpr  @../src/test_parser.nit:105,4
 |                    |     |  |     |--AQid  @../src/test_parser.nit:105,4--9
@@ -882,10 +882,10 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |           |  |  `--TId  a @../src/test_parser.nit:105,44
 |                    |     |  |           |  `--AListExprs  @../src/test_parser.nit:105,44
 |                    |     |  |           `--TCpar  ) @../src/test_parser.nit:105,45
-\e[37m106                       else
-\e[m|                    |     |  |--TKwelse  else @../src/test_parser.nit:106,3--6
-\e[37m107                               var f = new FileReader.open(a)
-\e[m|                    |     |  `--ABlockExpr  @../src/test_parser.nit:107,4--110,5
+106                    else
+|                    |     |  |--TKwelse  else @../src/test_parser.nit:106,3--6
+107                            var f = new FileReader.open(a)
+|                    |     |  `--ABlockExpr  @../src/test_parser.nit:107,4--110,5
 |                    |     |     |--AVardeclExpr  @../src/test_parser.nit:107,4--33
 |                    |     |     |  |--TKwvar  var @../src/test_parser.nit:107,4--6
 |                    |     |     |  |--TId  f @../src/test_parser.nit:107,8
@@ -905,8 +905,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |        |  |  `--TId  a @../src/test_parser.nit:107,32
 |                    |     |     |        |  `--AListExprs  @../src/test_parser.nit:107,32
 |                    |     |     |        `--TCpar  ) @../src/test_parser.nit:107,33
-\e[37m108                               source = new SourceFile(a, f)
-\e[m|                    |     |     |--ACallAssignExpr  @../src/test_parser.nit:108,4--32
+108                            source = new SourceFile(a, f)
+|                    |     |     |--ACallAssignExpr  @../src/test_parser.nit:108,4--32
 |                    |     |     |  |--AImplicitSelfExpr  @../src/test_parser.nit:108,4
 |                    |     |     |  |--AQid  @../src/test_parser.nit:108,4--9
 |                    |     |     |  |  `--TId  source @../src/test_parser.nit:108,4--9
@@ -930,8 +930,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |        |  |  `--TId  f @../src/test_parser.nit:108,31
 |                    |     |     |        |  `--AListExprs  @../src/test_parser.nit:108,31
 |                    |     |     |        `--TCpar  ) @../src/test_parser.nit:108,32
-\e[37m109                               f.close
-\e[m|                    |     |     |--ACallExpr  @../src/test_parser.nit:109,4--10
+109                            f.close
+|                    |     |     |--ACallExpr  @../src/test_parser.nit:109,4--10
 |                    |     |     |  |--ACallExpr  @../src/test_parser.nit:109,4
 |                    |     |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:109,4
 |                    |     |     |  |  |--AQid  @../src/test_parser.nit:109,4
@@ -940,10 +940,10 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |--AQid  @../src/test_parser.nit:109,6--10
 |                    |     |     |  |  `--TId  close @../src/test_parser.nit:109,6--10
 |                    |     |     |  `--AListExprs  @../src/test_parser.nit:109,10
-\e[37m110                       end
-\e[m|                    |     |     `--TKwend  end @../src/test_parser.nit:110,3--5
-\e[37m111                       var lexer = new Lexer(source)
-\e[m|                    |     |--AVardeclExpr  @../src/test_parser.nit:111,3--31
+110                    end
+|                    |     |     `--TKwend  end @../src/test_parser.nit:110,3--5
+111                    var lexer = new Lexer(source)
+|                    |     |--AVardeclExpr  @../src/test_parser.nit:111,3--31
 |                    |     |  |--TKwvar  var @../src/test_parser.nit:111,3--5
 |                    |     |  |--TId  lexer @../src/test_parser.nit:111,7--11
 |                    |     |  |--TAssign  = @../src/test_parser.nit:111,13
@@ -960,8 +960,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |        |  |  `--TId  source @../src/test_parser.nit:111,25--30
 |                    |     |        |  `--AListExprs  @../src/test_parser.nit:111,30
 |                    |     |        `--TCpar  ) @../src/test_parser.nit:111,31
-\e[37m112                       if only_lexer then
-\e[m|                    |     |--AIfExpr  @../src/test_parser.nit:112,3--136,5
+112                    if only_lexer then
+|                    |     |--AIfExpr  @../src/test_parser.nit:112,3--136,5
 |                    |     |  |--TKwif  if @../src/test_parser.nit:112,3--4
 |                    |     |  |--ACallExpr  @../src/test_parser.nit:112,6--15
 |                    |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:112,6
@@ -969,8 +969,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |  |  `--TId  only_lexer @../src/test_parser.nit:112,6--15
 |                    |     |  |  `--AListExprs  @../src/test_parser.nit:112,15
 |                    |     |  |--TKwthen  then @../src/test_parser.nit:112,17--20
-\e[37m113                               var token = lexer.next
-\e[m|                    |     |  |--ABlockExpr  @../src/test_parser.nit:113,4--119,6
+113                            var token = lexer.next
+|                    |     |  |--ABlockExpr  @../src/test_parser.nit:113,4--119,6
 |                    |     |  |  |--AVardeclExpr  @../src/test_parser.nit:113,4--25
 |                    |     |  |  |  |--TKwvar  var @../src/test_parser.nit:113,4--6
 |                    |     |  |  |  |--TId  token @../src/test_parser.nit:113,8--12
@@ -984,8 +984,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |  |     |--AQid  @../src/test_parser.nit:113,22--25
 |                    |     |  |  |     |  `--TId  next @../src/test_parser.nit:113,22--25
 |                    |     |  |  |     `--AListExprs  @../src/test_parser.nit:113,25
-\e[37m114                               while not token isa EOF do
-\e[m|                    |     |  |  `--AWhileExpr  @../src/test_parser.nit:114,4--119,6
+114                            while not token isa EOF do
+|                    |     |  |  `--AWhileExpr  @../src/test_parser.nit:114,4--119,6
 |                    |     |  |     |--TKwwhile  while @../src/test_parser.nit:114,4--8
 |                    |     |  |     |--ANotExpr  @../src/test_parser.nit:114,10--26
 |                    |     |  |     |  |--TKwnot  not @../src/test_parser.nit:114,10--12
@@ -1000,8 +1000,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |     |        `--AQclassid  @../src/test_parser.nit:114,24--26
 |                    |     |  |     |           `--TClassid  EOF @../src/test_parser.nit:114,24--26
 |                    |     |  |     |--TKwdo  do @../src/test_parser.nit:114,28--29
-\e[37m115                                       if not no_print then
-\e[m|                    |     |  |     `--ABlockExpr  @../src/test_parser.nit:115,5--119,6
+115                                    if not no_print then
+|                    |     |  |     `--ABlockExpr  @../src/test_parser.nit:115,5--119,6
 |                    |     |  |        |--AIfExpr  @../src/test_parser.nit:115,5--117,7
 |                    |     |  |        |  |--TKwif  if @../src/test_parser.nit:115,5--6
 |                    |     |  |        |  |--ANotExpr  @../src/test_parser.nit:115,8--19
@@ -1012,8 +1012,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |        |  |     |  `--TId  no_print @../src/test_parser.nit:115,12--19
 |                    |     |  |        |  |     `--AListExprs  @../src/test_parser.nit:115,19
 |                    |     |  |        |  |--TKwthen  then @../src/test_parser.nit:115,21--24
-\e[37m116                                               print("Read token at {token.location} text='{token.text}'")
-\e[m|                    |     |  |        |  |--ABlockExpr  @../src/test_parser.nit:116,6--64
+116                                            print("Read token at {token.location} text='{token.text}'")
+|                    |     |  |        |  |--ABlockExpr  @../src/test_parser.nit:116,6--64
 |                    |     |  |        |  |  `--ACallExpr  @../src/test_parser.nit:116,6--64
 |                    |     |  |        |  |     |--AImplicitSelfExpr  @../src/test_parser.nit:116,6
 |                    |     |  |        |  |     |--AQid  @../src/test_parser.nit:116,6--10
@@ -1046,11 +1046,11 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |        |  |        |  `--AEndStringExpr  @../src/test_parser.nit:116,61--63
 |                    |     |  |        |  |        |     `--TEndString  }\'\" @../src/test_parser.nit:116,61--63
 |                    |     |  |        |  |        `--TCpar  ) @../src/test_parser.nit:116,64
-\e[37m117                                       end
-\e[m|                    |     |  |        |  `--ABlockExpr  @../src/test_parser.nit:117,5--7
+117                                    end
+|                    |     |  |        |  `--ABlockExpr  @../src/test_parser.nit:117,5--7
 |                    |     |  |        |     `--TKwend  end @../src/test_parser.nit:117,5--7
-\e[37m118                                       token = lexer.next
-\e[m|                    |     |  |        |--ACallAssignExpr  @../src/test_parser.nit:118,5--22
+118                                    token = lexer.next
+|                    |     |  |        |--ACallAssignExpr  @../src/test_parser.nit:118,5--22
 |                    |     |  |        |  |--AImplicitSelfExpr  @../src/test_parser.nit:118,5
 |                    |     |  |        |  |--AQid  @../src/test_parser.nit:118,5--9
 |                    |     |  |        |  |  `--TId  token @../src/test_parser.nit:118,5--9
@@ -1065,12 +1065,12 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |  |        |     |--AQid  @../src/test_parser.nit:118,19--22
 |                    |     |  |        |     |  `--TId  next @../src/test_parser.nit:118,19--22
 |                    |     |  |        |     `--AListExprs  @../src/test_parser.nit:118,22
-\e[37m119                               end
-\e[m|                    |     |  |        `--TKwend  end @../src/test_parser.nit:119,4--6
-\e[37m120                       else
-\e[m|                    |     |  |--TKwelse  else @../src/test_parser.nit:120,3--6
-\e[37m121                               var parser = new Parser(lexer)
-\e[m|                    |     |  `--ABlockExpr  @../src/test_parser.nit:121,4--136,5
+119                            end
+|                    |     |  |        `--TKwend  end @../src/test_parser.nit:119,4--6
+120                    else
+|                    |     |  |--TKwelse  else @../src/test_parser.nit:120,3--6
+121                            var parser = new Parser(lexer)
+|                    |     |  `--ABlockExpr  @../src/test_parser.nit:121,4--136,5
 |                    |     |     |--AVardeclExpr  @../src/test_parser.nit:121,4--33
 |                    |     |     |  |--TKwvar  var @../src/test_parser.nit:121,4--6
 |                    |     |     |  |--TId  parser @../src/test_parser.nit:121,8--13
@@ -1088,8 +1088,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |        |  |  `--TId  lexer @../src/test_parser.nit:121,28--32
 |                    |     |     |        |  `--AListExprs  @../src/test_parser.nit:121,32
 |                    |     |     |        `--TCpar  ) @../src/test_parser.nit:121,33
-\e[37m122                               var tree = parser.parse
-\e[m|                    |     |     |--AVardeclExpr  @../src/test_parser.nit:122,4--26
+122                            var tree = parser.parse
+|                    |     |     |--AVardeclExpr  @../src/test_parser.nit:122,4--26
 |                    |     |     |  |--TKwvar  var @../src/test_parser.nit:122,4--6
 |                    |     |     |  |--TId  tree @../src/test_parser.nit:122,8--11
 |                    |     |     |  |--TAssign  = @../src/test_parser.nit:122,13
@@ -1102,10 +1102,10 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |     |--AQid  @../src/test_parser.nit:122,22--26
 |                    |     |     |     |  `--TId  parse @../src/test_parser.nit:122,22--26
 |                    |     |     |     `--AListExprs  @../src/test_parser.nit:122,26
-\e[37m123       
+123    
                        var error = tree.n_eof
-\e[m\e[37m124                            var error = tree.n_eof
-\e[m|                    |     |     |--AVardeclExpr  @../src/test_parser.nit:124,4--25
+124                            var error = tree.n_eof
+|                    |     |     |--AVardeclExpr  @../src/test_parser.nit:124,4--25
 |                    |     |     |  |--TKwvar  var @../src/test_parser.nit:124,4--6
 |                    |     |     |  |--TId  error @../src/test_parser.nit:124,8--12
 |                    |     |     |  |--TAssign  = @../src/test_parser.nit:124,14
@@ -1118,8 +1118,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |     |--AQid  @../src/test_parser.nit:124,21--25
 |                    |     |     |     |  `--TId  n_eof @../src/test_parser.nit:124,21--25
 |                    |     |     |     `--AListExprs  @../src/test_parser.nit:124,25
-\e[37m125                               if error isa AError then
-\e[m|                    |     |     |--AIfExpr  @../src/test_parser.nit:125,4--128,6
+125                            if error isa AError then
+|                    |     |     |--AIfExpr  @../src/test_parser.nit:125,4--128,6
 |                    |     |     |  |--TKwif  if @../src/test_parser.nit:125,4--5
 |                    |     |     |  |--AIsaExpr  @../src/test_parser.nit:125,7--22
 |                    |     |     |  |  |--ACallExpr  @../src/test_parser.nit:125,7--11
@@ -1132,8 +1132,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |     `--AQclassid  @../src/test_parser.nit:125,17--22
 |                    |     |     |  |        `--TClassid  AError @../src/test_parser.nit:125,17--22
 |                    |     |     |  |--TKwthen  then @../src/test_parser.nit:125,24--27
-\e[37m126                                       print("Error at {error.location}:\n\t{error.message}")
-\e[m|                    |     |     |  |--ABlockExpr  @../src/test_parser.nit:126,5--127,10
+126                                    print("Error at {error.location}:\n\t{error.message}")
+|                    |     |     |  |--ABlockExpr  @../src/test_parser.nit:126,5--127,10
 |                    |     |     |  |  |--ACallExpr  @../src/test_parser.nit:126,5--58
 |                    |     |     |  |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:126,5
 |                    |     |     |  |  |  |--AQid  @../src/test_parser.nit:126,5--9
@@ -1166,16 +1166,16 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |  |     |  `--AEndStringExpr  @../src/test_parser.nit:126,56--57
 |                    |     |     |  |  |     |     `--TEndString  }\" @../src/test_parser.nit:126,56--57
 |                    |     |     |  |  |     `--TCpar  ) @../src/test_parser.nit:126,58
-\e[37m127                                       return
-\e[m|                    |     |     |  |  `--AReturnExpr  @../src/test_parser.nit:127,5--10
+127                                    return
+|                    |     |     |  |  `--AReturnExpr  @../src/test_parser.nit:127,5--10
 |                    |     |     |  |     `--TKwreturn  return @../src/test_parser.nit:127,5--10
-\e[37m128                               end
-\e[m|                    |     |     |  `--ABlockExpr  @../src/test_parser.nit:128,4--6
+128                            end
+|                    |     |     |  `--ABlockExpr  @../src/test_parser.nit:128,4--6
 |                    |     |     |     `--TKwend  end @../src/test_parser.nit:128,4--6
-\e[37m129       
+129    
                        if xml then
-\e[m\e[37m130                            if xml then
-\e[m|                    |     |     |--AIfExpr  @../src/test_parser.nit:130,4--135,6
+130                            if xml then
+|                    |     |     |--AIfExpr  @../src/test_parser.nit:130,4--135,6
 |                    |     |     |  |--TKwif  if @../src/test_parser.nit:130,4--5
 |                    |     |     |  |--ACallExpr  @../src/test_parser.nit:130,7--9
 |                    |     |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:130,7
@@ -1183,8 +1183,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |  |  `--TId  xml @../src/test_parser.nit:130,7--9
 |                    |     |     |  |  `--AListExprs  @../src/test_parser.nit:130,9
 |                    |     |     |  |--TKwthen  then @../src/test_parser.nit:130,11--14
-\e[37m131                                       tree.parentize_tokens
-\e[m|                    |     |     |  |--ABlockExpr  @../src/test_parser.nit:131,5--132,32
+131                                    tree.parentize_tokens
+|                    |     |     |  |--ABlockExpr  @../src/test_parser.nit:131,5--132,32
 |                    |     |     |  |  |--ACallExpr  @../src/test_parser.nit:131,5--25
 |                    |     |     |  |  |  |--ACallExpr  @../src/test_parser.nit:131,5--8
 |                    |     |     |  |  |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:131,5
@@ -1194,8 +1194,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |  |  |--AQid  @../src/test_parser.nit:131,10--25
 |                    |     |     |  |  |  |  `--TId  parentize_tokens @../src/test_parser.nit:131,10--25
 |                    |     |     |  |  |  `--AListExprs  @../src/test_parser.nit:131,25
-\e[37m132                                       tree.to_xml.write_to(stdout)
-\e[m|                    |     |     |  |  `--ACallExpr  @../src/test_parser.nit:132,5--32
+132                                    tree.to_xml.write_to(stdout)
+|                    |     |     |  |  `--ACallExpr  @../src/test_parser.nit:132,5--32
 |                    |     |     |  |     |--ACallExpr  @../src/test_parser.nit:132,5--15
 |                    |     |     |  |     |  |--ACallExpr  @../src/test_parser.nit:132,5--8
 |                    |     |     |  |     |  |  |--AImplicitSelfExpr  @../src/test_parser.nit:132,5
@@ -1215,8 +1215,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |  |        |  |  `--TId  stdout @../src/test_parser.nit:132,26--31
 |                    |     |     |  |        |  `--AListExprs  @../src/test_parser.nit:132,31
 |                    |     |     |  |        `--TCpar  ) @../src/test_parser.nit:132,32
-\e[37m133                               else if not no_print then
-\e[m|                    |     |     |  |--TKwelse  else @../src/test_parser.nit:133,4--7
+133                            else if not no_print then
+|                    |     |     |  |--TKwelse  else @../src/test_parser.nit:133,4--7
 |                    |     |     |  `--AIfExpr  @../src/test_parser.nit:133,9--135,6
 |                    |     |     |     |--TKwif  if @../src/test_parser.nit:133,9--10
 |                    |     |     |     |--ANotExpr  @../src/test_parser.nit:133,12--23
@@ -1227,8 +1227,8 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |     |     |  `--TId  no_print @../src/test_parser.nit:133,16--23
 |                    |     |     |     |     `--AListExprs  @../src/test_parser.nit:133,23
 |                    |     |     |     |--TKwthen  then @../src/test_parser.nit:133,25--28
-\e[37m134                                       tree.dump_tree
-\e[m|                    |     |     |     |--ABlockExpr  @../src/test_parser.nit:134,5--18
+134                                    tree.dump_tree
+|                    |     |     |     |--ABlockExpr  @../src/test_parser.nit:134,5--18
 |                    |     |     |     |  `--ACallExpr  @../src/test_parser.nit:134,5--18
 |                    |     |     |     |     |--ACallExpr  @../src/test_parser.nit:134,5--8
 |                    |     |     |     |     |  |--AImplicitSelfExpr  @../src/test_parser.nit:134,5
@@ -1238,14 +1238,14 @@ if (args.is_empty and not interactive) or need_help then
 |                    |     |     |     |     |--AQid  @../src/test_parser.nit:134,10--18
 |                    |     |     |     |     |  `--TId  dump_tree @../src/test_parser.nit:134,10--18
 |                    |     |     |     |     `--AListExprs  @../src/test_parser.nit:134,18
-\e[37m135                               end
-\e[m|                    |     |     |     `--ABlockExpr  @../src/test_parser.nit:135,4--6
+135                            end
+|                    |     |     |     `--ABlockExpr  @../src/test_parser.nit:135,4--6
 |                    |     |     |        `--TKwend  end @../src/test_parser.nit:135,4--6
-\e[37m136                       end
-\e[m|                    |     |     `--TKwend  end @../src/test_parser.nit:136,3--5
-\e[37m137               end
-\e[m|                    |     `--TKwend  end @../src/test_parser.nit:137,2--4
-\e[37m138       end
-\e[m|                    `--TKwend  end @../src/test_parser.nit:138,1--3
-\e[37m139       
-\e[m`--EOF   @../src/test_parser.nit:139,1
+136                    end
+|                    |     |     `--TKwend  end @../src/test_parser.nit:136,3--5
+137            end
+|                    |     `--TKwend  end @../src/test_parser.nit:137,2--4
+138    end
+|                    `--TKwend  end @../src/test_parser.nit:138,1--3
+139    
+`--EOF   @../src/test_parser.nit:139,1
index 9f0cc3e..9e7f49d 100644 (file)
@@ -1,5 +1,5 @@
-\e[37m1 var toto: Toto = new Toto.toto(toto+toto)
-\e[mStart  @1,1--42
+1      var toto: Toto = new Toto.toto(toto+toto)
+Start  @1,1--42
 |--AModule  @1,1--41
 |  `--AMainClassdef  @1,1--41
 |     `--AMainMethPropdef  @1,1--41
index 58227b7..b8320ad 100644 (file)
@@ -1,8 +1,8 @@
---> \e[37m1     1
-\e[mAIntegerExpr  @1,1
+--> 1  1
+AIntegerExpr  @1,1
 `--TInteger  1 @1,1
---> \e[37m1     hello world
-\e[mABlockExpr  @1,1--11
+--> 1  hello world
+ABlockExpr  @1,1--11
 `--ACallExpr  @1,1--11
    |--AImplicitSelfExpr  @1,1
    |--AQid  @1,1--5
          |--AQid  @1,7--11
          |  `--TId  world @1,7--11
          `--AListExprs  @1,11
---> \e[37m1     "hello world"
-\e[mAStringExpr  @1,1--13
+--> 1  "hello world"
+AStringExpr  @1,1--13
 `--TString  \"hello world\" @1,1--13
---> \e[37m1     for i in x do p
-\e[mAForExpr  @1,1--15
+--> 1  for i in x do p
+AForExpr  @1,1--15
 |--TKwfor  for @1,1--3
 |--AForGroup  @1,5--10
 |  |--TId  i @1,5
@@ -33,8 +33,8 @@
    |--AQid  @1,15
    |  `--TId  p @1,15
    `--AListExprs  @1,15
---> \e[37m1     fun foo do z
-\e[mAModule  @1,1--12
+--> 1  fun foo do z
+AModule  @1,1--12
 `--ATopClassdef  @1,1--12
    `--AMethPropdef  @1,1--12
       |--APublicVisibility  @1,1
@@ -48,8 +48,8 @@
          |--AQid  @1,12
          |  `--TId  z @1,12
          `--AListExprs  @1,12
---> ... ... \e[37m1     for i in x do
-\e[mAForExpr  @1,1--3,3
+--> ... ... 1  for i in x do
+AForExpr  @1,1--3,3
 |--TKwfor  for @1,1--3
 |--AForGroup  @1,5--10
 |  |--TId  i @1,5
 |     |  `--TId  x @1,10
 |     `--AListExprs  @1,10
 |--TKwdo  do @1,12--13
-\e[37m2 p
-\e[m`--ABlockExpr  @2,1--3,3
+2      p
+`--ABlockExpr  @2,1--3,3
    |--ACallExpr  @2,1
    |  |--AImplicitSelfExpr  @2,1
    |  |--AQid  @2,1
    |  |  `--TId  p @2,1
    |  `--AListExprs  @2,1
-\e[37m3 end
-\e[m   `--TKwend  end @3,1--3
---> ... ... ... ... \e[37m1     fun foo do
-\e[mAModule  @1,1--5,3
+3      end
+   `--TKwend  end @3,1--3
+--> ... ... ... ... 1  fun foo do
+AModule  @1,1--5,3
 `--ATopClassdef  @1,1--5,3
    `--AMethPropdef  @1,1--5,3
       |--APublicVisibility  @1,1
@@ -79,8 +79,8 @@
       |  `--TId  foo @1,5--7
       |--ASignature  @1,9
       |--TKwdo  do @1,9--10
-\e[37m2 for i in x do
-\e[m      `--ABlockExpr  @2,1--5,3
+2      for i in x do
+      `--ABlockExpr  @2,1--5,3
          |--AForExpr  @2,1--4,3
          |  |--TKwfor  for @2,1--3
          |  |--AForGroup  @2,5--10
          |  |     |  `--TId  x @2,10
          |  |     `--AListExprs  @2,10
          |  |--TKwdo  do @2,12--13
-\e[37m3 p
-\e[m         |  `--ABlockExpr  @3,1--4,3
+3      p
+         |  `--ABlockExpr  @3,1--4,3
          |     |--ACallExpr  @3,1
          |     |  |--AImplicitSelfExpr  @3,1
          |     |  |--AQid  @3,1
          |     |  |  `--TId  p @3,1
          |     |  `--AListExprs  @3,1
-\e[37m4 end
-\e[m         |     `--TKwend  end @4,1--3
-\e[37m5 end
-\e[m         `--TKwend  end @5,1--3
+4      end
+         |     `--TKwend  end @4,1--3
+5      end
+         `--TKwend  end @5,1--3
 --> ...        \e[0;31mfun\e[0m fun fun fu
        ^: Syntax Error: unexpected keyword 'fun'.
 -->    %\e[0;31m$\e[0m&^*
similarity index 50%
rename from src/picnit_shared.nit
rename to tests/test_catch_multi_threaded.nit
index 07d44cd..42795f4 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-# Services related to the Nit package manager
-module picnit_shared
+# Test the multi-threaded dynamic `do catch` mechanism
+import pthreads
 
-# Folder where are downloaded picnit packages
-fun picnit_lib_dir: String do do return "HOME".environ / ".local/lib/nit/"
+# A Thread that does a lot of `do catch`
+class CatchThread
+       super Thread
+
+       var x = 100000
+       var caught = 0
+
+       redef fun main do
+               do
+                       rec_do_catch
+               catch
+               end
+               print "caught {caught} aborts"
+               return null
+       end
+
+       fun rec_do_catch do
+               do
+                       x -= 1
+                       if x > 0 then
+                               rec_do_catch
+                       else
+                               abort
+                       end
+               catch
+                       self.caught += 1
+                       abort
+               end
+       end
+end
+
+var ts = new Array[CatchThread]
+var nb_threads = 10
+for i in [0..nb_threads[ do
+       var t = new CatchThread
+       ts.add(t)
+       t.start
+end
+for t in ts do t.join