nit.git
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 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 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>

9 years agoSince keys of Maps can now be null, it enables the same rule with the Sets
Jean Privat [Fri, 30 Jan 2015 09:36:28 +0000 (16:36 +0700)]
Since keys of Maps can now be null, it enables the same rule with the Sets

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

9 years agostring: some methods sould return String instead of SELFTYPE
Jean Privat [Fri, 30 Jan 2015 09:29:39 +0000 (16:29 +0700)]
string: some methods sould return String instead of SELFTYPE

because it is what they returns

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

9 years agostring: fix SELFTYPE in String and Buffer
Jean Privat [Fri, 30 Jan 2015 09:03:44 +0000 (16:03 +0700)]
string: fix SELFTYPE in String and Buffer

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

9 years agostring: do not redef SELFTYPE in FlatBuffer
Jean Privat [Fri, 30 Jan 2015 09:02:53 +0000 (16:02 +0700)]
string: do not redef SELFTYPE in FlatBuffer

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

9 years agoupdate NOTICE
Jean Privat [Fri, 30 Jan 2015 02:14:33 +0000 (09:14 +0700)]
update NOTICE

9 years agoMerge: Ropefix
Jean Privat [Fri, 30 Jan 2015 02:01:18 +0000 (09:01 +0700)]
Merge: Ropefix

A few modifications to ropes, I discovered that the `+` routine used to create too many Concat nodes passed a certain point, which inceased the RAM use of Strings unnecessarily (might help with #1106's example program, on my machine the memory went from 200M+ used to 20M).

While I was at it, I removed a few old-style-inits that were no longer necessary.

Some others however I could not remove, maybe there is a way I can do so, but with the spec of the new constructors I'm not entirely sure how to do so without retaining unnneeded information or complexifying instanciation, that'll have to wait.

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

9 years agoMerge: ldflags for Android
Jean Privat [Thu, 29 Jan 2015 11:59:01 +0000 (18:59 +0700)]
Merge: ldflags for Android

For the same module, cflags and ldflags can vary per platform. This new annotation on annotations targets a platform for each cflags or ldflags. By default, the target platform is that of the host. It will probably need to be clarified on more modules once we support more platforms.

It will be used to load (or not load) OpenGL ES v1.0 vs 2.0 and libandroid in future PR. For now, only `calculator` should save on linking with OpenGL.

I hesitated between different annotations before settling on `@android`:
* `@target(android)` makes it clear that it is the target, but it gets a bit heavy to read: `module android_opengles1 is ldflags("-lEGL -lGLESv1_CM")@target(android)`
* `@only(android)` makes it clear that only Android is affected by this annotation.
* but `@android` is easy to read and clear enough to fit with an already complex syntax.

TODO `cflags@android` declarations are accepted but unused at this time.

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

9 years agoMerge: Optimizations in nitvm
Jean Privat [Thu, 29 Jan 2015 11:58:53 +0000 (18:58 +0700)]
Merge: Optimizations in nitvm

This PR introduces some change in the implementation of object mechanisms in the nitvm.

Now, the dispatch between several mechanisms is made directly in the AST nodes instead of in runtime mechanisms themselves.
This PR is preliminary work before the implementation of complex optimization systems, but now the nitvm is sligtly more efficent than before because the choice between implementations is only made once (the first time).

I use a workaround in AST nodes to avoid conflict with refinements between the interpreter and the vm.
In the future this will need to be well implemented, maybe by creating a sort of ```CallSite``` for subtyping test and attribute access and store informations into them instead of into the nodes.

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

9 years agolib/standard/ropes: Removed a few old-style-inits
Lucas Bajolet [Wed, 28 Jan 2015 21:19:48 +0000 (16:19 -0500)]
lib/standard/ropes: Removed a few old-style-inits

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

9 years agolib/standard/ropes: Fixed concatenation routine for Concat + FlatString
Lucas Bajolet [Wed, 28 Jan 2015 15:58:48 +0000 (10:58 -0500)]
lib/standard/ropes: Fixed concatenation routine for Concat + FlatString

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

9 years agonitvm: Optimize method call by dispatching between implementions in CallSites
Julien Pagès [Fri, 23 Jan 2015 09:58:54 +0000 (10:58 +0100)]
nitvm: Optimize method call by dispatching between implementions in CallSites

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agolib: update portable modules with ldflags specific to Android
Alexis Laferrière [Wed, 28 Jan 2015 14:52:36 +0000 (09:52 -0500)]
lib: update portable modules with ldflags specific to Android

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

9 years agolib: define Android ldflags in user modules
Alexis Laferrière [Wed, 28 Jan 2015 14:54:23 +0000 (09:54 -0500)]
lib: define Android ldflags in user modules

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

9 years agonitc & lib: intro the @android annotation and use it in nitc
Alexis Laferrière [Tue, 27 Jan 2015 02:41:22 +0000 (21:41 -0500)]
nitc & lib: intro the @android annotation and use it in nitc

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

9 years agonitc: refactor MModule cflags and ldflags to support different target platforms
Alexis Laferrière [Sun, 25 Jan 2015 16:10:52 +0000 (11:10 -0500)]
nitc: refactor MModule cflags and ldflags to support different target platforms

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

9 years agosrc: each platform has a name, except for the default
Alexis Laferrière [Wed, 28 Jan 2015 14:40:10 +0000 (09:40 -0500)]
src: each platform has a name, except for the default

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

9 years agonitvm: Optimize attribute access and subtyping test by orienting between implementati...
Julien Pagès [Fri, 23 Jan 2015 09:52:13 +0000 (10:52 +0100)]
nitvm: Optimize attribute access and subtyping test by orienting between implementations in AST nodes

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agoniti: Allow to redefine AST nodes in other engines, add documentation in vm
Julien Pagès [Tue, 13 Jan 2015 16:18:15 +0000 (17:18 +0100)]
niti: Allow to redefine AST nodes in other engines, add documentation in vm

Signed-off-by: Julien Pagès <julien.projet@gmail.com>

9 years agoMerge: A collection of miscellaneous commits
Jean Privat [Tue, 27 Jan 2015 03:59:43 +0000 (10:59 +0700)]
Merge: A collection of miscellaneous commits

Pull-Request: #1122
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>
Reviewed-by: Jean Privat <jean@pryen.org>

9 years agoMerge: Android support improvements
Jean Privat [Tue, 27 Jan 2015 03:32:49 +0000 (10:32 +0700)]
Merge: Android support improvements

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

9 years agoexamples/calculator: revamp style of the calculator code
Alexis Laferrière [Sun, 25 Jan 2015 23:32:17 +0000 (18:32 -0500)]
examples/calculator: revamp style of the calculator code

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

9 years agoC FFI: fix line offset in gcc errors on custom header code
Alexis Laferrière [Sun, 25 Jan 2015 17:55:47 +0000 (12:55 -0500)]
C FFI: fix line offset in gcc errors on custom header code

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

9 years agolib/egl: add `renderable_type` related features
Alexis Laferrière [Sat, 24 Jan 2015 19:49:19 +0000 (14:49 -0500)]
lib/egl: add `renderable_type` related features

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

9 years agolib/more_collections: add `remove_at` to `HashMap[23]`
Alexis Laferrière [Tue, 16 Dec 2014 14:14:09 +0000 (09:14 -0500)]
lib/more_collections: add `remove_at` to `HashMap[23]`

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

9 years agolib/gtk: copy string returned from `GTKEntry`
Alexis Laferrière [Fri, 2 Jan 2015 15:36:36 +0000 (10:36 -0500)]
lib/gtk: copy string returned from `GTKEntry`

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

9 years agolib/sdl: intro `has_mouse|input_focus`
Alexis Laferrière [Mon, 22 Dec 2014 15:42:49 +0000 (10:42 -0500)]
lib/sdl: intro `has_mouse|input_focus`

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

9 years agolib/mnit_input: add `KeyEvent::name`
Alexis Laferrière [Thu, 18 Dec 2014 16:21:15 +0000 (11:21 -0500)]
lib/mnit_input: add `KeyEvent::name`

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