nit.git
12 years agoadd src/doc in gitignore
Jean Privat [Thu, 1 Mar 2012 18:20:03 +0000 (13:20 -0500)]
add src/doc in gitignore

This will remove pollution in git tools when trying nitdoc in src.

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

12 years agoMerge branch 'fix-ni' into wip
Jean Privat [Mon, 27 Feb 2012 21:23:56 +0000 (16:23 -0500)]
Merge branch 'fix-ni' into wip

12 years agoni: fix allowing to rename parameters for redef as extern method
Alexis Laferrière [Fri, 24 Feb 2012 14:50:54 +0000 (09:50 -0500)]
ni: fix allowing to rename parameters for redef as extern method

Is actually used by nits to generated expected names. Will but more
useful with inline interface.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agotools: protect ccache detection to avoid pollution on stderr
Jean Privat [Mon, 27 Feb 2012 21:00:45 +0000 (16:00 -0500)]
tools: protect ccache detection to avoid pollution on stderr

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

12 years agolib: remove NativeFileCapable
Jean Privat [Thu, 23 Feb 2012 17:50:45 +0000 (12:50 -0500)]
lib: remove NativeFileCapable

Methods are moved as constructors in the NativeFile extern class.

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

12 years agoicode: do not visit non-existant instanciation iroutines of extern classes
Alexis Laferrière [Mon, 27 Feb 2012 17:21:51 +0000 (12:21 -0500)]
icode: do not visit non-existant instanciation iroutines of extern classes

Fixes global compilation of programs using extern constructors.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agotests: update nits.sav because of the merge
Jean Privat [Mon, 27 Feb 2012 20:09:21 +0000 (15:09 -0500)]
tests: update nits.sav because of the merge

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

12 years agoMerge branch 'global' into wip
Jean Privat [Mon, 27 Feb 2012 21:17:06 +0000 (16:17 -0500)]
Merge branch 'global' into wip

12 years agotests: update Makefile to test nits
Jean Privat [Mon, 27 Feb 2012 21:15:29 +0000 (16:15 -0500)]
tests: update Makefile to test nits

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

12 years agoMerge branch 'warn' into wip
Jean Privat [Mon, 27 Feb 2012 18:55:52 +0000 (13:55 -0500)]
Merge branch 'warn' into wip

12 years agoc_src: fix last update, _nitni.h s were referring to _nit.h from Nit src
Alexis Laferrière [Fri, 24 Feb 2012 18:53:47 +0000 (13:53 -0500)]
c_src: fix last update, _nitni.h s were referring to _nit.h from Nit src

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoRTA: inits are polymorphic
Jean Privat [Mon, 27 Feb 2012 17:45:22 +0000 (12:45 -0500)]
RTA: inits are polymorphic

Code assumed that call of an init are always monomorphic.
This is not true since a constrictor can call another constructor in a
polymorphic way.

The solution is to simply manage call to init the same way than other calls.

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

12 years agosyntax: warn for superfluous parentheses in signatures
Jean Privat [Mon, 27 Feb 2012 15:48:14 +0000 (10:48 -0500)]
syntax: warn for superfluous parentheses in signatures

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

12 years agoparser: include obra and cbra in signatures
Jean Privat [Mon, 27 Feb 2012 15:24:35 +0000 (10:24 -0500)]
parser: include obra and cbra in signatures

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

12 years agonitc: activate warnings by default
Jean Privat [Fri, 24 Feb 2012 21:40:32 +0000 (16:40 -0500)]
nitc: activate warnings by default

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

12 years agotyping: error on foo() when foo is a variable
Jean Privat [Fri, 24 Feb 2012 19:26:11 +0000 (14:26 -0500)]
typing: error on foo() when foo is a variable

With the last parser modification we can now distinguish between
no arguments and empty parentheses.

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

12 years agolib: remove obsolete sdl and game library
Jean Privat [Thu, 23 Feb 2012 17:55:22 +0000 (12:55 -0500)]
lib: remove obsolete sdl and game library

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

12 years agotests: change test_parser arguments to be more stable
Jean Privat [Fri, 24 Feb 2012 19:15:30 +0000 (14:15 -0500)]
tests: change test_parser arguments to be more stable

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

12 years agosrc: remove detected warnings about ()
Jean Privat [Fri, 24 Feb 2012 19:03:57 +0000 (14:03 -0500)]
src: remove detected warnings about ()

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

12 years agoni: minor code correction in ni_metamodel.nit
Alexis Laferrière [Thu, 3 Nov 2011 02:56:55 +0000 (22:56 -0400)]
ni: minor code correction in ni_metamodel.nit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoni: use special mangled name in ni generated code to support extern classes
Alexis Laferrière [Tue, 14 Feb 2012 01:06:19 +0000 (20:06 -0500)]
ni: use special mangled name in ni generated code to support extern classes

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agosyntax: warn on superfluous empty parentheses on calls
Jean Privat [Fri, 24 Feb 2012 16:55:45 +0000 (11:55 -0500)]
syntax: warn on superfluous empty parentheses on calls

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

12 years agoparser: include obra, cbra, opar and cpar in arguments
Jean Privat [Fri, 24 Feb 2012 16:49:17 +0000 (11:49 -0500)]
parser: include obra, cbra, opar and cpar in arguments

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

12 years agoparser: include obra and cbra in range nodes
Jean Privat [Fri, 24 Feb 2012 16:02:59 +0000 (11:02 -0500)]
parser: include obra and cbra in range nodes

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

12 years agolib&src: remove detected warnings
Jean Privat [Fri, 24 Feb 2012 15:45:52 +0000 (10:45 -0500)]
lib&src: remove detected warnings

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

12 years agonitc: do not crash on --output-format icode
Jean Privat [Thu, 23 Feb 2012 17:26:30 +0000 (12:26 -0500)]
nitc: do not crash on --output-format icode

However, --output-format icode is not really useful
in a multi-module program.

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

12 years agoglobal: move options from nitc.nit to global.nit
Jean Privat [Thu, 23 Feb 2012 16:34:00 +0000 (11:34 -0500)]
global: move options from nitc.nit to global.nit

Most of the global optimization concern should be in global.

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

12 years agotyping: some warning cleanup
Jean Privat [Fri, 24 Feb 2012 10:18:03 +0000 (05:18 -0500)]
typing: some warning cleanup

12 years agotools: kill showerr
Jean Privat [Fri, 24 Feb 2012 10:17:50 +0000 (05:17 -0500)]
tools: kill showerr

Now coloring is done entirely in nitc.

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

12 years agotyping: warn for superfluous parentheses
Jean Privat [Fri, 24 Feb 2012 10:16:03 +0000 (05:16 -0500)]
typing: warn for superfluous parentheses

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

12 years agoparser: include parentheses in parexpr and as_*expr
Jean Privat [Fri, 24 Feb 2012 10:15:15 +0000 (05:15 -0500)]
parser: include parentheses in parexpr and as_*expr

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

12 years agotyping: proxyexpr delegate more services
Jean Privat [Fri, 24 Feb 2012 10:13:28 +0000 (05:13 -0500)]
typing: proxyexpr delegate more services

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

12 years agoglobal: create a new module global to gather (and nest) global analysis
Jean Privat [Thu, 23 Feb 2012 15:26:08 +0000 (10:26 -0500)]
global: create a new module global to gather (and nest) global analysis

analysis now only contains local required analysis.

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

12 years agotools: clean Makefiles
Jean Privat [Fri, 17 Feb 2012 22:08:02 +0000 (17:08 -0500)]
tools: clean Makefiles

* create a Makefile in src
* rule 'docs' makes all the doc (including pdf)
* refresh 'clean' and 'distclean'

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

12 years agonitc: use simplify_path to manipulate sane filenames
Jean Privat [Fri, 17 Feb 2012 21:11:40 +0000 (16:11 -0500)]
nitc: use simplify_path to manipulate sane filenames

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

12 years agolit: add join_path
Jean Privat [Fri, 17 Feb 2012 21:06:15 +0000 (16:06 -0500)]
lit: add join_path

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

12 years agolib: handle ../.. in the simplify_path method
Jean Privat [Fri, 17 Feb 2012 21:05:55 +0000 (16:05 -0500)]
lib: handle ../.. in the simplify_path method

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

12 years agoparser: detect bad string and char literals
Jean Privat [Fri, 17 Feb 2012 17:19:40 +0000 (12:19 -0500)]
parser: detect bad string and char literals

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

12 years agoparser: allow comments without eol (for eof)
Jean Privat [Fri, 17 Feb 2012 16:50:16 +0000 (11:50 -0500)]
parser: allow comments without eol (for eof)

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

12 years agotools: handle end of file errors
Jean Privat [Fri, 17 Feb 2012 19:12:11 +0000 (14:12 -0500)]
tools: handle end of file errors

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

12 years agoparser: improve Token.to_s and syntax error messages
Jean Privat [Fri, 17 Feb 2012 19:09:40 +0000 (14:09 -0500)]
parser: improve Token.to_s and syntax error messages

So we say
   unexpected keyword 'end'
instead of
   unexpected token

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

12 years agoparser: integrate the token 'end' in the AST
Jean Privat [Fri, 17 Feb 2012 18:52:37 +0000 (13:52 -0500)]
parser: integrate the token 'end' in the AST

This provide better location since the 'end' is not ignored.
Other tool that use the AST may like to have it.

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

12 years agoparser: add a hot location for closure definitions
Jean Privat [Fri, 17 Feb 2012 15:44:08 +0000 (10:44 -0500)]
parser: add a hot location for closure definitions

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

12 years agoassert: use id.text.to_s instead of id.to_s for runtime error
Jean Privat [Fri, 17 Feb 2012 15:34:25 +0000 (10:34 -0500)]
assert: use id.text.to_s instead of id.to_s for runtime error

This prepare for better human readable Token.to_s

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

12 years agoc_src: update
Jean Privat [Thu, 16 Feb 2012 18:33:48 +0000 (13:33 -0500)]
c_src: update

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

12 years agotests: update nitdoc (because of the merge)
Jean Privat [Wed, 15 Feb 2012 21:32:10 +0000 (16:32 -0500)]
tests: update nitdoc (because of the merge)

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

12 years agoMerge branch 'ni' into wip
Jean Privat [Wed, 15 Feb 2012 21:07:31 +0000 (16:07 -0500)]
Merge branch 'ni' into wip

Conflict: use c_src of ni

12 years agoMerge branch 'nitdoc2' into wip
Jean Privat [Wed, 15 Feb 2012 21:06:09 +0000 (16:06 -0500)]
Merge branch 'nitdoc2' into wip

Conflicts:
lib/standard/file.nit
src/nitdoc.nit

12 years agomm: force inheritance when selectioning local property
Jean Privat [Tue, 14 Feb 2012 19:39:34 +0000 (14:39 -0500)]
mm: force inheritance when selectioning local property

Because of some optimizations, the inheritance is not always performed
on classes. The selection of a local property is not aware of that and
access thing event if the inheritance is not computed.

This patch force the inheritance if the global property is not found.

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

12 years agotests: improve the ls portability
Jean Privat [Wed, 15 Feb 2012 19:40:57 +0000 (14:40 -0500)]
tests: improve the ls portability

use /bin/ls to exclude shell aliases
force LANG to avoid variable sorting

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

12 years agotests: clean the write directory for tests with arguments
Jean Privat [Wed, 15 Feb 2012 20:46:52 +0000 (15:46 -0500)]
tests: clean the write directory for tests with arguments

This is the #1 cause of failed tests of the nitdoc.

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

12 years agoMerge branch 'lib' into wip
Jean Privat [Wed, 15 Feb 2012 20:09:38 +0000 (15:09 -0500)]
Merge branch 'lib' into wip

12 years agoMerge branch 'tools2' into wip
Jean Privat [Wed, 15 Feb 2012 20:09:22 +0000 (15:09 -0500)]
Merge branch 'tools2' into wip

12 years agotools: remove remaining POSIX_C_SOURCE
Jean Privat [Tue, 14 Feb 2012 19:11:46 +0000 (14:11 -0500)]
tools: remove remaining POSIX_C_SOURCE

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

12 years agotests: add new nitdoc options to test
Jean Privat [Wed, 15 Feb 2012 19:38:57 +0000 (14:38 -0500)]
tests: add new nitdoc options to test

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

12 years agoni: native_interface/frontier and its clients use syntax stuff
Jean Privat [Tue, 14 Feb 2012 19:17:21 +0000 (14:17 -0500)]
ni: native_interface/frontier and its clients use syntax stuff

Add the import the please to compiler.
However, maybe it should be removed.

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

12 years agoni: move default_extern_name and friendly_extern_name to primitive_info
Jean Privat [Tue, 14 Feb 2012 19:14:18 +0000 (14:14 -0500)]
ni: move default_extern_name and friendly_extern_name to primitive_info

Maybe it should be moved to metamodel?

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

12 years agoni: use MMMethod#global.is_init instead of MMMethod#is_init
Jean Privat [Tue, 14 Feb 2012 19:13:26 +0000 (14:13 -0500)]
ni: use MMMethod#global.is_init instead of MMMethod#is_init

The latter is in fact a syntax thing, the former is a metamodel thing.
This naming is just ugly

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

12 years agonitdoc: generate docs with foot-text and overview-text
Jean Privat [Wed, 15 Feb 2012 19:27:10 +0000 (14:27 -0500)]
nitdoc: generate docs with foot-text and overview-text

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

12 years agoanalysis: mark all extern methods as reachable and adds according test
Alexis Laferrière [Wed, 15 Feb 2012 16:15:42 +0000 (11:15 -0500)]
analysis: mark all extern methods as reachable and adds according test

This allows use and compiling of hybrid modules with unused native methods.

Before this patch, Nit methods explicitly called by an uncalled native method
might not be compiled to C. However, the C implmentation of the uncalled native
method cannot be pruned. Therefore, without the referenced Nit method, the
uncalled native method cannot be compiled.

TODO: Replace this solution by generating stubs for explicitly called Nit methods
referenced only by uncalled native methods.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoanalysis: fix analysis with native interface for global compilation
Alexis Laferrière [Wed, 15 Feb 2012 16:17:42 +0000 (11:17 -0500)]
analysis: fix analysis with native interface for global compilation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoicode: implements icode for explicit imports
Alexis Laferrière [Wed, 15 Feb 2012 14:57:02 +0000 (09:57 -0500)]
icode: implements icode for explicit imports

Will be used by static analysis. Also does not compile explicit extern calls.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agonitdoc: useless # in show_source
Jean Privat [Wed, 15 Feb 2012 19:01:59 +0000 (14:01 -0500)]
nitdoc: useless # in show_source

old Ruby reflex maybe...

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

12 years agonitdoc: fix missing spaces between modules names and following text
Alexandre Terrasa [Wed, 15 Feb 2012 05:35:58 +0000 (00:35 -0500)]
nitdoc: fix missing spaces between modules names and following text

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

12 years agonitdoc: add --overview-text et --footer-text options
Morriar [Wed, 15 Feb 2012 05:32:43 +0000 (00:32 -0500)]
nitdoc: add --overview-text et --footer-text options

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

12 years agolib: update the documentation
Jean Privat [Tue, 14 Feb 2012 19:49:19 +0000 (14:49 -0500)]
lib: update the documentation

Add some examples and fix some spelling issues

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

12 years agonitdoc: include the help in the menubar
Jean Privat [Tue, 14 Feb 2012 16:29:43 +0000 (11:29 -0500)]
nitdoc: include the help in the menubar

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

12 years agoNitDoc: Add help file.
Morriar [Mon, 13 Feb 2012 19:46:23 +0000 (14:46 -0500)]
NitDoc: Add help file.

Signed-off-by: Morriar <alexandre.terrasa@gmail.com>

12 years agonitdoc: changes class name used within dot graphs
Alexis Laferrière [Tue, 14 Feb 2012 04:53:22 +0000 (23:53 -0500)]
nitdoc: changes class name used within dot graphs

Avoids conflicts with classes named Edge.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agonitdoc: sets destination of Overview link to "index.html" instead of "./"
Alexis Laferrière [Tue, 14 Feb 2012 04:52:24 +0000 (23:52 -0500)]
nitdoc: sets destination of Overview link to "index.html" instead of "./"

Allows better use in local file-system.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: promote replace, html_escape and simplify_path to the lib
Jean Privat [Tue, 14 Feb 2012 16:10:30 +0000 (11:10 -0500)]
lib: promote replace, html_escape and simplify_path to the lib

These function are generic ans useful enough to be included in the
standard library.

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

12 years agonitdoc: handle vararg in signature
Jean Privat [Mon, 13 Feb 2012 21:30:58 +0000 (16:30 -0500)]
nitdoc: handle vararg in signature

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

12 years agonitdoc: use resource file from share/nitdoc
Jean Privat [Mon, 13 Feb 2012 21:29:14 +0000 (16:29 -0500)]
nitdoc: use resource file from share/nitdoc

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

12 years agonitdoc: Add shared files (imgs, styles and scripts)
Morriar [Sat, 11 Feb 2012 03:24:30 +0000 (22:24 -0500)]
nitdoc: Add shared files (imgs, styles and scripts)

Signed-off-by: Morriar <alexandre.terrasa@gmail.com>

12 years agoupdate NOTICE and LICENSE
Jean Privat [Mon, 13 Feb 2012 21:02:07 +0000 (16:02 -0500)]
update NOTICE and LICENSE

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

12 years agotools: add nits to .gitignore
Jean Privat [Tue, 14 Feb 2012 15:35:23 +0000 (10:35 -0500)]
tools: add nits to .gitignore

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

12 years agotests: fix test_parser
Jean Privat [Tue, 14 Feb 2012 15:24:02 +0000 (10:24 -0500)]
tests: fix test_parser

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

12 years agotests: removes incomplete and duplicate tests for native interface
Alexis Laferrière [Mon, 13 Feb 2012 20:07:03 +0000 (15:07 -0500)]
tests: removes incomplete and duplicate tests for native interface

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agotests: adds sav for test_ni_cast_extra
Alexis Laferrière [Mon, 13 Feb 2012 20:04:05 +0000 (15:04 -0500)]
tests: adds sav for test_ni_cast_extra

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoni: fix isa checks with new module names and updates c_src accordingly
Alexis Laferrière [Mon, 13 Feb 2012 19:14:34 +0000 (14:14 -0500)]
ni: fix isa checks with new module names and updates c_src accordingly

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: adds hypotenuse to math module as Float::hypot
Alexis Laferrière [Fri, 11 Nov 2011 17:08:34 +0000 (12:08 -0500)]
lib: adds hypotenuse to math module as Float::hypot

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: adds String::file_extension to retreive extension from a path
Alexis Laferrière [Thu, 9 Feb 2012 20:02:52 +0000 (15:02 -0500)]
lib: adds String::file_extension to retreive extension from a path

ex: "my.file.txt".file_extension == "txt"

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: adds Collection::rand to get a random element from a collection
Alexis Laferrière [Mon, 6 Jun 2011 17:35:13 +0000 (13:35 -0400)]
lib: adds Collection::rand to get a random element from a collection

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: adds swap_at to arrays
Alexis Laferrière [Sun, 3 Apr 2011 15:57:20 +0000 (11:57 -0400)]
lib: adds swap_at to arrays

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: adds abs function to Int
Alexis Laferrière [Thu, 31 Mar 2011 23:11:13 +0000 (19:11 -0400)]
lib: adds abs function to Int

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agolib: remove some depreciated methods in Map
Jean Privat [Fri, 10 Feb 2012 16:44:04 +0000 (11:44 -0500)]
lib: remove some depreciated methods in Map

Known clients are updated.

The only remaining depreciated method is has_key.

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

12 years agolib: removals on Map are done on the views (keys and values)
Jean Privat [Fri, 10 Feb 2012 17:13:55 +0000 (12:13 -0500)]
lib: removals on Map are done on the views (keys and values)

Thus depreciate some methods in Map
remove_at -> keys.remove
remove -> values.remove
remove_all -> values.remove_all

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

12 years agolib: for on maps require two parameters
Jean Privat [Mon, 13 Feb 2012 19:01:25 +0000 (14:01 -0500)]
lib: for on maps require two parameters

Existing clients require to adapts existing loops on map:

    for v in my_map do

has to be rewrite to

    for k, v in my_map do

or

    for v in my_map.values do

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

12 years agolib: add 'keys' and 'values' methods in Map
Jean Privat [Fri, 10 Feb 2012 16:24:45 +0000 (11:24 -0500)]
lib: add 'keys' and 'values' methods in Map

Make a bunch of method in Map depreciated and implement them by using
a delegation trough keys or values.

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

12 years agolib: MapIterator is no more an Iterator
Jean Privat [Fri, 10 Feb 2012 16:32:35 +0000 (11:32 -0500)]
lib: MapIterator is no more an Iterator

One more step to detach Map from the Collection hierarchy.

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

12 years agolib: Map is no more a Collection
Jean Privat [Fri, 10 Feb 2012 14:52:20 +0000 (09:52 -0500)]
lib: Map is no more a Collection

Many methods of Collection are copied to ensure compatibility but
they will be depreciated soon.

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

12 years agoc_src: update
Jean Privat [Fri, 10 Feb 2012 14:50:02 +0000 (09:50 -0500)]
c_src: update

The objective of the update is to handle the generalized "for".
It is required

12 years agolib: HashCollection is no more a Collection
Jean Privat [Fri, 10 Feb 2012 14:17:27 +0000 (09:17 -0500)]
lib: HashCollection is no more a Collection

This change is completely unharmful since HashCollection is a private
class. The subclasses HashMap and HashSet are already a Collection (via
Map and Set).

The point of the patch is to prepare suppression of the specialization
between Map and Collection.

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

12 years agolib: remove specialization link between Map and Sequence
Jean Privat [Fri, 10 Feb 2012 14:08:43 +0000 (09:08 -0500)]
lib: remove specialization link between Map and Sequence

IndexedIterator#key and Sequence#has_key are not maintained

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

12 years agolib: removes explicit super declaration of Pointer as it is now implicit
Alexis Laferrière [Fri, 10 Feb 2012 22:18:04 +0000 (17:18 -0500)]
lib: removes explicit super declaration of Pointer as it is now implicit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agoc_src: updates c_src for extern classes to be special of Pointer
Alexis Laferrière [Sat, 11 Feb 2012 20:27:55 +0000 (15:27 -0500)]
c_src: updates c_src for extern classes to be special of Pointer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agomm: moves class type detection to class building analysis
Alexis Laferrière [Sat, 13 Aug 2011 15:54:48 +0000 (11:54 -0400)]
mm: moves class type detection to class building analysis

This allows knowing the class kind when analysing super-classes.
Will be used to set default super-class of extern classes as Pointer.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agotools: put libs after objects
Alexis Laferrière [Fri, 10 Feb 2012 20:35:22 +0000 (15:35 -0500)]
tools: put libs after objects

Extern libs (given by --cc-lib-name) should also appears after the objects.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agocompile: intro of option files for modules with special needs
Alexis Laferrière [Mon, 1 Aug 2011 17:29:10 +0000 (13:29 -0400)]
compile: intro of option files for modules with special needs

This allows the user to specify compiler arguments for each module with files.
To do so for a given module "json", the user inputs the args for the compiler
in a file named json.nit.args. As example, the content of the file could be
"--cc-lib-name json", which asks to link with a native library when using this
module. Theses args will be interpreted as those given on the command line.

The args allowed are limited to C compilation options, as others don't seam
to be of any use in this way.

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

12 years agotools: adds nits, a compiler of help files to use the native interface
Alexis Laferrière [Thu, 18 Aug 2011 20:57:13 +0000 (16:57 -0400)]
tools: adds nits, a compiler of help files to use the native interface

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>