Jean Privat [Wed, 17 Dec 2014 18:46:50 +0000 (13:46 -0500)]
interpreter: implements array comprehensions
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 18:45:58 +0000 (13:45 -0500)]
typing: mark expressions that belong to an array comprehension
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 16:45:42 +0000 (11:45 -0500)]
typing: add `AArrayExpr::element_mtype`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 10:38:34 +0000 (05:38 -0500)]
parser: regenerate with comprehension arrays
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 10:28:34 +0000 (05:28 -0500)]
grammar: extends array_item to accept array extension elements
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 10:24:43 +0000 (05:24 -0500)]
grammar: new production `array_items` to replace arg_list for literal arrays
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 17 Dec 2014 04:55:37 +0000 (23:55 -0500)]
Merge: Highlight line ids
Add a way to control the generation of HTML ids in `hightlight` so it can be disabled in nitdoc.
Multiple id `L1` in a same HTML document makes it non conform.
Pull-Request: #1034
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:55:22 +0000 (23:55 -0500)]
Merge: Name entities
As suggested in #986 and #1030, promote `full_name` and `c_name` in MEntity in model so client of the model will have some homogenous ways to names entities.
Pull-Request: #1032
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:55:15 +0000 (23:55 -0500)]
Merge: Check constructor name conflicts
Closes #973
Pull-Request: #1040
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:54:53 +0000 (23:54 -0500)]
Merge: neo_doxygen: Clean the code a little bit
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #1038
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:54:37 +0000 (23:54 -0500)]
Merge: brainfuck: Remove warnings.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #1037
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:54:26 +0000 (23:54 -0500)]
Merge: opportunity: Fix some warnings
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #1036
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:54:21 +0000 (23:54 -0500)]
Merge: Each line
Improve IStream and Path for easiness of reading.
First, add new iterator `each_line` that lazily `read_line` of a stream.
Second, wrap some reading methods on `Path` so that the input of data from files is really easy.
~~~nit
var content = "/etc/issue".to_path.read_all
print content
~~~
and
~~~nit
for l in "/etc/passwd".to_path.each_line do
var fields = l.split(":")
print "name={fields[0]} uid={fields[2]}"
end
~~~
TODO: better error management
Pull-Request: #1033
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Wed, 17 Dec 2014 04:54:15 +0000 (23:54 -0500)]
Merge: Fast docunits
nitunit use the trick of #947 to optimize the execution of simple docunits.
There is now two execution modes: the *single* one and the *simple* one.
*simple* is for docunits that contains only some statements (without importation, classes or functions)
All *simple* docunits of a single module are regrouped into the same program with a switch that calls the correct docunit.
*single* is for docunits that contains importations, classes, functions, etc.
It the the old mode, that compiles and executes each docunit individually.
In case of compilation error with the *simple* mode, the *single* mode is used as a fallback.
Therefore the precise compilation error is assigned to the correct docunit and the other docunits can still be tested.
For numbers, I used `string` that contains 65 simple docunits:
* before: 1m16.564s
* after: 0m1.664s (so a gain of 97.80%)
Close #947
Pull-Request: #1029
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 17 Dec 2014 04:54:09 +0000 (23:54 -0500)]
Merge: contrib: download files from RSS
Based on #831, ignore the first 4 commits.
### From the README
This tool downloads files pointed by RSS feeds.
It fetches the content of the RSS feed, the it filters it according to custom patterns and to existing folders on disk. Selected elements will be downloaded to the given folder.
This tool must be compiled with its configuration in order to work. See the `sample_config.nit` in `src/`.
#### Features and TODO
- [x] Download & parse RSS file
- [x] Generate regular expressions from local folders
- [x] Auto download files matching regular expressions
- [x] Memory to prevent double downloads
- [ ] Blacklist
- [ ] Use a cleaner RSS parser
- [ ] Tolerate more feed formats
Pull-Request: #1014
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 16 Dec 2014 04:09:49 +0000 (23:09 -0500)]
model: promote `c_name` from abstract-compiler to model
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 04:08:18 +0000 (23:08 -0500)]
model: add `full_name` to entities that miss one
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 04:05:32 +0000 (23:05 -0500)]
model: promote `full_name` to MEntity
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 19:10:32 +0000 (14:10 -0500)]
lib/opts: do not crash for empty arguments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 16:05:42 +0000 (11:05 -0500)]
man: add --no-line-id to nitlight.md
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 16:04:48 +0000 (11:04 -0500)]
nitlight: add option --no-line-id
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 13:57:53 +0000 (08:57 -0500)]
nitodoc: stop generating id for lines in examples
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 13:57:05 +0000 (08:57 -0500)]
highlight: add HighlightVisitor::line_id_prefix to control ids of line spans
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 21:21:14 +0000 (16:21 -0500)]
tests: error_defs_init.nit for a combinasion of 7*7 cases
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 21:17:14 +0000 (16:17 -0500)]
modelize: check property name conflicts for constructors and factories
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 21:16:38 +0000 (16:16 -0500)]
modelize: check_redef_property_visibility for root_init
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 19:42:37 +0000 (14:42 -0500)]
lib/file: add examples for the new read methods in Path
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:57:11 +0000 (11:57 -0500)]
neo_doxygen: Make an instruction less verbose.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 16 Dec 2014 16:56:24 +0000 (11:56 -0500)]
neo_doxygen: Do not manually flush the output.
The standard library now takes care of this for us.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Tue, 16 Dec 2014 10:46:25 +0000 (05:46 -0500)]
lib/file: protect from double close
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 10:30:31 +0000 (05:30 -0500)]
tests: add test_file_read2.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 10:24:24 +0000 (05:24 -0500)]
lib/file: add read methods in Path
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 10:20:55 +0000 (05:20 -0500)]
lib/stream: add IStream::each_line
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Tue, 16 Dec 2014 15:20:04 +0000 (10:20 -0500)]
brainfuck: Remove warnings.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 16 Dec 2014 14:48:29 +0000 (09:48 -0500)]
opportunity: Add missing documentation.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 16 Dec 2014 14:59:01 +0000 (09:59 -0500)]
opportunity: Respect the basic HTML structure.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Mon, 15 Dec 2014 20:33:39 +0000 (15:33 -0500)]
nitunit: enable the execution of simple docunit in a single program
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 04:18:04 +0000 (23:18 -0500)]
Merge: neo_doxygen: Support namespaces’ members
In some languages, like Python, the immediate parent of a member is not necessary a class. So, for cases when namespace as direct members, add an implicit class named `(self)` to list them in a Nit model.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #985
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 16 Dec 2014 04:16:31 +0000 (23:16 -0500)]
Merge: Improve construction of runtime structures
The nitvm does not use anymore model_utils.
The construction of runtime structures has changed and is more efficient than before.
Perfs: the nitvm is a little slower than the naive_interpreter instead of up to 2 times slower before this PR on some benchmarks.
Signed-off-by: Julien Pagès <julien.projet@gmail.com>
Pull-Request: #1023
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Tue, 16 Dec 2014 04:16:26 +0000 (23:16 -0500)]
Merge: nitester on Turing: fix to use nitc + faster and lighter execution
#1000 broke Turing compatibility, this fix it.
Also, do not compile nit and nitvm 30 times in parallel, do it once an copy it 30 times.
Pull-Request: #1018
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 04:16:20 +0000 (23:16 -0500)]
Merge: Doc down
Please disregard commits before 0a57951, they belong to #680.
This pull request remove the module `src/markdown` and use the newly introduced `markdown` parser instead.
## Major changes considering Nit comments
### Synopsys line
Synopsys line must be followed by a blank line for multilines comments according to the Markdown paragraph syntax.
Example before:
# foo doc
fun foo do end
# bar doc
# more doc or doc unit
fun bar do end
After:
# foo doc
fun foo do end
# bar doc
#
# more doc or doc unit
fun bar do end
This is boring, I know, but it allows Nit comment to be properly parsed by most of the markdown parsers.
Also, most of multilne comments are already corrects.
### Code blocks
Code blocks (and doc unit) are now parsed following the correct rule: every line starting with at least 4 spaces is a code block (if not in a nested list).
Example before:
# assert true # was not recognized by nitdoc and nitunit
fun foo do end
After:
# assert true # works in nitunit and nitdoc
fun foo do end
Commit 0b275eb performs those changes on lib/standard as example.
## What's new?
### Full markdown syntax available
All the original markdown syntax is now recognized by the parser (link definitions, blockquotes, nested elements, escape...).
I'm working to add a Github flavoured mode and maby a custom mode for Nitdoc.
### Nitdoc annotations
Some annotations are now recognized in the comments. They do nothing but allow nitdoc to add some style.
Annotation list:
* DEPRECATED
* SEE
* REQUIRE, ENSURE
* FIXME, TODO, NOTE
Syntax:
# Some doc
#
# DEPRECATED: use `bar` instead.
fun foo do end
## TODO
Some tests maybe broken in lib/ and src/ because of the synopsys change, I will update this PR with fixes.
We now have everything we need to work on a Nit flavoured markdown allowing to control nitdoc generation. This is the next step.
Pull-Request: #683
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 16 Dec 2014 04:16:14 +0000 (23:16 -0500)]
Merge: Fix lazy attribute in semi-global compiler
Solve two bugs related to inlining in semi-global that was identified with the lazy attributes.
The first one is the call of a inlinable lazy attribute on a nullable object that caused an assert fail in the compiler.
The second is the usage of label in inlined code that could conflict.
This is needed to integrate #683 and #1011
Pull-Request: #1021
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 15 Dec 2014 20:31:53 +0000 (15:31 -0500)]
nitunit: separate extraction and execution of docunits
Signed-off-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:51:30 +0000 (15:51 -0500)]
neo_doxygen: Add a Python test for namespaces’ members.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:53:12 +0000 (15:53 -0500)]
neo_doxygen: Set the location of implicit classes.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:36:28 +0000 (15:36 -0500)]
neo_doxygen: Add a missing getter in `Entity`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 9 Dec 2014 20:50:25 +0000 (15:50 -0500)]
neo_doxygen: Include namespaces’ members.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 5 Dec 2014 20:00:14 +0000 (15:00 -0500)]
neo_doxygen: Never commit generated makefiles.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 5 Dec 2014 19:55:21 +0000 (14:55 -0500)]
neo_doxygen: Add information about requirements to generate tests.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 5 Dec 2014 19:53:27 +0000 (14:53 -0500)]
neo_doxygen: Use `ProjectGraph.project_name` in `RootNamespace`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Wed, 3 Dec 2014 21:54:42 +0000 (16:54 -0500)]
neo_doxygen: Support more section kinds.
Also document what is not supported yet.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Julien Pagès [Mon, 15 Dec 2014 15:24:10 +0000 (10:24 -0500)]
nitvm: Improve construction of runtime structures
Signed-off-by: Julien Pagès <julien.projet@gmail.com>
Jean Privat [Mon, 15 Dec 2014 15:23:23 +0000 (10:23 -0500)]
tests: add base_attr_lazy2.nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 15 Dec 2014 15:22:30 +0000 (10:22 -0500)]
compiler: use correct recvtype in `AAttrPropdef::evaluate_expr`
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Sun, 14 Dec 2014 03:28:58 +0000 (22:28 -0500)]
contrib/nitester: sort tests per engine first
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 14 Dec 2014 03:16:54 +0000 (22:16 -0500)]
contrib/nitester: tweak verbose level of some messages
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 14 Dec 2014 03:15:37 +0000 (22:15 -0500)]
tests: skip long interpreter tests
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 14 Dec 2014 03:08:16 +0000 (22:08 -0500)]
contrib/nitester: in verbose mode, each worker prints its completed task
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 14 Dec 2014 02:33:23 +0000 (21:33 -0500)]
tests: fix nitg-g blacklist of nitpretty
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 13 Dec 2014 20:07:59 +0000 (15:07 -0500)]
nitester & wrapper: compile nit and nitvm on the controller, and use nitc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 15 Dec 2014 15:08:28 +0000 (10:08 -0500)]
compiler: associate escape_marks to to frame (because of inlining)
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Mon, 15 Dec 2014 15:07:15 +0000 (10:07 -0500)]
Merge branch 'master' into rss_download
Alexis Laferrière [Mon, 8 Dec 2014 02:45:49 +0000 (21:45 -0500)]
contrib/rss_download: add a sample configuration
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 22 Sep 2014 17:50:30 +0000 (13:50 -0400)]
contrib: intro rss_downloader
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sun, 14 Dec 2014 13:44:15 +0000 (08:44 -0500)]
Merge: More macosx compat things
Are nedded to pass more tests on jenkins
http://gresil.org/jenkins/job/CI%20Github%20OSX/
Pull-Request: #1017
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sun, 14 Dec 2014 13:44:12 +0000 (08:44 -0500)]
Merge: add changelog.sh to help the redactor of niteration
Pull-Request: #1015
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sun, 14 Dec 2014 13:44:08 +0000 (08:44 -0500)]
Merge: Fix unread warnings
For the unread local var warnings.
Pull-Request: #1013
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 14 Dec 2014 13:44:05 +0000 (08:44 -0500)]
Merge: Fix misc warnings
For useless empty init and null comparisons
Pull-Request: #1012
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 14 Dec 2014 13:43:58 +0000 (08:43 -0500)]
Merge: nitdoc: Display the attributes
In many languages, attributes are part of the API like methods. Therefore, NitDoc should display them when needed.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #1002
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 14 Dec 2014 13:43:53 +0000 (08:43 -0500)]
Merge: Detect variance constraints
add detection of definition-site variance constraints of formal parameters in nitmetrics.
Pull-Request: #999
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sun, 14 Dec 2014 13:43:49 +0000 (08:43 -0500)]
Merge: Fix chomp and read_lines
Implements the POLA behavior of reading lines.
I might have to wait that #932 is merged before integrating this one.
Close #974 and close #975 (see them for details)
Pull-Request: #978
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sun, 14 Dec 2014 13:43:38 +0000 (08:43 -0500)]
Merge: New path API
As previously discussed with @privat and @R4PaSs, this is a propostion for a new file access API.
It provides new features:
* All file/path related services are to be stored in `Path` instead of `String`. The goal is to store there all the methods previously beginning with `path_` and others like `rmdir` and `files`. The calls to the new API take the form of `"/tmp/somefile.txt".to_path.delete`. You will notice that this PR do not yet move all those services but only a subset as an example, this will be completed if it is appreciated.
* Easy file opening (for read or write) with: `"/tmp/somefile.txt".to_path.open_ro.read_all`
* `Path` stores the concept of full path and filename. Calls to `/etc/somedir/".to_path.files` returns an array of `FilePath` which can be `to_s`ed to get the full path and calling `filename` returns only the file name.
* The native `stat` structure is now renamed to `NativeFileStat` and protected within a Nity finalizable `FileStat`. The new `FileStat` could be implemented differently by platform.
Pull-Request: #831
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 13 Dec 2014 15:59:16 +0000 (10:59 -0500)]
Merge ... 'origin/master' to resolve conflicts with #932 (stream)
Conflicts:
lib/standard/stream.nit
lib/standard/string.nit
src/nitls.nit
tests/sav/test_exec.res
Alexis Laferrière [Sat, 13 Dec 2014 19:39:17 +0000 (14:39 -0500)]
nit: remove unused `PrimitiveNativeFile::file_stat`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 13 Dec 2014 19:35:06 +0000 (14:35 -0500)]
Merge branch 'master' into path
Jean Privat [Sat, 13 Dec 2014 15:12:57 +0000 (10:12 -0500)]
unitrun.sh: do not crash when no time.out file
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 14:45:28 +0000 (09:45 -0500)]
unitrun.sh: detect nonworking date command
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 14:42:15 +0000 (09:42 -0500)]
nitx: use less instad of pager that is a Debianism
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 14:39:55 +0000 (09:39 -0500)]
compiler: add CFLAGS -Wno-attributes to quiet clang on boehm
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 07:52:03 +0000 (02:52 -0500)]
Merge: Fix useless type warnings
And some more... This time for useless type declarations.
Pull-Request: #1010
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 13 Dec 2014 07:51:44 +0000 (02:51 -0500)]
Merge: Fix visibility warnings
On continue dans la série... cette fois c'est pour la disparition des derniers warnings sur la visibilité privée.
Pull-Request: #1009
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 07:51:26 +0000 (02:51 -0500)]
Merge: lib fix warnings (ai)
Some more fixes on warnings.
This time, this is the `ai` project that ends up cleaned of all warnings!
Pull-Request: #1007
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Sat, 13 Dec 2014 07:50:37 +0000 (02:50 -0500)]
Merge: Nitcorn: parameterized uris
Introduces parameterized uri handling like `/users/:id`.
## Route matching
Route can match variables expression.
~~~
class DummyAction super Action end
var action = new DummyAction
var route = new Route("/users/:id", action)
assert not route.match("/users")
assert route.match("/users/1234")
assert route.match("/users/") # empty id
~~~
Standard comportement still unchanged.
~~~
route = new Route("/users", action)
assert route.match("/users")
assert route.match("/users/1234")
assert not route.match("/issues/1234")
~~~
## Route priority
Priority depends on the order the routes where added to the `Routes` dispatcher.
~~~
var host = new VirtualHost("")
var routes = new Routes(host)
routes.add new Route("/:a/:b/:c", action)
routes.add new Route("/users/:id", action)
routes.add new Route("/:foo", action)
assert routes["/a/b/c"].path == "/:a/:b/:c"
assert routes["/a/b/c/d"].path == "/:a/:b/:c"
assert routes["/users/1234/foo"].path == "/:a/:b/:c"
assert routes["/users/"].path == "/users/:id"
assert routes["users/"].path == "/users/:id"
assert routes["/users/1234"].path == "/users/:id"
assert routes["/users"].path == "/:foo"
assert routes["/"].path == "/:foo"
assert routes[""].path == "/:foo"
~~~
## Accessing uri parameter from Action
Parameters can be accessed by parsing the uri.
~~~
route = new Route("/users/:id", action)
var params = route.parse_params("/users/1234")
assert params.has_key("id")
assert not params.has_key("foo")
assert params["id"] == "1234"
~~~
Or from the `HttpRequest`
~~~
route = new Route("/users/:id", action)
var req = new HttpRequest
req.uri_params = route.parse_params("/users/1234")
assert req.params == ["id"]
assert req.param("id") == "1234"
assert req.param("foo") == null
~~~
Note that in most cases, all this work is automatically done by the nitcorn engine.
Parameters can then be access through the `HttpRequest` given to `Action::answer`.
@xymus et @R4PaSs ça peut vous intéresser.
Pull-Request: #1006
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 13 Dec 2014 07:50:24 +0000 (02:50 -0500)]
Merge: lib/time: introduces ISODate
I will soon need this.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #1005
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 13 Dec 2014 07:50:17 +0000 (02:50 -0500)]
Merge: Raise nitc from the dead
Raise dead on `nitc`.
It's super effective...
Pull-Request: #1000
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 13 Dec 2014 07:50:08 +0000 (02:50 -0500)]
Merge: model: register the implicitly injected Bool class in its hierarchy.
The model can inject a primitive a Bool class when required.
It was a hack which was initially introduced by the interpreter that need to manipulate boolean values even if they where not present in the original program.
However, the class was not fully initialized. So fix that.
Maybe a future PR will try to remove this hack (it is not the model's job to inject classes)
Pull-Request: #989
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Sat, 13 Dec 2014 07:49:59 +0000 (02:49 -0500)]
Merge: Github API renaming and group creation
Renamed `github_api` module into `github_curl` (needed the namespace for further work)
Also created the group `github` and added `github_curl` to it.
Finally, added a small nitunit.
Pull-Request: #970
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 13 Dec 2014 07:49:52 +0000 (02:49 -0500)]
Merge: Better nitester on Turing
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Pull-Request: #910
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 07:49:28 +0000 (02:49 -0500)]
Merge: Newstreams
Small refactoring of Streams/Files:
- Added a simple error management system
- Removed FDStreams, reified under FStream
Next PR to come: Proposition for renaming of the classes of the stream hierarchy (as requested in #466)
Pull-Request: #932
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 13 Dec 2014 01:45:29 +0000 (20:45 -0500)]
add changelog.sh to help the redactor of niteration
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Mon, 22 Sep 2014 18:42:02 +0000 (14:42 -0400)]
contrib/sort_downloads: fix makefile to compile alternative or configured scripts
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Fri, 12 Dec 2014 02:45:09 +0000 (21:45 -0500)]
lib/nitcorn: updates README
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 02:43:14 +0000 (21:43 -0500)]
lib/nitcorn: introduces a second action to show uri parameters usage
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 02:42:27 +0000 (21:42 -0500)]
exemples/nitcorn: rename MyAction class by StaticAction.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 02:36:13 +0000 (21:36 -0500)]
lib/nitcorn: handles uri parameters in reactor
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 02:35:44 +0000 (21:35 -0500)]
llib/nitcorn: fixes documentation warnings.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 02:33:24 +0000 (21:33 -0500)]
lib/nitcorn: introduces vararg_routes module
This will allow the creation of parameterized routes like `/users/:id`.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 12 Dec 2014 22:31:40 +0000 (17:31 -0500)]
tests: updates line numbers according to previous modifications
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean-Christophe Beaupré [Thu, 11 Dec 2014 18:50:05 +0000 (13:50 -0500)]
nitdoc: Display attribute types.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 11 Dec 2014 16:58:58 +0000 (11:58 -0500)]
nitdoc: Add tests with attributes.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>