nit.git
7 years agonitweb/angular: remove factorized header
Alexandre Terrasa [Tue, 21 Jun 2016 15:50:56 +0000 (11:50 -0400)]
nitweb/angular: remove factorized header

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

7 years agonitweb/angular: unify documentation packages
Alexandre Terrasa [Tue, 21 Jun 2016 15:50:23 +0000 (11:50 -0400)]
nitweb/angular: unify documentation packages

no more /package /group etc...

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

7 years agonitweb/angular: introduce namespace directive
Alexandre Terrasa [Tue, 21 Jun 2016 15:49:41 +0000 (11:49 -0400)]
nitweb/angular: introduce namespace directive

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

7 years agosrc: move model_html module from web/ to doc/
Alexandre Terrasa [Sat, 28 May 2016 20:10:11 +0000 (16:10 -0400)]
src: move model_html module from web/ to doc/

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

7 years agonitweb: remove useless modules since Angular app introduction
Alexandre Terrasa [Sat, 28 May 2016 20:08:43 +0000 (16:08 -0400)]
nitweb: remove useless modules since Angular app introduction

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

7 years agoMerge: nitweb: add graphs stubs
Jean Privat [Tue, 21 Jun 2016 19:15:40 +0000 (15:15 -0400)]
Merge: nitweb: add graphs stubs

Add some very simple graphs tabs to nitweb:

* Packages: http://nitweb.moz-code.org/package/popcorn
* Groups: http://nitweb.moz-code.org/group/popcorn%3E
* Modules: http://nitweb.moz-code.org/module/core::array
* Classes: http://nitweb.moz-code.org/class/core::Array

Pull-Request: #2174
Reviewed-by: Istvan SZALAÏ <istvan.szalai@savoirfairelinux.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Arthur Delamare <arthur.delamare@viacesi.fr>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

7 years agoMerge: model: Fix spelling mistake
Jean Privat [Tue, 21 Jun 2016 19:15:34 +0000 (15:15 -0400)]
Merge: model: Fix spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

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

7 years agoMerge: Java FFI: Improve documentation of `java` and `jvm`
Jean Privat [Tue, 21 Jun 2016 19:15:27 +0000 (15:15 -0400)]
Merge: Java FFI: Improve documentation of `java` and `jvm`

This PR improves the documentation of the modules related to the Java FFI: `java` and `jvm`. Besides the doc itself, the name of the module `java::base` has been changed to the more meaningful `java::ffi_support`.

As a bonus, the JVM API is simplified a bit, there's one less unused class in the Android modules and a few other details have been fixed.

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

7 years agomodel: Fix spelling mistake
jcbrinfo [Tue, 21 Jun 2016 17:27:07 +0000 (13:27 -0400)]
model: Fix spelling mistake

Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>

7 years agonitcc: to_minimal_dfa accepts non-tagged DFA
Jean Privat [Tue, 21 Jun 2016 17:03:54 +0000 (13:03 -0400)]
nitcc: to_minimal_dfa accepts non-tagged DFA

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

7 years agonitweb/angular: show entities graph
Alexandre Terrasa [Thu, 9 Jun 2016 15:25:10 +0000 (11:25 -0400)]
nitweb/angular: show entities graph

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

7 years agonitweb: add /api/graph/:entity
Alexandre Terrasa [Sat, 28 May 2016 17:46:58 +0000 (13:46 -0400)]
nitweb: add /api/graph/:entity

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

7 years agonitweb: add /api/inheritance/:id service
Alexandre Terrasa [Wed, 8 Jun 2016 15:44:43 +0000 (11:44 -0400)]
nitweb: add /api/inheritance/:id service

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

7 years agomodel_collect: generalize hierarchy_poset service
Alexandre Terrasa [Wed, 8 Jun 2016 15:44:05 +0000 (11:44 -0400)]
model_collect: generalize hierarchy_poset service

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

7 years agolib/dot: add package.ini
Alexandre Terrasa [Tue, 21 Jun 2016 14:23:49 +0000 (10:23 -0400)]
lib/dot: add package.ini

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

7 years agolib/dot: add examples
Alexandre Terrasa [Mon, 20 Jun 2016 22:42:08 +0000 (18:42 -0400)]
lib/dot: add examples

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

7 years agolib: introduce `dot` package
Alexandre Terrasa [Mon, 20 Jun 2016 22:42:00 +0000 (18:42 -0400)]
lib: introduce `dot` package

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

7 years agolib/jvm: document LD_LIBRARY_PATH
Alexis Laferrière [Tue, 21 Jun 2016 13:45:45 +0000 (09:45 -0400)]
lib/jvm: document LD_LIBRARY_PATH

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

7 years agoMerge: nitweb: add signatures to mproperties lists
Jean Privat [Tue, 21 Jun 2016 13:34:16 +0000 (09:34 -0400)]
Merge: nitweb: add signatures to mproperties lists

Demo: http://nitweb.moz-code.org/class/nitcorn::FileServer

Closes #2176

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

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

7 years agoMerge: libevent: improve "Error from bufferevent" with socket error code and name
Jean Privat [Tue, 21 Jun 2016 13:34:13 +0000 (09:34 -0400)]
Merge: libevent: improve "Error from bufferevent" with socket error code and name

This PR improves what is logged on callbacks reporting an error on a socket. It prints the error code and string from the last socket error. Some errors are ignored: ETIMEDOUT and ECONNRESET.

In the future, we may want to add more expected errors to the list, ignore all of them or let the client chose with a list, I don't know. Note that `event_callback` can be specialized by the clients, so they have access to this too.

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

7 years agoMerge: app.nit: update AsyncHttpRequest API, add examples and a simple implementation
Jean Privat [Tue, 21 Jun 2016 13:34:09 +0000 (09:34 -0400)]
Merge: app.nit: update AsyncHttpRequest API, add examples and a simple implementation

This PR updates the API of `AsyncHttpRequest`, using more general names for methods and adding a new variation point `uri`. The useful `uri_root` and `uri_tail` are still available as they are more practical to factorize code in real programs. Also provide the `http_status_code` to callbacks when the request succeeded.

Fix a few bugs: correct the ordering of the callback to the UI thread, and join the thread from the UI thread after request is completed.

Intro the new `SimpleAsyncHttpRequest` which prints feedback to the console on errors. It can be used when the response from the server is ignored, or as a quick and dirty first version in the prototype.

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

7 years agonitweb: add signatures to refs
Alexandre Terrasa [Mon, 20 Jun 2016 23:38:43 +0000 (19:38 -0400)]
nitweb: add signatures to refs

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

7 years agotests: update test_jvm
Alexis Laferrière [Mon, 20 Jun 2016 22:52:45 +0000 (18:52 -0400)]
tests: update test_jvm

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

7 years agocalculator: fix indentation
Alexis Laferrière [Sun, 12 Jun 2016 17:57:15 +0000 (13:57 -0400)]
calculator: fix indentation

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

7 years agolib/java: improve doc and remove duplicates
Alexis Laferrière [Sun, 12 Jun 2016 18:22:06 +0000 (14:22 -0400)]
lib/java: improve doc and remove duplicates

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

7 years agolib/java: rename `base` module to `ffi_support`
Alexis Laferrière [Mon, 20 Jun 2016 20:46:57 +0000 (16:46 -0400)]
lib/java: rename `base` module to `ffi_support`

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

7 years agolib/android: remove unused class `JavaClassLoader`
Alexis Laferrière [Wed, 15 Jun 2016 19:07:51 +0000 (15:07 -0400)]
lib/android: remove unused class `JavaClassLoader`

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

7 years agolib/android: fix type of NativeListOfScanResult
Alexis Laferrière [Wed, 15 Jun 2016 19:07:30 +0000 (15:07 -0400)]
lib/android: fix type of NativeListOfScanResult

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

7 years agolib/jvm: drop the complicated logic around `JniEnvRef`
Alexis Laferrière [Sun, 12 Jun 2016 18:21:00 +0000 (14:21 -0400)]
lib/jvm: drop the complicated logic around `JniEnvRef`

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

7 years agolib/jvm: update doc
Alexis Laferrière [Sun, 12 Jun 2016 17:58:10 +0000 (13:58 -0400)]
lib/jvm: update doc

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

7 years agolibevent: better "Error from bufferevent" and don't print everything
Alexis Laferrière [Mon, 20 Jun 2016 19:54:24 +0000 (15:54 -0400)]
libevent: better "Error from bufferevent" and don't print everything

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

7 years agolibevent: extract evutil_socket_error and evutil_socket_error_to_string
Alexis Laferrière [Sat, 18 Jun 2016 15:12:33 +0000 (11:12 -0400)]
libevent: extract evutil_socket_error and evutil_socket_error_to_string

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

7 years agoapp.nit: intro SimpleAsyncHttpRequest
Alexis Laferrière [Mon, 20 Jun 2016 14:44:02 +0000 (10:44 -0400)]
app.nit: intro SimpleAsyncHttpRequest

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

7 years agoapp.nit: intro example for AsyncHttpRequest
Alexis Laferrière [Mon, 20 Jun 2016 13:43:51 +0000 (09:43 -0400)]
app.nit: intro example for AsyncHttpRequest

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

7 years agoapp.nit: add `http_status_code` to `on_load`
Alexis Laferrière [Mon, 20 Jun 2016 13:20:02 +0000 (09:20 -0400)]
app.nit: add `http_status_code` to `on_load`

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

7 years agoapp.nit: update clients of AsyncHttpRequest
Alexis Laferrière [Mon, 20 Jun 2016 13:19:33 +0000 (09:19 -0400)]
app.nit: update clients of AsyncHttpRequest

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

7 years agoapp.nit: join AsyncHttpRequests
Alexis Laferrière [Mon, 20 Jun 2016 13:27:54 +0000 (09:27 -0400)]
app.nit: join AsyncHttpRequests

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

7 years agoapp.nit: fix order of callbacks in AsyncHttpRequest
Alexis Laferrière [Sat, 18 Jun 2016 15:11:53 +0000 (11:11 -0400)]
app.nit: fix order of callbacks in AsyncHttpRequest

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

7 years agoapp.nit: update AsyncHttpRequest API
Alexis Laferrière [Mon, 20 Jun 2016 13:13:55 +0000 (09:13 -0400)]
app.nit: update AsyncHttpRequest API

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

7 years agoMerge: Opportunity: log errors to stderr and update message on failed event creation
Jean Privat [Mon, 20 Jun 2016 14:27:23 +0000 (10:27 -0400)]
Merge: Opportunity: log errors to stderr and update message on failed event creation

Log all errors to stderr and remove prints on normal behavior.

Also update the error message, as the "meetup already exists" is now impossible because we dropped the uniqueness of name/date/location a while back.

This is related to #2186, where the file descriptor leak lead to bloated log files, a disk full and failed event creation by lack of space.

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

7 years agoMerge: libevent: force closing connections on error to fix file descriptors leak
Jean Privat [Mon, 20 Jun 2016 14:27:21 +0000 (10:27 -0400)]
Merge: libevent: force closing connections on error to fix file descriptors leak

The libevent wrapper did not always free and close connections on errors. These are expected errors, like when a file download is cancelled half-way through or when a push connection expires. This recently caused xymus.net to crash due to the exhaustion of file descriptors available to the process.

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

7 years agoopportunity: print errors to stderr
Alexis Laferrière [Sat, 18 Jun 2016 13:45:24 +0000 (09:45 -0400)]
opportunity: print errors to stderr

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

7 years agoopportunity: inline Meetup::to_s for prettier prints
Alexis Laferrière [Sat, 18 Jun 2016 13:45:08 +0000 (09:45 -0400)]
opportunity: inline Meetup::to_s for prettier prints

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

7 years agoopportunity: remove prints in normal behavior
Alexis Laferrière [Sat, 18 Jun 2016 13:44:35 +0000 (09:44 -0400)]
opportunity: remove prints in normal behavior

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

7 years agoopportunity: update error message on failure to create event
Alexis Laferrière [Fri, 17 Jun 2016 23:13:31 +0000 (19:13 -0400)]
opportunity: update error message on failure to create event

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

7 years agolibevent: force_close the connection on error (don't wait on buffers)
Alexis Laferrière [Fri, 17 Jun 2016 22:24:22 +0000 (18:24 -0400)]
libevent: force_close the connection on error (don't wait on buffers)

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

7 years agolibevent: move close logic from C to Nit, and intro force_close
Alexis Laferrière [Fri, 17 Jun 2016 22:23:41 +0000 (18:23 -0400)]
libevent: move close logic from C to Nit, and intro force_close

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

7 years agosrc: add examples/test_loader.nit
Jean Privat [Fri, 17 Jun 2016 19:42:08 +0000 (15:42 -0400)]
src: add examples/test_loader.nit

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

7 years agoidentify_module: give hint for qualified modules
Jean Privat [Fri, 17 Jun 2016 19:40:15 +0000 (15:40 -0400)]
identify_module: give hint for qualified modules

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

7 years agoloader: accept qualified notation `foo::bar` and handle error
Jean Privat [Fri, 17 Jun 2016 19:39:29 +0000 (15:39 -0400)]
loader: accept qualified notation `foo::bar` and handle error

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

7 years agoloader: simplify special cases of identify_module
Jean Privat [Fri, 17 Jun 2016 19:37:59 +0000 (15:37 -0400)]
loader: simplify special cases of identify_module

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

7 years agoloader: add `last_loader_error` to handle the potential error messages.
Jean Privat [Fri, 17 Jun 2016 19:36:45 +0000 (15:36 -0400)]
loader: add `last_loader_error` to handle the potential error messages.

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

7 years agoloader: `identify_group` ignore local files that are not directories.
Jean Privat [Fri, 17 Jun 2016 17:20:27 +0000 (13:20 -0400)]
loader: `identify_group` ignore local files that are not directories.

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

7 years agoMerge: Highlight: client can provide an linking policy
Jean Privat [Wed, 15 Jun 2016 23:09:32 +0000 (19:09 -0400)]
Merge: Highlight: client can provide an linking policy

Links to entities can be defined by specializing `HighlightVisitor::hrefto`

Nitlight uses it to correctly provide better links (and avoid generating dead links)

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

7 years agotests: update .res of nitlight and test_highlight
Jean Privat [Mon, 13 Jun 2016 20:48:30 +0000 (16:48 -0400)]
tests: update .res of nitlight and test_highlight

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

7 years agohighlight: remove default links. Clients have to provide them
Jean Privat [Mon, 13 Jun 2016 20:46:52 +0000 (16:46 -0400)]
highlight: remove default links. Clients have to provide them

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

7 years agotest_highlight: use only local links
Jean Privat [Mon, 13 Jun 2016 20:45:39 +0000 (16:45 -0400)]
test_highlight: use only local links

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

7 years agonitlight: use contextual links
Jean Privat [Mon, 13 Jun 2016 20:44:37 +0000 (16:44 -0400)]
nitlight: use contextual links

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

7 years agohighlight: add HighlightVisitor::hrefto to allow clients to tweak generated links
Jean Privat [Mon, 13 Jun 2016 20:40:01 +0000 (16:40 -0400)]
highlight: add HighlightVisitor::hrefto to allow clients to tweak generated links

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

7 years agolib/core: Made to_cstring a fun instead of a lazy var
Lucas Bajolet [Mon, 13 Jun 2016 15:19:30 +0000 (11:19 -0400)]
lib/core: Made to_cstring a fun instead of a lazy var

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

7 years agoMerge: nitunit: improve generated XML
Jean Privat [Mon, 13 Jun 2016 16:04:27 +0000 (12:04 -0400)]
Merge: nitunit: improve generated XML

The XML format used by Jenkins is under-specified. So after loosely googling and a lot of trials and errors here is some improvement of the XML that enhance the user experience on Jenkins.

To experiment, I used a false job to see the results of nitunit for the test cases in tests (where a lot are expected to fails)

* the (ANSI-colored) log: http://gresil.org/jenkins/job/ZZnothing/195/console
* the results: http://gresil.org/jenkins/job/ZZnothing/195/testReport/

The main improvements are:

* messages are open by default (when you click on the + of a failed tests)
* add a time (not impressive but might be useful on real tests)
* all test cases are counted
* more readable names. Compare with http://gresil.org/jenkins/job/ZZnothing/189/testReport/ for instance

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

7 years agoMerge: makefiles: simplify them and assume that Nit tools are in the PATH
Jean Privat [Mon, 13 Jun 2016 16:04:25 +0000 (12:04 -0400)]
Merge: makefiles: simplify them and assume that Nit tools are in the PATH

close #2105

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

7 years agoMerge: hightlight: improve infrastructure
Jean Privat [Mon, 13 Jun 2016 16:04:24 +0000 (12:04 -0400)]
Merge: hightlight: improve infrastructure

infoboxes that popup where broken some time ago. This PR fix them and add two toggle for clients.

* `show_messages` to underline tokens and show error messages (or not)
* `show_infobox` to attach (or not) popupable infoboxes (those that where broken).

demo is available http://info.uqam.ca/~privat/tmp/nitlight/

Note: the UI is still terrible, but I have no better idea than these ugly popups to present complex contextual information.

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

7 years agoMerge: hightlight as a service
Jean Privat [Mon, 13 Jun 2016 16:04:21 +0000 (12:04 -0400)]
Merge: hightlight as a service

Some small adaptation to make the various tools less command-line dependent.

As a proof a concept, there is a simple nitlight&nitpick online tools.
Maybe a future nit online validador (nitltn?)

http://pratchett.info.uqam.ca:8081/

It seems that the machine is no more accessible from outside :/

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

7 years agotests: update nitunit results
Jean Privat [Sat, 11 Jun 2016 03:25:27 +0000 (23:25 -0400)]
tests: update nitunit results

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

7 years agonitunit: add --no-time to avoid time and improve reproductible results
Jean Privat [Sat, 11 Jun 2016 20:04:01 +0000 (16:04 -0400)]
nitunit: add --no-time to avoid time and improve reproductible results

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

7 years agonitunit: move compilation errors to `<testcase>` as they are ignored in `<testsuite>`
Jean Privat [Sat, 11 Jun 2016 03:23:46 +0000 (23:23 -0400)]
nitunit: move compilation errors to `<testcase>` as they are ignored in `<testsuite>`

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

7 years agonitunit: use shorter names in the XML
Jean Privat [Sat, 11 Jun 2016 03:21:06 +0000 (23:21 -0400)]
nitunit: use shorter names in the XML

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

7 years agonitunit: use `message` attribute in XML to store the error message.
Jean Privat [Sat, 11 Jun 2016 03:20:00 +0000 (23:20 -0400)]
nitunit: use `message` attribute in XML to store the error message.

Doing so make it visible by defaukt.
The content is displayed as `stack trace`

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

7 years agonitunit: add time information
Jean Privat [Sat, 11 Jun 2016 01:45:27 +0000 (21:45 -0400)]
nitunit: add time information

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

7 years agomakefiles: simplify them and assume that Nit tools are in the PATH
Jean Privat [Sat, 11 Jun 2016 00:09:08 +0000 (20:09 -0400)]
makefiles: simplify them and assume that Nit tools are in the PATH

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

7 years agotests: update light .res
Jean Privat [Fri, 10 Jun 2016 18:17:09 +0000 (14:17 -0400)]
tests: update light .res

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

7 years agohighlight: highlight ids in a qualified id
Jean Privat [Fri, 10 Jun 2016 18:10:48 +0000 (14:10 -0400)]
highlight: highlight ids in a qualified id

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

7 years agohighlight: add two configuration, show_messages and show_infobox
Jean Privat [Fri, 10 Jun 2016 18:10:15 +0000 (14:10 -0400)]
highlight: add two configuration, show_messages and show_infobox

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

7 years agohighlight: always decorate children token
Jean Privat [Fri, 10 Jun 2016 18:08:45 +0000 (14:08 -0400)]
highlight: always decorate children token

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

7 years agopnacl: update because `compute_nit_dir` was renamed
Jean Privat [Fri, 10 Jun 2016 16:07:05 +0000 (12:07 -0400)]
pnacl: update because `compute_nit_dir` was renamed

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

7 years agosrc: add examples/nitlight_as_a_service.nit
Jean Privat [Fri, 10 Jun 2016 16:06:32 +0000 (12:06 -0400)]
src: add examples/nitlight_as_a_service.nit

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

7 years agotoolcontext: disable error messages if `opt_warn.value` is negative
Jean Privat [Fri, 10 Jun 2016 14:00:59 +0000 (10:00 -0400)]
toolcontext: disable error messages if `opt_warn.value` is negative

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

7 years agotoolcontext: make `nit_dir` more robust and client-definable
Jean Privat [Fri, 10 Jun 2016 14:00:15 +0000 (10:00 -0400)]
toolcontext: make `nit_dir` more robust and client-definable

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

7 years agohighlight: can hightlight a full source file (not a specific node)
Jean Privat [Fri, 10 Jun 2016 13:46:21 +0000 (09:46 -0400)]
highlight: can hightlight a full source file (not a specific node)

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

7 years agoMerge: lib/core: Renamed `Text::bytelen` to `Text::byte_length`
Jean Privat [Fri, 10 Jun 2016 01:58:40 +0000 (21:58 -0400)]
Merge: lib/core: Renamed `Text::bytelen` to `Text::byte_length`

As one famous man once said: "Je vous ai compris!".

So, I understood that some of us (@xymus, @ppepos, @BlackMinou, etc.) did not like the `bytelen` name, since it was not that explicit.
Well, its days are numbered and it is replaced by the longer but more explicit `byte_length`.

Pull-Request: #2173
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

7 years agoMerge: Added contributing guidelines and link from readme
Jean Privat [Fri, 10 Jun 2016 01:55:27 +0000 (21:55 -0400)]
Merge: Added contributing guidelines and link from readme

As discussed in #2133, contribution guidelines are hard to find.

This PR is an attempt to ease the process by giving newcomer friendly advices and some more insight on the contribution process for Nit.

@tonygaetani, do you think a document like this one would have been helpful for you ? Is there anything you would change to make it friendlier/clearer ?

Close #2133

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

7 years agoMerge: Base64: Revamped base64_decode and added a strict mode
Jean Privat [Fri, 10 Jun 2016 01:55:20 +0000 (21:55 -0400)]
Merge: Base64: Revamped base64_decode and added a strict mode

As talked with @ppepos, base64_decode now supports either `strict` or `non-strict`
modes when decoding a base64 string.

The `strict` mode is inspired from the `-i` option from the Unix `base64` command, which ignores non-compliant characters and non-padded `base64` strings.

This is more or less what we do now, `strict` being the default.

Since only one allocation and copy is done now, performance should be better.
There is however one pitfall of this implementation due to the `nullable Object` contract from `Collection[K]`, causing multiple boxings, some further optimization could be done on that front.

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

7 years agotests: Updated old tests sav
Lucas Bajolet [Wed, 8 Jun 2016 19:52:02 +0000 (15:52 -0400)]
tests: Updated old tests sav

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

7 years agotests: Improved base64 test for edge strict cases
Lucas Bajolet [Wed, 8 Jun 2016 15:07:43 +0000 (11:07 -0400)]
tests: Improved base64 test for edge strict cases

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

7 years agolib/base64: Revamped `decode_base64` for better performances and introduction of...
Lucas Bajolet [Mon, 16 May 2016 15:36:51 +0000 (11:36 -0400)]
lib/base64: Revamped `decode_base64` for better performances and introduction of a strict mode

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

7 years agolib/core: Renamed `Text::bytelen` to `Text::byte_length`
Lucas Bajolet [Wed, 8 Jun 2016 18:48:42 +0000 (14:48 -0400)]
lib/core: Renamed `Text::bytelen` to `Text::byte_length`

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

7 years agolib/core: Added `is_whitespace` method to `Byte`
Lucas Bajolet [Wed, 8 Jun 2016 15:06:40 +0000 (11:06 -0400)]
lib/core: Added `is_whitespace` method to `Byte`

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

7 years agonit: Added link to `CONTRIBUTING.md` from the README
Lucas Bajolet [Fri, 27 May 2016 18:06:33 +0000 (14:06 -0400)]
nit: Added link to `CONTRIBUTING.md` from the README

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

7 years agonit: Added `CONTRIBUTING.md` file to repository
Lucas Bajolet [Fri, 27 May 2016 18:05:58 +0000 (14:05 -0400)]
nit: Added `CONTRIBUTING.md` file to repository

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

7 years agoMerge: nitweb: add misc features
Jean Privat [Wed, 8 Jun 2016 13:00:50 +0000 (09:00 -0400)]
Merge: nitweb: add misc features

A little of everything in this PR:

* show all properties of a class: http://nitweb.moz-code.org/class/core::Array (see all props tab)
* show code into linearization card: http://nitweb.moz-code.org/class/core::Array (see linearization tab)
* show class definitions for modules: http://nitweb.moz-code.org/module/core::array

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

7 years agonitweb/angular: show mclass all properties
Alexandre Terrasa [Wed, 1 Jun 2016 03:08:17 +0000 (23:08 -0400)]
nitweb/angular: show mclass all properties

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

7 years agonitweb/angular: show module definitions
Alexandre Terrasa [Tue, 7 Jun 2016 17:09:25 +0000 (13:09 -0400)]
nitweb/angular: show module definitions

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

7 years agonitweb/angular: load mentity definitions for classes and properties
Alexandre Terrasa [Tue, 7 Jun 2016 17:07:58 +0000 (13:07 -0400)]
nitweb/angular: load mentity definitions for classes and properties

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

7 years agonitweb: add /api/defs/:entity to list definitions
Alexandre Terrasa [Tue, 7 Jun 2016 17:06:10 +0000 (13:06 -0400)]
nitweb: add /api/defs/:entity to list definitions

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

7 years agonitweb/angular: show code in definition cards
Alexandre Terrasa [Tue, 7 Jun 2016 17:54:53 +0000 (13:54 -0400)]
nitweb/angular: show code in definition cards

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

7 years agoMerge: nitweb: add `code` tab for modules, classdefs and propdefs.
Jean Privat [Tue, 7 Jun 2016 19:11:11 +0000 (15:11 -0400)]
Merge: nitweb: add `code` tab for modules, classdefs and propdefs.

Interesting demos:
* http://nitweb.moz-code.org/module/array_debug::array_debug
* http://nitweb.moz-code.org/classdef/core$Array
* http://nitweb.moz-code.org/propdef/core::abstract_text$Object$to_s

Only the two last commits are relevant since the rest belongs to #2170

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

7 years agoMerge: nitweb: list linearized definitions
Jean Privat [Tue, 7 Jun 2016 19:11:09 +0000 (15:11 -0400)]
Merge: nitweb: list linearized definitions

Display linearization lists:

* Mclass linearize all the class definitions
   * linearization of `core::Array` mclassdefs: http://nitweb.moz-code.org/class/core::Array

* MProperty linearize all the prop definitions
    * linearization of `core::Object::hash`: http://nitweb.moz-code.org/property/core::Object::hash

* MClassDef linearize to intro
    * linearization of `core::flat$Array`: http://nitweb.moz-code.org/classdef/core::flat$Array

* MPropdef linearize to intro
    * linearization of `core$Array$Object::SELF`: http://nitweb.moz-code.org/propdef/core$Array$Object::SELF

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

7 years agoMerge: catalog: only render the asked packages (not the imported ones)
Jean Privat [Tue, 7 Jun 2016 19:10:59 +0000 (15:10 -0400)]
Merge: catalog: only render the asked packages (not the imported ones)

Imported packages where always shown. Not a good behavior on most command-line cases.

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

7 years agoMerge: nitunit: testsuites are explicit
Jean Privat [Tue, 7 Jun 2016 19:10:53 +0000 (15:10 -0400)]
Merge: nitunit: testsuites are explicit

nitunit do no more try to be clever and find test-suites.

Previously, `nitunit foo.nit` caused the execution of the test suite `test_foo.nit` if it exist.
This behavior had some drawbacks:

* the test suite must follow a strict naming convention `test_*`
* the test suite must be in the same directory
* there must a an associated module. no way to create a test-suite out of thin air
* nitunit do nothing if you give the test suite instead of the module
* `-t` used to precise the location of the test suite did not work with more than one module

The proposed solution is to remove all this test-suite association with a module and asks the used to use the test-suite instead.

    nitunit test_foo.nit

Because nitunit in intended to work with more than one module, there is basically no change for client that do

    nitunit .

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