nit.git
9 years agomisc/vim: update README with latest features
Alexis Laferrière [Sun, 8 Feb 2015 18:06:43 +0000 (13:06 -0500)]
misc/vim: update README with latest features

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

9 years agomisc/vim: use shorter … char
Alexis Laferrière [Sat, 7 Feb 2015 16:54:54 +0000 (11:54 -0500)]
misc/vim: use shorter … char

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

9 years agomisc/vim: use separately class types, constructors and class declarations
Alexis Laferrière [Sat, 7 Feb 2015 13:22:31 +0000 (08:22 -0500)]
misc/vim: use separately class types, constructors and class declarations

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

9 years agonitpick autocomplete: differenciate between class types, constructors and class decla...
Alexis Laferrière [Sat, 7 Feb 2015 13:20:54 +0000 (08:20 -0500)]
nitpick autocomplete: differenciate between class types, constructors and class declarations

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

9 years agonitpick autocomplete: do not list properties beginning with @ or _
Alexis Laferrière [Sat, 7 Feb 2015 13:19:49 +0000 (08:19 -0500)]
nitpick autocomplete: do not list properties beginning with @ or _

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

9 years agoMerge: nitrpg: more statistics
Jean Privat [Sat, 7 Feb 2015 16:03:37 +0000 (23:03 +0700)]
Merge: nitrpg: more statistics

Some changes on the stats API and new stats for Players.

Pull-Request: #1154
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agoMerge: Detect covariance
Jean Privat [Sat, 7 Feb 2015 13:46:15 +0000 (20:46 +0700)]
Merge: Detect covariance

After a slow cleanup time, publication of the tool to detect and categorize the static usage of covariance in Nit programs.

@jpages yeah!

Pull-Request: #1151
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Regen c_src without libunwind
Jean Privat [Sat, 7 Feb 2015 13:43:54 +0000 (20:43 +0700)]
Merge: Regen c_src without libunwind

The last `c_src` is 3 month old, it seems to be usual to have 3 to 4 months between updates.

This update also did not depends on libunwind: so no stacktrace but can compile on rasperry pi. so fix #1149
Note that the following steps of the initial make will still implicitly include libunwind, so on raspberry, either do the next steps manually with `--stacktrace none` or edit `src/Makefile` to add `--stacktrace none` to both `NITCOPT` and `OLDNITCOPT` (at the begin of the file)

Pull-Request: #1152
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Vim omnifunc for Nit
Jean Privat [Sat, 7 Feb 2015 13:43:24 +0000 (20:43 +0700)]
Merge: Vim omnifunc for Nit

Alternative autocompletion for Nit. This one is triggered by a call to
the omnitfunc, usually `ctrl-x ctrl-o`. It will show context
appropriated modules, classes and properties. It shows all properties,
but it does not use static types to show the methods available on the
specific receiver. It also displays some doc!

It uses `nitpick` to generate metadata files analyzed by the Vim plugin.
So in combination with `syntastic`, each time you save, and the program
is valid, it updates the metadata files.

Pull-Request: #1146
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agotests: update sav/test_test_phase_args1.res
Jean Privat [Fri, 6 Feb 2015 09:16:30 +0000 (16:16 +0700)]
tests: update sav/test_test_phase_args1.res

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

9 years agotests: update sav/nitmetrics_args*.res
Jean Privat [Fri, 6 Feb 2015 05:51:07 +0000 (12:51 +0700)]
tests: update sav/nitmetrics_args*.res

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

9 years agometrics: rename title of detect_variance_constraints
Jean Privat [Fri, 6 Feb 2015 16:13:21 +0000 (23:13 +0700)]
metrics: rename title of detect_variance_constraints

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

9 years agometrics: add --detect-covariance
Jean Privat [Fri, 6 Feb 2015 01:09:22 +0000 (08:09 +0700)]
metrics: add --detect-covariance

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

9 years agocontrib/nitrpg: clean stats display in panels
Alexandre Terrasa [Thu, 5 Feb 2015 00:50:51 +0000 (01:50 +0100)]
contrib/nitrpg: clean stats display in panels

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: do stats on players
Alexandre Terrasa [Fri, 6 Feb 2015 22:29:48 +0000 (23:29 +0100)]
contrib/nitrpg: do stats on players

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: do not save Game for all received events
Alexandre Terrasa [Fri, 6 Feb 2015 22:29:35 +0000 (23:29 +0100)]
contrib/nitrpg: do not save Game for all received events

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: do stats on merged commits
Alexandre Terrasa [Fri, 6 Feb 2015 22:24:51 +0000 (23:24 +0100)]
contrib/nitrpg: do stats on merged commits

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: move statistics to GameEntity
Alexandre Terrasa [Thu, 5 Feb 2015 00:46:59 +0000 (01:46 +0100)]
contrib/nitrpg: move statistics to GameEntity

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: extends GameStats API with Counter
Alexandre Terrasa [Fri, 6 Feb 2015 22:23:58 +0000 (23:23 +0100)]
contrib/nitrpg: extends GameStats API with Counter

Also makes it redef `game` like other GameEntity.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agomisc: update README on info for the Nit omnifunc
Alexis Laferrière [Thu, 5 Feb 2015 21:20:17 +0000 (16:20 -0500)]
misc: update README on info for the Nit omnifunc

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

9 years agomisc/vim: use the metadata files for a better autocompletion
Alexis Laferrière [Wed, 4 Feb 2015 17:01:57 +0000 (12:01 -0500)]
misc/vim: use the metadata files for a better autocompletion

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

9 years agonitpick: generate metadata files for the Vim plugin
Alexis Laferrière [Wed, 4 Feb 2015 17:01:24 +0000 (12:01 -0500)]
nitpick: generate metadata files for the Vim plugin

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

9 years agotest_test_phase: count projects, classdefs and methods
Jean Privat [Thu, 5 Feb 2015 14:38:02 +0000 (21:38 +0700)]
test_test_phase: count projects, classdefs and methods

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

9 years agomodelbuilder: add `check_subtype` and `check_sametype`
Jean Privat [Thu, 5 Feb 2015 14:29:26 +0000 (21:29 +0700)]
modelbuilder: add `check_subtype` and `check_sametype`

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

9 years agomisc/vim: always use the standard library for autocompletion
Alexis Laferrière [Wed, 4 Feb 2015 11:03:06 +0000 (06:03 -0500)]
misc/vim: always use the standard library for autocompletion

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

9 years agoc_src: regenerate
Jean Privat [Fri, 6 Feb 2015 11:50:27 +0000 (18:50 +0700)]
c_src: regenerate

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

9 years agomkcsrc: temporally disable stacktrace (libunwind) for c_src
Jean Privat [Fri, 6 Feb 2015 11:49:34 +0000 (18:49 +0700)]
mkcsrc: temporally disable stacktrace (libunwind) for c_src

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

9 years agoMerge: Generalize instance creation service so FFI can use it
Jean Privat [Fri, 6 Feb 2015 01:14:55 +0000 (08:14 +0700)]
Merge: Generalize instance creation service so FFI can use it

Move up instance creation from ANew to AbstractCompilerVisitor so they can be used from the FFI implementation. Allows to call extern constructors of extern classes from extern code, and fix #1145.

Pull-Request: #1150
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>

9 years agoMerge: GitHub merge: some improvements
Jean Privat [Fri, 6 Feb 2015 01:14:49 +0000 (08:14 +0700)]
Merge: GitHub merge: some improvements

Pull-Request: #1148
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Makefile: initial make use --semi-global
Jean Privat [Fri, 6 Feb 2015 01:14:36 +0000 (08:14 +0700)]
Merge: Makefile: initial make use --semi-global

The produced tools in bin/ should be faster to use then.

Pull-Request: #1147
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Global for filenames
Jean Privat [Fri, 6 Feb 2015 01:14:25 +0000 (08:14 +0700)]
Merge: Global for filenames

This PR remove the remaining big variability for nitc when generating separate files: the path of nit module in runtime error messages.
When compiling a same module but from different current working directories, the relative path of the module changed. Thus causing unnecessary difference in the generated C source code that made ccache unhappy.

Before
~~~
$ ccache -C
$ time nitc src/nitc.nit
user 2m8.264s
$ cd src
$ time nitc nitc.nit
user 2m8.676s
~~~

After
~~~
$ ccache -C
$ time nitc src/nitc.nit
user 2m9.180s
$ cd src
$ time nitc nitc.nit
user 0m9.812s
~~~

Note: some files are still different after the PR

* main.c because it contains the real filepath
* c_function_hash.c same
* _ffi.? because the pragma lines indicate the original relative file

Note 2: `.nit_compile` directories are still created by default in the current directory and let unclean. cf #792

Pull-Request: #1144
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: String memory fixes
Jean Privat [Fri, 6 Feb 2015 01:14:19 +0000 (08:14 +0700)]
Merge: String memory fixes

Another step towards the closure of #1106 and #69, this PR removes several calls to `malloc` in `lib/standard` C code and replaces them by some of the solutions proposed in #1106 to handle the allocation of Strings.

@xymus: Your review is more than welcome since we're dealing with extern code, it might be a good time to specify and document how to properly allocate extern data structures to avoid leaking code such as the ones we had.

Pull-Request: #1140
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

9 years agoMerge: nitdoc: introduces phases
Jean Privat [Fri, 6 Feb 2015 01:14:13 +0000 (08:14 +0700)]
Merge: nitdoc: introduces phases

This serie of commit introduces the concept of DocPhase.

The first commit introduces new concepts that are used by the other commits to move code.

For each phase, related code is extracted from `doc_pages` to the corresponding `doc_phases`.
No code is actually deleted from `doc_pages` between steps. The complete module is deleted at the end.

Refactoring is kept at a minimal level in this PR (just enough to get compatibility between old `doc_model` and new `doc_phases`).
Some hacks are used to preserve a minimum of differences in the generated HTML.

Further commits will continue the cleaning / refactoring but also change the outputed HTML, so I prefer wait for a new PR.
Demo (wait for Jenkins): http://gresil.org/jenkins/job/CI-nitdoc/

Pull-Request: #1135
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agotests: test calling extern constructors from extern code
Alexis Laferrière [Thu, 5 Feb 2015 15:11:54 +0000 (10:11 -0500)]
tests: test calling extern constructors from extern code

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

9 years agonitc: fix calling extern constructors from extern code in separate compiler
Alexis Laferrière [Thu, 5 Feb 2015 14:59:55 +0000 (09:59 -0500)]
nitc: fix calling extern constructors from extern code in separate compiler

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

9 years agoniti: Fixed method NativeString::copy_to in intern_call
Lucas Bajolet [Thu, 5 Feb 2015 15:53:02 +0000 (10:53 -0500)]
niti: Fixed method NativeString::copy_to in intern_call

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agolib/standard/time: Fixed String-related memory leak
Lucas Bajolet [Tue, 3 Feb 2015 21:47:39 +0000 (16:47 -0500)]
lib/standard/time: Fixed String-related memory leak

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agolib/standard/string: Removed Float.to_precision_native
Lucas Bajolet [Tue, 3 Feb 2015 20:53:01 +0000 (15:53 -0500)]
lib/standard/string: Removed Float.to_precision_native

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agolib/standard/string: Fixed leaking Int.to_s method
Lucas Bajolet [Mon, 2 Feb 2015 18:16:44 +0000 (13:16 -0500)]
lib/standard/string: Fixed leaking Int.to_s method

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agomodelize: move resolve_mtype to modelbuilder_base.nit
Jean Privat [Thu, 5 Feb 2015 14:25:46 +0000 (21:25 +0700)]
modelize: move resolve_mtype to modelbuilder_base.nit

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

9 years agogithub_merge: show cover letter after successful merge.
Jean Privat [Thu, 5 Feb 2015 07:03:25 +0000 (14:03 +0700)]
github_merge: show cover letter after successful merge.

If the merge fails, the cover letter will be shown during the commit,
so no need to show it before.

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

9 years agogithub_merge: do not crash if the mergeable status is unknown
Jean Privat [Thu, 5 Feb 2015 06:59:35 +0000 (13:59 +0700)]
github_merge: do not crash if the mergeable status is unknown

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

9 years agogithub_merge: always to a merge commit (--no-ff)
Jean Privat [Thu, 5 Feb 2015 06:57:56 +0000 (13:57 +0700)]
github_merge: always to a merge commit (--no-ff)

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

9 years agoMerge: loader: get_mgroup look in path
Jean Privat [Thu, 5 Feb 2015 06:47:14 +0000 (13:47 +0700)]
Merge: loader: get_mgroup look in path

Was asked by @xymus in #1134 to be able to do `nitls -M standard`

Pull-Request: #1143
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

9 years agoMerge: contrib: Introduce nitrpg
Jean Privat [Thu, 5 Feb 2015 06:46:56 +0000 (13:46 +0700)]
Merge: contrib: Introduce nitrpg

We have been talking about this a long ago. I made some demos, merged the full Github API stack...

Tonight is the nigth!

In this first PR we introduce some game basics and just enough to show how the game is supposed to work.
You can run it as this but the game only rewards new pull requests and +1 comments.
Further PR will introduce more capabilities like Github history reload, achievements, experience...

The game is separated into two tools:

* `listener` is the Github hook that capture all the github events on a repo.
* `web` is a Nitcorn client that display the game as a HTML website.

Four first commits are from #1141, please disregard.

Pull-Request: #1142
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agoMakefile: initial make use --semi-global
Jean Privat [Thu, 5 Feb 2015 02:40:06 +0000 (09:40 +0700)]
Makefile: initial make use --semi-global

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

9 years agonitdoc: remove unused module `doc_pages`
Alexandre Terrasa [Wed, 4 Feb 2015 20:17:00 +0000 (21:17 +0100)]
nitdoc: remove unused module `doc_pages`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: adapt `doc_model` to avoid diff with new phases
Alexandre Terrasa [Wed, 4 Feb 2015 20:18:35 +0000 (21:18 +0100)]
nitdoc: adapt `doc_model` to avoid diff with new phases

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce IndexingPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:16:22 +0000 (21:16 +0100)]
nitdoc: introduce IndexingPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce RenderHTMLPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:15:51 +0000 (21:15 +0100)]
nitdoc: introduce RenderHTMLPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce IntroRedefListPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:13:06 +0000 (21:13 +0100)]
nitdoc: introduce IntroRedefListPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce InheritanceListsPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:09:27 +0000 (21:09 +0100)]
nitdoc: introduce InheritanceListsPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce GraphsPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:08:09 +0000 (21:08 +0100)]
nitdoc: introduce GraphsPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce POSetPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:06:25 +0000 (21:06 +0100)]
nitdoc: introduce POSetPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce StructurePhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:03:46 +0000 (21:03 +0100)]
nitdoc: introduce StructurePhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce ConcernsPhase
Alexandre Terrasa [Wed, 4 Feb 2015 20:00:28 +0000 (21:00 +0100)]
nitdoc: introduce ConcernsPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce MakePagePhase
Alexandre Terrasa [Wed, 4 Feb 2015 19:55:08 +0000 (20:55 +0100)]
nitdoc: introduce MakePagePhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce ExtractionPhase
Alexandre Terrasa [Wed, 4 Feb 2015 19:53:31 +0000 (20:53 +0100)]
nitdoc: introduce ExtractionPhase

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: migrate nitdoc from `doc_pages` to `doc_phases`
Alexandre Terrasa [Wed, 4 Feb 2015 19:51:02 +0000 (20:51 +0100)]
nitdoc: migrate nitdoc from `doc_pages` to `doc_phases`

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: create `doc_phases` group
Alexandre Terrasa [Wed, 4 Feb 2015 18:30:59 +0000 (19:30 +0100)]
nitdoc: create `doc_phases` group

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agonitdoc: introduce `doc_base` module
Alexandre Terrasa [Mon, 2 Feb 2015 18:36:59 +0000 (19:36 +0100)]
nitdoc: introduce `doc_base` module

This module introduces new Nitdoc concepts:
* DocModel
* DocPage and DocComposite
* DocPhase

These concepts will be used in further commits to "phasify" Nitdoc.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: gitignore binaries, cache and game data
Alexandre Terrasa [Wed, 4 Feb 2015 18:55:15 +0000 (19:55 +0100)]
contrib/nitrpg: gitignore binaries, cache and game data

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: add a Makefile
Alexandre Terrasa [Tue, 3 Feb 2015 21:40:42 +0000 (22:40 +0100)]
contrib/nitrpg: add a Makefile

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: introduce the tool that run the website
Alexandre Terrasa [Tue, 3 Feb 2015 21:40:07 +0000 (22:40 +0100)]
contrib/nitrpg: introduce the tool that run the website

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: introduce templates to render the game as an HTML website
Alexandre Terrasa [Tue, 3 Feb 2015 21:38:27 +0000 (22:38 +0100)]
contrib/nitrpg: introduce templates to render the game as an HTML website

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: add a listener tool to update the game from GithubEvents
Alexandre Terrasa [Tue, 3 Feb 2015 21:37:21 +0000 (22:37 +0100)]
contrib/nitrpg: add a listener tool to update the game from GithubEvents

This listener must be running to keep the game up to date.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: add some basic reactors
Alexandre Terrasa [Tue, 3 Feb 2015 21:35:45 +0000 (22:35 +0100)]
contrib/nitrpg: add some basic reactors

Here the reactors are used to collect new pull request and comments to reward the player with nitcoins.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib/nitrpg: enable statistics collection from GithubEvent
Alexandre Terrasa [Tue, 3 Feb 2015 21:34:46 +0000 (22:34 +0100)]
contrib/nitrpg: enable statistics collection from GithubEvent

This shows how to implement GameReactors.
Statistics will also be used latter in the web display.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocontrib: introduce nitrpg base structures
Alexandre Terrasa [Tue, 3 Feb 2015 21:33:16 +0000 (22:33 +0100)]
contrib: introduce nitrpg base structures

Nitrpg is a rpg game coded in nit that works with Github.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agocompiler: use global constant instead of literal to indicate file-name in errors
Jean Privat [Wed, 4 Feb 2015 15:14:02 +0000 (22:14 +0700)]
compiler: use global constant instead of literal to indicate file-name in errors

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

9 years agoloader: attach mmodule to sourcefile
Jean Privat [Wed, 4 Feb 2015 15:15:05 +0000 (22:15 +0700)]
loader: attach mmodule to sourcefile

So the associated module can be retrieved from any node

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

9 years agoMerge: GitHub misc
Jean Privat [Wed, 4 Feb 2015 08:38:19 +0000 (15:38 +0700)]
Merge: GitHub misc

Some fixes for the Github API.

Also introduce `Repo::search_issues` which allow to list specific issues with an advanced query.

Pull-Request: #1141
Reviewed-by: Jean Privat <jean@pryen.org>

9 years agoMerge: Optimize get_or_null
Jean Privat [Wed, 4 Feb 2015 08:38:06 +0000 (15:38 +0700)]
Merge: Optimize get_or_null

Recent profiling of the interpreter nit shows that a lof of time is used in hashmaps. This PR improves the standard use-path with the safe method `get_or_null` that is more efficient (and simple) than `has_key` followed by `[]`.

The time for `nit doors_with_classes.nit 5000` give

before: 0m5.592s
after: 0m5.208s (-6,7%)

Note: by comparison, the ruby version is 0m2.284s, and the python is 0m0.116s ; there is still a lot of work

Pull-Request: #1139
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: jwrapper: interfaces, "Compiled from" line and output file without .nit
Jean Privat [Wed, 4 Feb 2015 08:37:57 +0000 (15:37 +0700)]
Merge: jwrapper: interfaces, "Compiled from" line and output file without .nit

Pull-Request: #1137
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agoMerge: Better Vim autocomplete by scanning all imported modules
Jean Privat [Wed, 4 Feb 2015 08:37:50 +0000 (15:37 +0700)]
Merge: Better Vim autocomplete by scanning all imported modules

The new Vim plugin uses `nitls` to locate all Nit modules relevant to the current directory. This is a nice way to support both complex projects and new incomplete modules.

The recommended usage is to update the list of modules when launching Vim and then do it manually afterwards. You may want to update it after adding an importation and saving the file. It could also be updated on each file save or loading but it gets pretty slow. Actually, the whole system may be too slow for older computers (sorry @R4PaSs) or those running inside a slow VM (sorry @BlackMinou and @MehdiAit).

A nice feature to have, would be to call `nitls` on the standard library when there's not local Nit source file or project. It occurs when creating the first Nit source file in an empty directory. @privat, what would be the best way to do that? Could we have `nitls -M standard`?

Pull-Request: #1134
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

9 years agoloader: get_mgroup look in path
Jean Privat [Wed, 4 Feb 2015 05:18:40 +0000 (12:18 +0700)]
loader: get_mgroup look in path

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

9 years agomodel: precise contracts for `lookup_*_definition?`
Jean Privat [Wed, 4 Feb 2015 02:07:27 +0000 (09:07 +0700)]
model: precise contracts for `lookup_*_definition?`

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

9 years agogithub/api: add `search_issue` service in Repo
Alexandre Terrasa [Tue, 3 Feb 2015 21:29:13 +0000 (22:29 +0100)]
github/api: add `search_issue` service in Repo

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agogithub/api: move `html_url` to GithubEntity since it's shared by all of them
Alexandre Terrasa [Tue, 3 Feb 2015 21:25:41 +0000 (22:25 +0100)]
github/api: move `html_url` to GithubEntity since it's shared by all of them

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agogithub/api: return an empty list instead of crashing for issues without labels
Alexandre Terrasa [Tue, 3 Feb 2015 21:24:49 +0000 (22:24 +0100)]
github/api: return an empty list instead of crashing for issues without labels

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agogithub/api: uniformize `load_issue_event` implementation with other services.
Alexandre Terrasa [Tue, 3 Feb 2015 21:22:59 +0000 (22:22 +0100)]
github/api: uniformize `load_issue_event` implementation with other services.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agorosetacode: improve doors_with_class (add optional argument)
Jean Privat [Tue, 3 Feb 2015 14:40:19 +0000 (21:40 +0700)]
rosetacode: improve doors_with_class (add optional argument)

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

9 years agolib/more_collections: simplify by using `Map::get_or_null`
Jean Privat [Tue, 3 Feb 2015 14:39:39 +0000 (21:39 +0700)]
lib/more_collections: simplify by using `Map::get_or_null`

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

9 years agomodel: use `Map::get_or_null` for `get_x_by_name`
Jean Privat [Tue, 3 Feb 2015 14:38:15 +0000 (21:38 +0700)]
model: use `Map::get_or_null` for `get_x_by_name`

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

9 years agomodel: move guards `lookup_first_definition` after cache miss
Jean Privat [Tue, 3 Feb 2015 13:54:44 +0000 (20:54 +0700)]
model: move guards `lookup_first_definition` after cache miss

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

9 years agolib/standard: redef a fast path for `HashMap#get_or_null`
Jean Privat [Tue, 3 Feb 2015 13:53:05 +0000 (20:53 +0700)]
lib/standard: redef a fast path for `HashMap#get_or_null`

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

9 years agojwrapper: accept interfaces
Alexis Laferrière [Tue, 3 Feb 2015 00:38:48 +0000 (19:38 -0500)]
jwrapper: accept interfaces

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

9 years agojwrapper: accept output files that do not look like Nit modules
Alexis Laferrière [Tue, 3 Feb 2015 00:38:10 +0000 (19:38 -0500)]
jwrapper: accept output files that do not look like Nit modules

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

9 years agomisc: rename README to README.md
Alexis Laferrière [Tue, 3 Feb 2015 02:46:42 +0000 (21:46 -0500)]
misc: rename README to README.md

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

9 years agomisc: intro a vim plugin with better autocomplete
Alexis Laferrière [Sat, 31 Jan 2015 16:40:20 +0000 (11:40 -0500)]
misc: intro a vim plugin with better autocomplete

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

9 years agojwrapper: deal with the optional "Compiled from" line in the grammar
Alexis Laferrière [Tue, 3 Feb 2015 00:36:29 +0000 (19:36 -0500)]
jwrapper: deal with the optional "Compiled from" line in the grammar

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

9 years agoMerge: Fix virtual types in string
Jean Privat [Sun, 1 Feb 2015 08:46:43 +0000 (15:46 +0700)]
Merge: Fix virtual types in string

`SELFTYPE` in String is used to dintinguish buffers from strings. Unfortunately it is sometime badly used.

This series try to at least improve thing so that operations on buffers do not crash at runtime.

Still, I think there is something fishy in the String vs Buffer API

Pull-Request: #1133
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Set accept null
Jean Privat [Sun, 1 Feb 2015 08:46:37 +0000 (15:46 +0700)]
Merge: Set accept null

Since keys of Maps can now be null, it enables the same rule with the Sets

Pull-Request: #1132
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: parser: slight improvement of the README
Jean Privat [Sun, 1 Feb 2015 08:46:32 +0000 (15:46 +0700)]
Merge: parser: slight improvement of the README

Copy a sentence from a page of the website before removing it.

nitdoc will soon nicely presents components of the compiler ; so just move existing doc in a single place make sense.

Pull-Request: #1131
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoMerge: Clean up to prepare for NitActivity
Jean Privat [Sun, 1 Feb 2015 08:46:23 +0000 (15:46 +0700)]
Merge: Clean up to prepare for NitActivity

This PR cleans the way to replace our current use of `NativeActivity` by our own `NitActivity` a direct subclass to `Activity`. The result of this PR that we are less dependent on `NativeActivity` and the `native_app_glue` module.

Notable modifications:

* Use Java `Activity` instead of `NativeActivity` wherever possible.
* Rename, to follow convention, Nit `NativeActivity` to `NativeNativeActivity` and `Activity` to `NativeActivity`. Thus all previous Java code using the Java `NativeActivity`, will now use Java `Activity`. The name `NativeNativeActivity` is weird, but temporary as the class will be removed once we have our `NitActivity`.

Pull-Request: #1128
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

9 years agoparser: slight improvement of the README
Jean Privat [Fri, 30 Jan 2015 14:46:05 +0000 (21:46 +0700)]
parser: slight improvement of the README

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

9 years agoversion 0.7.1 v0.7.1
Jean Privat [Fri, 30 Jan 2015 13:54:22 +0000 (20:54 +0700)]
version 0.7.1

9 years agolib/android: Bundle do not need a context or to import native_app_glue
Alexis Laferrière [Mon, 26 Jan 2015 11:58:37 +0000 (06:58 -0500)]
lib/android: Bundle do not need a context or to import native_app_glue

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

9 years agolib/android: extract activities from native_app_glue
Alexis Laferrière [Mon, 26 Jan 2015 11:55:28 +0000 (06:55 -0500)]
lib/android: extract activities from native_app_glue

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

9 years agolib/android: in Java, use Activity instead of NativeActivity
Alexis Laferrière [Mon, 26 Jan 2015 10:48:14 +0000 (05:48 -0500)]
lib/android: in Java, use Activity instead of NativeActivity

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