Jean Privat [Fri, 10 Feb 2017 16:00:14 +0000 (11:00 -0500)]
Merge: Use `UInt32` to manipulate Unicode chars and support 32 bits platforms
Unicode support was broken on 32 bits platforms and anywhere a C `long` was on 32 bits (such as 64 bits Windows). This caused issues when compiling Nit tools.
This PR modifies the critical code in order to use `UInt32` instead of `Int` to fit all the 32 bits of Unicode chars. To do so, the first commit inverts the dependency order of the modules `fixed_int` and `text` so that `text` becomes a client of `fixed_int`. Also, update how constants are declared and fix a few implicit cast warnings.
Fix Debian 32 bits support #2355 after a c_src regen.
Fix #1945 Unicode support on iOS.
Allows to bootstrap under Windows with other minor changes (for another PR).
Reported-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Pull-Request: #2363
Jean Privat [Fri, 10 Feb 2017 16:00:07 +0000 (11:00 -0500)]
Merge: improve AST dump
The debug method `ANode.dump_tree` is now more versatile and powerful:
* it can hide tokens (and others non useful nodes)
* it can display code line along with the AST
* it can display model information (through refinement in modelize and semantize modules)
* it uses some color so the output is more readable
Eg: for the code
~~~nit
var a: nullable Object = "Hello".substring(1,3)
print "{a or else "?"}"
~~~
the AST dumped is
~~~
1 var a: nullable Object = "Hello".substring(1,3)
AMainMethPropdef @test_expr.nit:1,1--2,23
`--ABlockExpr @test_expr.nit:1,1--2,23
|--AVardeclExpr :nullable Object @test_expr.nit:1,1--47
| |--AType :nullable Object @test_expr.nit:1,8--22
| `--ACallExpr :String call=String.abstract_text$Text$substring(from: Int, count: Int): String @test_expr.nit:1,26--47
| |--AStringExpr :String @test_expr.nit:1,26--32
| `--AParExprs @test_expr.nit:1,43--47
| |--AIntegerExpr :Int @test_expr.nit:1,44
| `--AIntegerExpr :Int @test_expr.nit:1,46
2 print "{a or else "?"}"
`--ACallExpr call=Sys.file$Sys$print(object: Object) @test_expr.nit:2,1--23
|--AImplicitSelfExpr :Sys @test_expr.nit:2,1
`--AListExprs @test_expr.nit:2,7--23
`--ASuperstringExpr :String @test_expr.nit:2,7--23
|--AStartStringExpr :String @test_expr.nit:2,7--8
|--AOrElseExpr :Object @test_expr.nit:2,9--21
| |--AVarExpr :nullable Object @test_expr.nit:2,9
| `--AStringExpr :String @test_expr.nit:2,19--21
`--AEndStringExpr :String @test_expr.nit:2,22--23
~~~
Pull-Request: #2364
Jean Privat [Fri, 10 Feb 2017 16:00:00 +0000 (11:00 -0500)]
Merge: mongo::queries: add unwind method
Also fix `op` method so it matches the specification in the comment
Pull-Request: #2362
Jean Privat [Fri, 10 Feb 2017 13:40:10 +0000 (08:40 -0500)]
tests: update nitserial & nitresful sav files with 'generated'
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Feb 2017 13:39:25 +0000 (08:39 -0500)]
nitc: use is_generated in various tools and generated files
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Feb 2017 13:28:05 +0000 (08:28 -0500)]
nitc: add new module annotation `is generated`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Feb 2017 01:30:26 +0000 (20:30 -0500)]
tests: update sav for test_parser
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Feb 2017 00:49:01 +0000 (19:49 -0500)]
Merge: nitrestful: async services and deserialize plain JSON arguments
This PR brings new features to the generated RESTful services: asynchronous RESTful methods, deserialization of plain JSON objects and more.
Using the annotation and argument `is restful(async)` triggers a method to be executed asynchronously when invoked by an HTTP request. Each RESTful call to this method will be executed by the `thread_pool` attribute of the receiving `RestfulAction`. As such, careful attention should be paid to its code to make sure that it works in parallel to the rest of the services and to other instances/threads of itself. The `thread_pool` can be customized with the desired number of threads and it can also be shared with other services.
Arguments of the RESTful methods are deserialized from JSON format. This PR applies the latest features of the deserialization services and uses the static parameter types as a heuristic to guess the Nit type the incoming data. This is also safer as only subclasses of the static type will be deserialized.
The code generated by nitrestful now considers all RESTful methods in order of declaration. This means that many methods can answer to the same `foo` name, but only the first implementation accepting the HTTP method and the type of the arguments will be executed.
As support, this PR also adds threads support to libevent, handles signal interruptions in `Float::sleep`, makes the `ThreadPool` a bit more permissive, improves support of plain JSON map object and adds a test for the nitrestful example.
Pull-Request: #2360
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 18:15:37 +0000 (13:15 -0500)]
nitc: test_parser use dump_tree instead of an adhoc treeprinter
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Thu, 9 Feb 2017 18:20:04 +0000 (13:20 -0500)]
ios: remove temporary Unicode fix
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Feb 2017 08:32:19 +0000 (03:32 -0500)]
nitc: explicitly cast long to int
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Feb 2017 07:14:32 +0000 (02:14 -0500)]
nitc: fix large int constants
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 8 Feb 2017 06:51:21 +0000 (01:51 -0500)]
text: use UInt32 to manipulate chars
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 9 Feb 2017 18:14:39 +0000 (13:14 -0500)]
nitc: dump_tree can display the lines of the source-code
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 18:13:16 +0000 (13:13 -0500)]
lib/ordered_tree: factorize `write_line` so subclasses can redefine it.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:08:14 +0000 (12:08 -0500)]
nitc: typing and modelbuilder extends dump_info
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:07:17 +0000 (12:07 -0500)]
nitc: ASTDump exposes color helpers
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:06:46 +0000 (12:06 -0500)]
nitc: ASTDump can display aditionnal information
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:05:52 +0000 (12:05 -0500)]
nitc: ANode::dump_tree can skip structural nodes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:05:13 +0000 (12:05 -0500)]
nitc: add ANode::is_structural
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Feb 2017 17:04:28 +0000 (12:04 -0500)]
nitc: add Location::get_line
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Wed, 8 Feb 2017 06:27:09 +0000 (01:27 -0500)]
core: invert dependencies between `text` and `fixed_ints`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Wed, 8 Feb 2017 04:53:25 +0000 (23:53 -0500)]
mongo: add query unwind stage
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Wed, 8 Feb 2017 04:50:52 +0000 (23:50 -0500)]
mongo: fix query op name to follow the comment/spec
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 6 Feb 2017 13:39:51 +0000 (08:39 -0500)]
Merge: nitunit: fix before and after methods
Before and after method were not actually called in the test suite process.
This PR enables the compilation and run of these methods.
The new behavior is: if the `before_module` test case fails, all the test cases and the `after_module` are skipped and marked as failed.
Pull-Request: #2359
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Feb 2017 13:39:19 +0000 (08:39 -0500)]
Merge: macOS: update realtime lib for Sierra
The latest version of macOS, Sierra, defines the functions `clock_gettime` and `clock_getres` which were previously missing. This PR adds support for Sierra while preserving compatibility with El Capitan using a simple heuristic to either use the system provided functions or define them locally.
Reported-by: Marie-Pier Lessard @mplessard
Pull-Request: #2358
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>
Jean Privat [Mon, 6 Feb 2017 13:39:02 +0000 (08:39 -0500)]
Merge: nitc: inject importation
Extends the nitc code so a phase can inject new submodules.
The main new method the this PR is `ModelBuilder::inject_module_subimportation` that must be used during the analysis on a module.
Up to now, the module hierarchy was fixed and built by the loader before any phases are run.
The basic way was: 1. load the main module, 2. load its imported modules recursively and build the hierarchy, 3. run the phases on all the loaded modules from the most general to the most specific (top-down)
Now the phases can also extends the module hierarchy while running some phases.
This cause the following changes:
* `run_phase` use a work-list (instead of a simple loop)
* new modules can pop up even for the main module of a program, so a fictive main module is always created
* conditional_importations is extended to be used to by inject_module_subimportation.
Pull-Request: #2357
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Alexis Laferrière [Thu, 2 Feb 2017 21:32:31 +0000 (16:32 -0500)]
nitcorn: add test for nitrestful
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 18:42:33 +0000 (14:42 -0400)]
nitcorn: update restful example with an async method and complex data type
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 16 Oct 2016 14:06:58 +0000 (10:06 -0400)]
nitcorn: intro module to simplify pthreads support
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 15 Oct 2016 00:58:55 +0000 (20:58 -0400)]
nitrestful & lib: use static type to limit and as heuristic at deserialization
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 15 Oct 2016 00:58:29 +0000 (20:58 -0400)]
nitrestful: use mclassdef instead of mclass
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 18:41:46 +0000 (14:41 -0400)]
nitrestful: generate code for async restful methods
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 13:29:38 +0000 (09:29 -0400)]
nitrestful: detect the async keyword
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 13:29:10 +0000 (09:29 -0400)]
nitcorn: intro RestfulTask
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 17:50:40 +0000 (13:50 -0400)]
nitrestful: intercept at `prepare_respond_and_close` instead
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 14 Oct 2016 17:49:25 +0000 (13:49 -0400)]
nitrestful: fallback on other restful services if one fails type check
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 16 Oct 2016 14:06:29 +0000 (10:06 -0400)]
libevent: intro services for threads and fork
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 3 Feb 2017 19:37:22 +0000 (14:37 -0500)]
pthreads: intro `ThreadPool::join_all`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 3 Feb 2017 19:37:01 +0000 (14:37 -0500)]
pthreads: allow to set `ThreadPool::nb_thread` before first execute
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 3 Feb 2017 19:35:56 +0000 (14:35 -0500)]
pthreads: `ThreadPool` accept any `Task`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Fri, 3 Feb 2017 06:56:06 +0000 (01:56 -0500)]
tests: add tests for nitunit before and after module
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 3 Feb 2017 06:55:34 +0000 (01:55 -0500)]
lib/test_suite: update Sys class to nitunit fix
We need the private method so we can compile the test case with intrude.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 3 Feb 2017 06:54:28 +0000 (01:54 -0500)]
testing: compile before and after methods
Tests case will fail if the before method failed.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 3 Feb 2017 06:52:33 +0000 (01:52 -0500)]
testing: fix `before_module` and `after_module` method recognition
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 3 Feb 2017 06:51:55 +0000 (01:51 -0500)]
testing: extract `fail` method to make a test case fail without running it
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Thu, 2 Feb 2017 19:48:21 +0000 (14:48 -0500)]
core: Float::sleep to handle interruptions
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 15 Oct 2016 02:38:55 +0000 (22:38 -0400)]
json: support reading plain JSON map when the static type is known
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 1 Feb 2017 15:29:55 +0000 (10:29 -0500)]
tests: update metrics because the new fictive bottom module
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 1 Feb 2017 13:42:05 +0000 (08:42 -0500)]
modelbuilder: drop the fictive bottom module if unneeded
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jan 2017 19:35:11 +0000 (14:35 -0500)]
modelbuilder: add `inject_module_subimportation` to inject importation.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jan 2017 19:30:08 +0000 (14:30 -0500)]
phase: use a extensible work-list for `run_phases`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jan 2017 19:25:48 +0000 (14:25 -0500)]
loader: only apply conditional importation on strict submodules
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jan 2017 19:24:58 +0000 (14:24 -0500)]
modelbuilder: always create a main fictive module
This simplify the logic and the number of assumptions.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jan 2017 18:54:26 +0000 (13:54 -0500)]
nitc: first_real_mmodule is now explicitly set.
This solve the issue where `nitc foo.nit -m subfoo.nit` program
is named `subfoo` instead of `foo`.
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Thu, 2 Feb 2017 16:23:53 +0000 (11:23 -0500)]
realtime: don't use custom functions on Sierra
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 18 Jan 2017 20:23:56 +0000 (15:23 -0500)]
Merge: nitweb: close quicksearch box when clicking outside of it
* Add some crappyjs(TM) to autoclose the search box when the user click somewhere else.
* Also autoclose the box when the user click on a link from the list (unwanted js sideeffects are sometimes wanted)
Checks one more box from #2178
Demo: http://nitweb.moz-code.org
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2354
Jean Privat [Wed, 18 Jan 2017 20:23:54 +0000 (15:23 -0500)]
Merge: nitweb: auto link entitites found in `span code`
This PR introduces a stub feature for nitweb: autolinking entities from `span` code.
Each time nitweb renders a Markdown comment it evaluates the content of each inline `code` tag and tries to match it with the model index. If the content of the `code` tag matches a package, module, class or property, the `code` content is wrapped in a link to that entity.
Examples:
* `Object`: will be rendered as `<a href='/doc/core::Object'>Object</a>`
* `nullable Object`: will be rendered as `<a href='/doc/core::Object'>nullable Object</a>`
* `is_same_instance`: will be rendered as `<a href='/doc/core::Object::is_same_instance'>is_same_instance</a>`.
The name matching algorithm is the same as the one used to resolve short links like `[Object]` or complex directives like `[graph: core]`.
Demo: http://nitweb.moz-code.org
The documentation from the `core` package benefits from the new feature: http://nitweb.moz-code.org/doc/core
Pull-Request: #2353
Jean Privat [Wed, 18 Jan 2017 13:42:19 +0000 (08:42 -0500)]
Merge: Revamp the C string to Nit string services to put forward the safest alternative
There are now three services to convert a `CString` to a `String`:
* `CString::to_s` and `to_s_with_length(byte_length)` copies data into the GC memory and clean the UTF-8 characters. The difference is that `to_s` search for the first null byte to find the length of the string. These services are the safest and recommended for use with the FFI. They replace the old `to_s_with_copy` and `to_s_with_copy_and_length`.
* `CString::to_s_unsafe(byte_length, char_length, copy, clean)` is the unsafe alternative. It can optimize conversion of a string that has already been cleaned, is already in the GC memory or of which the number of characters has already been counted. This service unifies (and replace) the old `to_s`, `to_s_with_length`, `to_s_full` and `to_s_unsafe`.
Also fix `from_percent_encoding` that did not clean its output, same for the binary deserialization of single characters, and `environ` which now copies the C string into GC memory.
Update a test result as there is now one more string (the copy by `environ`) and a call to `String::length` to cut on the calls to `CString::utf8_length`.
This PR applies #2057 and it is based on #2347. That a look at the commit "core: revamp `CString::to_s` services" first.
Edit: The full doc and signature of `to_s_unsafe` for ease of reading:
# Get a `String` from the data at `self` (with unsafe options)
#
# The default behavior is the safest and equivalent to `to_s`.
#
# Options:
#
# * Set `byte_length` to the number of bytes to use as data.
# Otherwise, this method searches for a terminating null byte.
#
# * Set `char_length` to the number of Unicode character in the string.
# Otherwise, the data is read to count the characters.
# Ignored if `clean == true`.
#
# * If `copy == true`, the default, copies the data at `self` in the
# Nit GC allocated memory. Otherwise, the return may still point to
# the data at `self`.
#
# * If `clean == true`, the default, the string is cleaned of invalid UTF-8
# characters. If cleaning is necessary, the data is copied into Nit GC
# managed memory, whether or not `copy == true`.
# Don't clean only when the data has already been verified as valid UTF-8,
# other library services rely on UTF-8 compliant characters.
fun to_s_unsafe(byte_length, char_length: nullable Int, copy, clean: nullable Bool): String
Pull-Request: #2350
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Alexandre Terrasa [Sun, 11 Dec 2016 10:27:42 +0000 (05:27 -0500)]
nitweb: link entities from Markdown code span
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Sun, 11 Dec 2016 09:28:28 +0000 (04:28 -0500)]
nitweb: factorize md utilies to MDEmiter instead of DocCommand
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Tue, 17 Jan 2017 20:53:46 +0000 (15:53 -0500)]
nitweb: close quick search box when clicking outside
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 17 Jan 2017 20:44:00 +0000 (15:44 -0500)]
Merge: Benitlux: Improve the iOS variation and general bug fixes
General improvements to Benitlux:
* Don't suggest to follow current friends.
* Don't allow to post a review when not logged in.
* Forget current login on an invalid token and don't recheck them.
* Extract the manual button for checking in and out to its own module.
* Use more precise classes to offer more variation points for platform adaptations.
Improvements to the look on iOS:
* Rely on the new default behavior of the iOS implementation of *app.nit* to ellipsize long texts.
* Less auto correct and auto capitalizing.
* Use placeholder text to identify text fields.
* Prettier views and windows in general, more alignment, text color, sizes, etc.
* Fix icon when the font is missing.
See the result for yourself!
![Benitlux on iOS](http://xymus.net/pub/ben-ios.png)
Pull-Request: #2352
Alexis Laferrière [Mon, 2 Jan 2017 19:28:08 +0000 (14:28 -0500)]
benitlux: move manual checkin feature to its own module
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 26 Sep 2016 17:29:44 +0000 (13:29 -0400)]
benitlux: prettier iOS adaptation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 26 Sep 2016 22:42:06 +0000 (18:42 -0400)]
benitlux: revamp the signup window with more variation points
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:11:07 +0000 (19:11 -0400)]
benitlux: classify views in simple classes as variation points
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:14:24 +0000 (19:14 -0400)]
benitlux server: don't suggest current friends
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:13:53 +0000 (19:13 -0400)]
benitlux: make BeerView labels public attributes so they are variation points
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:12:33 +0000 (19:12 -0400)]
benitlux: refresh home window on receiving an invalid token error
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:10:18 +0000 (19:10 -0400)]
benitlux: don't endlessly recheck token if its invalid
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 25 Sep 2016 23:09:07 +0000 (19:09 -0400)]
benitlux: fix size and alignment of Star & Follow Button
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 24 Sep 2016 12:23:24 +0000 (08:23 -0400)]
benitlux: flatten icon text to path
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 23 Sep 2016 14:59:46 +0000 (10:59 -0400)]
benitlux: expect that native objects will be freed between log ins and outs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 23 Sep 2016 02:59:06 +0000 (22:59 -0400)]
benitlux: disable autocorrect and autocapital.. on user name input text field
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 23 Sep 2016 02:58:36 +0000 (22:58 -0400)]
benitlux: disable star buttons when not logged in
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 23 Sep 2016 02:27:14 +0000 (22:27 -0400)]
benitlux: drop the custom ellipsizing
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 30 Dec 2016 20:27:40 +0000 (15:27 -0500)]
Merge: calculator: bug fix and small tweaks to the iOS adaptation
Fix a bug where numbers would be limited to a single digit after some operations.
Improve the look of the calculator under iOS.
Pull-Request: #2351
Jean Privat [Fri, 30 Dec 2016 20:27:32 +0000 (15:27 -0500)]
Merge: lib/graph: Fix `to_dot`
The `Graph::to_dot` function seldom produced bad dot when used on objects with special formatting in their `to_s` method.
This PR changes that by overriding the ID of a node by an Int.
There is still the concern that the new implementation might explode when used on a very large graph, there might be a better way to generate it or to escape the node's ids, but I can't find another one at the moment.
Poke @ablondin, this might interest you
Pull-Request: #2349
Reviewed-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Jean Privat [Fri, 30 Dec 2016 20:27:19 +0000 (15:27 -0500)]
Merge: Rename the extern class `NativeString` to `CString`
`NativeString` used to be mainly implemented by the engines, but in the last few years it became gradually a normal extern class. As such, its instances are now C strings (`char *`). Most of its methods are extern and implemented in the library instead of the engines. It is also widely used by extern methods implemented in C as `char *`, the type appears 300+ times in the general lib and 67 times in `lib/core/text`.
This PR renames `NativeString` to `CString`. This change makes it clear to beginner programmers that its instances are pointers to C strings and how they are passed to C code. Plus, it fits better next to `CppString`, `JavaString` and `NSString`.
The only remaining engine not using it as a C string is the Java compiler, which implements it as a Java string. This still works and as long as it behaves like a C string there is no problem.
This PR also updates the related doc and attempts to update all indirect references to the new `CString`.
As discussed with @privat and @R4PaSs.
Pull-Request: #2347
Reviewed-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Fri, 9 Sep 2016 12:32:10 +0000 (08:32 -0400)]
calculator: improve iOS variation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 9 Sep 2016 14:40:42 +0000 (10:40 -0400)]
calculator: update language in variations doc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 9 Sep 2016 12:32:49 +0000 (08:32 -0400)]
calculator: rename the module `ios_calculator` to `ios`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 14 Sep 2016 19:59:04 +0000 (15:59 -0400)]
calculator: fix numbers limited to a single digit after a clean
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 27 Dec 2016 03:32:47 +0000 (22:32 -0500)]
tests: update `test_text_stat.res`
There's one more string instance because `environ` output is copied now.
Extra calls to `length` and the like replace calls to `utf8_length`.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 24 Dec 2016 16:03:55 +0000 (11:03 -0500)]
*: update all clients of the `CString::to_s` services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 27 Dec 2016 01:40:40 +0000 (20:40 -0500)]
core: keep `to_s_full` as an indirection for retro compatibility
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 24 Dec 2016 12:57:51 +0000 (07:57 -0500)]
core: revamp `CString::to_s` services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Lucas Bajolet [Mon, 19 Dec 2016 20:45:13 +0000 (15:45 -0500)]
lib/graph: Fix `to_dot` that could produce invalid dot when making arcs between invalid names.
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Tue, 13 Dec 2016 03:54:46 +0000 (22:54 -0500)]
c_src: update with CString
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 8 Dec 2016 20:25:41 +0000 (15:25 -0500)]
update all indirect references to native strings
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 13 Dec 2016 04:02:45 +0000 (23:02 -0500)]
tests: update to use `CString`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 8 Dec 2016 20:15:49 +0000 (15:15 -0500)]
core: update doc of `CString`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 8 Dec 2016 20:12:51 +0000 (15:12 -0500)]
rename `NativeString` to `CString`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 8 Dec 2016 21:58:38 +0000 (16:58 -0500)]
Merge: lib/counter: Added pack function
Added Counter::pack to separate values by occurence into a final 2D array of values
Pull-Request: #2346
Jean Privat [Thu, 8 Dec 2016 21:58:34 +0000 (16:58 -0500)]
Merge: lib/for_abuse: Fix typos in documentation
Simple fix of a few misuses of `trough` instead of `through`
Pull-Request: #2345
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Jean Privat [Thu, 8 Dec 2016 21:58:32 +0000 (16:58 -0500)]
Merge: nitweb: misc fixes
Some cleaning and fixes for nitweb:
* Clean api_auth and login module
* Clean html (extract directives, add menu icons, clean markup)
* Uniformize card headers
Pull-Request: #2344
Jean Privat [Thu, 8 Dec 2016 21:58:29 +0000 (16:58 -0500)]
Merge: tests: use NIT_TESTING_ID in neo4j tests
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2343
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Jean Privat [Thu, 8 Dec 2016 21:58:25 +0000 (16:58 -0500)]
Merge: nitweb: add READMEs summaries
Automatically add a summary extracted from the README / doc contents
![image](https://cloud.githubusercontent.com/assets/583144/
20892633/
fef2fd4a-badc-11e6-89f5-
5de007981914.png)
Also add anchors to the content of the README, so you can make links like:
http://nitweb.moz-code.org/doc/core#Methods-Implicitly-Defined-in-Sys
Pull-Request: #2342
Jean Privat [Thu, 8 Dec 2016 21:58:18 +0000 (16:58 -0500)]
Merge: lib/text: do not replace undecoded `%` by `?`
Change the specification of `from_percent_encoding` so undecoded `%` are not replaced by `?`.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2337