nit.git
13 years agomisc: update NOTICE
Jean Privat [Thu, 17 Feb 2011 15:22:01 +0000 (10:22 -0500)]
misc: update NOTICE

* update dates
* add Alexandre Terrasa

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

13 years agodoc: french doc "développez en Nit"
Alexandre Terrasa [Thu, 17 Feb 2011 15:04:58 +0000 (10:04 -0500)]
doc: french doc "développez en Nit"

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>
Signed-off-by: Jean Privat <jean@pryen.org>

13 years agoexample: add circular_list.nit
Jean Privat [Thu, 17 Feb 2011 10:23:49 +0000 (05:23 -0500)]
example: add circular_list.nit

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

13 years agoexample: add clock.nit and clock_mode.nit
Jean Privat [Wed, 16 Feb 2011 18:22:25 +0000 (13:22 -0500)]
example: add clock.nit and clock_mode.nit

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

13 years agodoc: first real reference for the Nit language
Jean Privat [Sat, 12 Feb 2011 02:09:43 +0000 (21:09 -0500)]
doc: first real reference for the Nit language

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

13 years agoMerge branch 'update_syntax' into next
Jean Privat [Tue, 15 Feb 2011 13:53:29 +0000 (08:53 -0500)]
Merge branch 'update_syntax' into next

13 years agoMerge branch 'various-fixes' into next
Jean Privat [Tue, 15 Feb 2011 13:52:54 +0000 (08:52 -0500)]
Merge branch 'various-fixes' into next

13 years agoparser: remove warning about useless cast
Jean Privat [Sat, 12 Feb 2011 02:30:38 +0000 (21:30 -0500)]
parser: remove warning about useless cast

Old c_src was not able to infer that result is not null.

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

13 years agoparser: use break and infinite loops
Jean Privat [Sat, 12 Feb 2011 02:24:07 +0000 (21:24 -0500)]
parser: use break and infinite loops

Because of the new c_src we can use them.

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

13 years agolib: fix NaiveCollection::length
Jean Privat [Sat, 12 Feb 2011 02:10:32 +0000 (21:10 -0500)]
lib: fix NaiveCollection::length

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

13 years agometamodel: rename 'universal' to 'enum'
Jean Privat [Sat, 12 Feb 2011 08:11:28 +0000 (03:11 -0500)]
metamodel: rename 'universal' to 'enum'

In the identifiers used in the metamodel and in the error messages.

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

13 years agomisc: update syntax file with module and enum
Jean Privat [Wed, 9 Feb 2011 18:23:11 +0000 (13:23 -0500)]
misc: update syntax file with module and enum

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

13 years agotests: use enum instead of universal
Jean Privat [Fri, 11 Feb 2011 21:11:30 +0000 (16:11 -0500)]
tests: use enum instead of universal

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

13 years agometamodel: rename 'universal' to 'enum'
Jean Privat [Wed, 9 Feb 2011 16:34:23 +0000 (11:34 -0500)]
metamodel: rename 'universal' to 'enum'

In the identifiers used in the metamodel and in the error messages.

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

13 years agoparser: rename 'enum' to 'universal'
Jean Privat [Fri, 11 Feb 2011 21:07:30 +0000 (16:07 -0500)]
parser: rename 'enum' to 'universal'

In fact, both are synonymous until 'universal' is completely removed.

Also rename some identifiers.

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

13 years agolib: change identifier enum to values
Jean Privat [Wed, 9 Feb 2011 15:16:41 +0000 (10:16 -0500)]
lib: change identifier enum to values

The keyword universal will be renamed to enum.

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

13 years agodoc: use 'module' instead of 'package' in comments
Jean Privat [Wed, 9 Feb 2011 18:22:49 +0000 (13:22 -0500)]
doc: use 'module' instead of 'package' in comments

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

13 years agotests: use module instead of package
Jean Privat [Wed, 9 Feb 2011 16:44:44 +0000 (11:44 -0500)]
tests: use module instead of package

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

13 years agoparser: comment why !nopar is required in some place
Jean Privat [Wed, 9 Feb 2011 14:50:20 +0000 (09:50 -0500)]
parser: comment why !nopar is required in some place

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

13 years agotests: more documentation to tests_icode.sh
Jean-Sebastien Gelinas [Thu, 3 Feb 2011 18:18:03 +0000 (13:18 -0500)]
tests: more documentation to tests_icode.sh

it was not really clear what it was doing :$

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

13 years agotool: gccx use long version of the redirection
Jean-Sebastien Gelinas [Tue, 8 Feb 2011 20:44:42 +0000 (15:44 -0500)]
tool: gccx use long version of the redirection

MacOS does not like the short one.

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

13 years agoc_src: update
Jean Privat [Sat, 29 Jan 2011 03:14:36 +0000 (22:14 -0500)]
c_src: update

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

13 years agoMerge branch 'll-and-gg-operators' into wip
Jean Privat [Sat, 29 Jan 2011 02:20:37 +0000 (21:20 -0500)]
Merge branch 'll-and-gg-operators' into wip

13 years agotests: add << and >> in test_operators.nit
Jean Privat [Sat, 29 Jan 2011 02:01:54 +0000 (21:01 -0500)]
tests: add << and >> in test_operators.nit

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

13 years agoparser: add << and >> operators
Jean Privat [Fri, 28 Jan 2011 21:26:48 +0000 (16:26 -0500)]
parser: add << and >> operators

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

13 years agoMerge branch 'package2module' into wip
Jean Privat [Fri, 28 Jan 2011 21:17:53 +0000 (16:17 -0500)]
Merge branch 'package2module' into wip

Conflicts:
  src/program.nit
  src/abstracttool.nit
  analysis/inline_get_and_set.nit

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

13 years agoMerge branch 'beef-up-gccx' into wip
Jean Privat [Fri, 28 Jan 2011 20:40:48 +0000 (15:40 -0500)]
Merge branch 'beef-up-gccx' into wip

13 years agomisc: gccx does not accept more than 2 Vs (-vv), make sure we don't generate more...
Jean-Sebastien Gelinas [Fri, 28 Jan 2011 20:15:34 +0000 (15:15 -0500)]
misc: gccx does not accept more than 2 Vs (-vv), make sure we don't generate more than two Vs

A better way of handling this would be to make gccx smarter !

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agotool: use ccache in gccx, if available
Jean Privat [Fri, 28 Jan 2011 20:14:41 +0000 (15:14 -0500)]
tool: use ccache in gccx, if available

This improves the compile-time of the hot-compilation case.

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

13 years agoMerge branch 'alexis/various-fixes' into wip
Jean Privat [Tue, 25 Jan 2011 02:35:09 +0000 (21:35 -0500)]
Merge branch 'alexis/various-fixes' into wip

13 years agocompile: Check the validity of module filename before parsing.
Alexis Laferrière [Sat, 25 Sep 2010 13:49:57 +0000 (09:49 -0400)]
compile: Check the validity of module filename before parsing.

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

13 years agolib: adds methods to tell if Char is a lower, upper, letter and digit
Alexis Laferrière [Mon, 24 Jan 2011 20:42:44 +0000 (15:42 -0500)]
lib: adds methods to tell if Char is a lower, upper, letter and digit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Jean Privat <jean@pryen.org>

13 years agoMerge remote branch 'pu/new-style_attributes' into wip
Jean Privat [Tue, 25 Jan 2011 01:07:30 +0000 (20:07 -0500)]
Merge remote branch 'pu/new-style_attributes' into wip

Conflicts:
src/parser/parser_tables.nit
src/parser/table_nit.c

13 years agoMerge branch 'pu/parser_tables_in_c' into wip
Jean Privat [Tue, 25 Jan 2011 01:03:31 +0000 (20:03 -0500)]
Merge branch 'pu/parser_tables_in_c' into wip

13 years agocompile: remove hackish optimization of Array::add
Jean Privat [Mon, 24 Jan 2011 22:01:00 +0000 (17:01 -0500)]
compile: remove hackish optimization of Array::add

This optimization was useful with the parsing tables in Nit.

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

13 years agoparser: update README
Jean Privat [Mon, 24 Jan 2011 21:57:46 +0000 (16:57 -0500)]
parser: update README

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

13 years agoparser: use C tables in parser
Jean Privat [Mon, 24 Jan 2011 21:47:40 +0000 (16:47 -0500)]
parser: use C tables in parser

Also remove all remainings of the old parser_tables.nit since it is
no more needed.

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

13 years agoparser: use C tables in lexer
Jean Privat [Mon, 24 Jan 2011 21:31:55 +0000 (16:31 -0500)]
parser: use C tables in lexer

The new module parser/tables contains the tables used during the lexical
analysis.
Therefore, we do not need to have big tables in the Nit code for the lexer.

During the conversion, the handling of states (aka lexical contexts)
is removed since it is not used.

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

13 years agoparser: factorize the lexer big accept switch
Jean Privat [Fri, 7 Jan 2011 06:23:10 +0000 (01:23 -0500)]
parser: factorize the lexer big accept switch

13 years agosyntax: new-style attributes for those without underscore
Jean Privat [Wed, 5 Jan 2011 08:18:41 +0000 (03:18 -0500)]
syntax: new-style attributes for those without underscore

A "new-style" attribute is not directly accessible.
Therefore it automatically comes with two accessors.

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

13 years agoparser: accept attribute without underscore
Jean Privat [Wed, 5 Jan 2011 06:48:49 +0000 (01:48 -0500)]
parser: accept attribute without underscore

This new syntax allow us to write
    class A
      var x: X
    end

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

13 years agoparser: gnu sed do not like spaces
Jean Privat [Sat, 22 Jan 2011 03:04:59 +0000 (22:04 -0500)]
parser: gnu sed do not like spaces

Fix 7d4ae02b1e07bc065063.
Next time do not forget to check that the parser is really buildable.

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

13 years agoMerge remote branch 'jean-sebastien/various-fixes' into next
Jean Privat [Fri, 21 Jan 2011 21:27:44 +0000 (16:27 -0500)]
Merge remote branch 'jean-sebastien/various-fixes' into next

13 years agomisc: save backup (with extention .orig) when regenerating parser/lexer
Jean-Sebastien Gelinas [Fri, 21 Jan 2011 19:37:25 +0000 (14:37 -0500)]
misc: save backup (with extention .orig) when regenerating parser/lexer

13 years agotests: add test for logging feature of nitc
Jean-Sebastien Gelinas [Fri, 7 Jan 2011 21:24:24 +0000 (16:24 -0500)]
tests: add test for logging feature of nitc

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agotests: add nitc test
Jean-Sebastien Gelinas [Fri, 7 Jan 2011 21:21:56 +0000 (16:21 -0500)]
tests: add nitc test

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agologs: add log information to the getter/setter inlining optimization
Jean-Sebastien Gelinas [Fri, 7 Jan 2011 08:17:06 +0000 (03:17 -0500)]
logs: add log information to the getter/setter inlining optimization

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agologs: fix logging feature, was crashing because of missing visibility tests
Jean-Sebastien Gelinas [Fri, 7 Jan 2011 19:18:11 +0000 (14:18 -0500)]
logs: fix logging feature, was crashing because of missing visibility tests

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agomisc: add lib/*.log and lib/*.dot to .gitignore
Jean-Sebastien Gelinas [Fri, 21 Jan 2011 19:41:29 +0000 (14:41 -0500)]
misc: add lib/*.log and lib/*.dot to .gitignore

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agomisc: merge src/.gitignore to repository root
Jean-Sebastien Gelinas [Fri, 21 Jan 2011 19:39:47 +0000 (14:39 -0500)]
misc: merge src/.gitignore to repository root

13 years agoparser: rename package-related classes and properties
Jean Privat [Thu, 20 Jan 2011 19:44:49 +0000 (14:44 -0500)]
parser: rename package-related classes and properties

TKwpackage -> TKwmodule
APackagedecl -> AModuledecl
n_packagedecl -> n_moduledecl
n_kwpackage -> n_kwmodule

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

13 years agoparser: accept the 'module' keyword
Jean Privat [Thu, 20 Jan 2011 16:57:55 +0000 (11:57 -0500)]
parser: accept the 'module' keyword

However, just make it a synonym for 'package'.

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

13 years agosrc: rename 'module' identifiers
Jean Privat [Thu, 20 Jan 2011 16:56:43 +0000 (11:56 -0500)]
src: rename 'module' identifiers

'module' will become a keyword.
Therefore the identifiers 'module' must be renamed.

The strategy is the following:
* use 'mod' in local variables and parameters
* Program::module -> Program::main_module
* use mmmodule for other properties (no better ideas)

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

13 years agoMerge branch 'optimize_c_code' into next
Jean Privat [Thu, 20 Jan 2011 14:18:56 +0000 (09:18 -0500)]
Merge branch 'optimize_c_code' into next

13 years agocompatibility: fix compiler warning about size_t on some system
Jean-Sebastien Gelinas [Fri, 7 Jan 2011 05:52:33 +0000 (00:52 -0500)]
compatibility: fix compiler warning about size_t on some system

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agocompile: LOCATE_* as static const strings
Jean Privat [Wed, 5 Jan 2011 03:42:19 +0000 (22:42 -0500)]
compile: LOCATE_* as static const strings

Do not use macros to factorize strings but static const strings.
This way the strings are stored in the RO segment of the binary.

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

13 years agocompile: factorize abort code in the clib
Jean Privat [Wed, 5 Jan 2011 03:22:00 +0000 (22:22 -0500)]
compile: factorize abort code in the clib

Instead of generating again and again the same insructions for aborts
we have now a function nit_abort in the runtime C library.

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

13 years agocompile: do not generate table and constructor iroutines of abstract/interface classes
Jean Privat [Wed, 15 Dec 2010 16:04:32 +0000 (17:04 +0100)]
compile: do not generate table and constructor iroutines of abstract/interface classes

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

13 years agoMerge remote branch 'jean-sebastien/fix-test-icode' into next
Jean Privat [Tue, 4 Jan 2011 17:35:37 +0000 (12:35 -0500)]
Merge remote branch 'jean-sebastien/fix-test-icode' into next

13 years agotests: make sure all tests are ran by default
Jean-Sebastien Gelinas [Thu, 23 Dec 2010 04:50:56 +0000 (23:50 -0500)]
tests: make sure all tests are ran by default

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agotests: add missing tests file for icode_ireg
Jean-Sebastien Gelinas [Wed, 22 Dec 2010 22:56:15 +0000 (17:56 -0500)]
tests: add missing tests file for icode_ireg

Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>

13 years agomisc: Adds type and universal to gtk syntax highlighting.
Alexis Laferrière [Sat, 25 Sep 2010 12:39:41 +0000 (08:39 -0400)]
misc: Adds type and universal to gtk syntax highlighting.

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

13 years agolib: Removes debug output from use of environement variables.
Alexis Laferrière [Sat, 25 Sep 2010 12:06:14 +0000 (08:06 -0400)]
lib: Removes debug output from use of environement variables.

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

13 years agotool: add option -ll (clang) to gccx
Jean Privat [Wed, 4 Aug 2010 16:33:36 +0000 (12:33 -0400)]
tool: add option -ll (clang) to gccx

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

13 years agotool: add option -R (recompilation) to gccx
Jean Privat [Wed, 4 Aug 2010 16:32:40 +0000 (12:32 -0400)]
tool: add option -R (recompilation) to gccx

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

13 years agoMerge remote branch 'boa/pu/optimize_parser' into wip
Jean Privat [Wed, 22 Sep 2010 01:51:11 +0000 (21:51 -0400)]
Merge remote branch 'boa/pu/optimize_parser' into wip

13 years agoparser: factorize reduce actions
Jean Privat [Wed, 22 Sep 2010 01:46:30 +0000 (21:46 -0400)]
parser: factorize reduce actions

The fact_parser script postprocesses the generated parser.nit and
factorizes the ReduceAction classes.

Before factorization: 605 classes
After factorization: 355 classes

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

13 years agolib: keys in maps and sets are not nullable
Jean Privat [Mon, 26 Jul 2010 20:40:39 +0000 (16:40 -0400)]
lib: keys in maps and sets are not nullable

This removes some unsafe code and prepare for a potential strictier nullabe type
implementation.

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

# Conflicts:
#
#  lib/standard/collection/hash_collection.nit

13 years agolib: fix ArrayMap::first
Jean Privat [Thu, 22 Jul 2010 17:12:36 +0000 (13:12 -0400)]
lib: fix ArrayMap::first

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

13 years agotests: add base_orelse.nit
Jean Privat [Fri, 6 Aug 2010 16:45:55 +0000 (12:45 -0400)]
tests: add base_orelse.nit

Commit 33928a213274ee42ea341113c746a064da3f6bf4 added the sav-files without
the test file.

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

13 years agoparser: do not write the goto address in the generated action
Jean Privat [Wed, 4 Aug 2010 16:30:43 +0000 (11:30 -0500)]
parser: do not write the goto address in the generated action

Store the number in an attribute of the ReduceAction classes.
This is necessary for the factorisation of actions.

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

13 years agoparser: add Parser::concat to factorize code
Jean Privat [Wed, 4 Aug 2010 14:35:27 +0000 (09:35 -0500)]
parser: add Parser::concat to factorize code

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

13 years agoparser: reduce some automatic inlining
Jean Privat [Wed, 4 Aug 2010 17:43:34 +0000 (13:43 -0400)]
parser: reduce some automatic inlining

* readable and writable with automatic opt
* stmtsn = stmts + n
* noend -> nolabel
* remove methid~noassign variant
* remove propdefs_tail

Currently, the only automatic inlining that remains are:

* PRedef
* PRecv
* PImplicitTopClass
* PRecvNopar
* PRecvNobra

Before:
* maketime=1m35s
* parser_tables.nit=492KB
* parser.nit=1.3MB
* nb reduceactions=1199
After:
* maketime=28s
* parser_tables=251KN
* parser.nit=501KB
* nb reduceactions=664

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

13 years agomisc: add *.log and *.dot to .gitignore
Jean Privat [Mon, 26 Jul 2010 19:01:36 +0000 (15:01 -0400)]
misc: add *.log and *.dot to .gitignore

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

13 years agoMerge branch 'hash_optimisations' into wip
Jean Privat [Fri, 16 Jul 2010 16:56:13 +0000 (12:56 -0400)]
Merge branch 'hash_optimisations' into wip

13 years agocompile: filter some loops in program icode generation
Jean Privat [Fri, 16 Jul 2010 16:55:18 +0000 (12:55 -0400)]
compile: filter some loops in program icode generation

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

13 years agometamodel: use HashSets instead of Arrays
Jean Privat [Fri, 16 Jul 2010 03:41:47 +0000 (23:41 -0400)]
metamodel: use HashSets instead of Arrays

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

13 years agolib: hash_collection learns the standard hashmap implementation
Jean Privat [Fri, 16 Jul 2010 03:40:40 +0000 (23:40 -0400)]
lib: hash_collection learns the standard hashmap implementation

The standard hashmap implementation use array with chained nodes (bucklets).
The previous implementation triggers patological case with a near O(n)
complexity.

Warm bootstrap shows an improvement from 0m21.217s to 0m18.613s.

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

13 years agolib: reduce acces to _array in hash_collection
Jean Privat [Fri, 16 Jul 2010 03:32:27 +0000 (23:32 -0400)]
lib: reduce acces to _array in hash_collection

Add helper functions and refactorize some code

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

13 years agolib: direct key access in HashMap and HashSet
Jean Privat [Tue, 13 Jul 2010 21:04:41 +0000 (17:04 -0400)]
lib: direct key access in HashMap and HashSet

Improve HashMap efficiency by acceding the key of HashNodes directely.

HashMapNode is no more a Couple and HashMap is no more a CoupleMap.

rought figures show a small speed improvement:

$ time ./nitc -v -W -p 2 nitc
avant: 1m15.061s
apres: 1m10.424s

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

13 years agoMerge branch 'syntax_flow_and_scope' into wip
Jean Privat [Mon, 28 Jun 2010 12:32:02 +0000 (08:32 -0400)]
Merge branch 'syntax_flow_and_scope' into wip

13 years agoMerge branch 'valgrind_script' into wip
Jean Privat [Mon, 28 Jun 2010 12:31:56 +0000 (08:31 -0400)]
Merge branch 'valgrind_script' into wip

13 years agotools: add a valgrind helper script
Jean Privat [Thu, 24 Jun 2010 06:22:37 +0000 (02:22 -0400)]
tools: add a valgrind helper script

The script call valgrind with the right options to disable the GC and
avoid loops.

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

13 years agosyntax: merge ScopeContext and EscapeContext
Jean Privat [Fri, 18 Jun 2010 18:53:07 +0000 (14:53 -0400)]
syntax: merge ScopeContext and EscapeContext

and reorganize the related modules modules

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

13 years agosyntax: split the VariableContext into a Scope and a Flow context
Jean Privat [Fri, 18 Jun 2010 17:01:52 +0000 (13:01 -0400)]
syntax: split the VariableContext into a Scope and a Flow context

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

13 years agosyntax: new enter_visit_block helper function
Jean Privat [Fri, 18 Jun 2010 00:10:43 +0000 (20:10 -0400)]
syntax: new enter_visit_block helper function

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

13 years agosyntax: new mark_unreash helper function
Jean Privat [Fri, 18 Jun 2010 00:10:13 +0000 (20:10 -0400)]
syntax: new mark_unreash helper function

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

13 years agosyntax: factorize some block/loop structures
Jean Privat [Thu, 17 Jun 2010 08:03:45 +0000 (04:03 -0400)]
syntax: factorize some block/loop structures

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

13 years agosyntax: new "or else" construction
Jean Privat [Tue, 15 Jun 2010 13:11:25 +0000 (09:11 -0400)]
syntax: new "or else" construction

where
  var c = x or else y
is (roughly) equivalent to
  var c = x
  if c == null then c = y

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

14 years agosyntax: "super" is a synonym of "special"
Jean Privat [Thu, 11 Mar 2010 16:42:00 +0000 (11:42 -0500)]
syntax: "super" is a synonym of "special"

Nit syntax is declarative with nouns.

Examples:
  "class X" -> X is a class
  "fun x" -> x is a function of the class
  "var _x" -> _x is an instance variable of the class
  "init x" -> x is a constructor of the class

Therefore, it can make sense that the declaration
of superclasses use the same scheme.

  "super Y" -> Y is a superclass of the class
instead of the current
  "special Y" -> the class specializes Y
                (or the class is a special kind of Y)

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

14 years agoicode: link INative with a MMMethod instead of a raw C code
Jean Privat [Wed, 10 Feb 2010 21:49:54 +0000 (16:49 -0500)]
icode: link INative with a MMMethod instead of a raw C code

syntax/icode_generation.nit is made cleaner since all the C stuff is
now done in compiling/compiling_icode.nit

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

14 years agometamodel: move the extern name of a method in the metamodel
Jean Privat [Wed, 10 Feb 2010 17:52:16 +0000 (12:52 -0500)]
metamodel: move the extern name of a method in the metamodel

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

14 years agoicode: add I*Value classes
Jean Privat [Wed, 10 Feb 2010 15:45:31 +0000 (10:45 -0500)]
icode: add I*Value classes

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

14 years agocompile: declare NEW_NativeArray in nit_common.h
Jean Privat [Tue, 9 Feb 2010 22:07:38 +0000 (17:07 -0500)]
compile: declare NEW_NativeArray in nit_common.h

Thus simplify compiling_global::MMLocalClass::declare_tables_to_c

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

14 years agocompile: add class compiling::CProgram to manage generated files
Jean Privat [Fri, 5 Feb 2010 15:33:45 +0000 (10:33 -0500)]
compile: add class compiling::CProgram to manage generated files

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

14 years agocompile: use writers in icode compilation
Jean Privat [Fri, 29 Jan 2010 20:13:59 +0000 (15:13 -0500)]
compile: use writers in icode compilation

Remove superstrings and other kinds of string concatenations.

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

14 years agocompile: add module compiling_writer to replace CContext
Jean Privat [Fri, 29 Jan 2010 20:08:06 +0000 (15:08 -0500)]
compile: add module compiling_writer to replace CContext

It will helps to make the code generation more flexible and more efficient.
However, this patch does not change the generated C.

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

14 years agotools: nc kill showerr on TERM/INT
Jean Privat [Tue, 9 Feb 2010 22:31:20 +0000 (17:31 -0500)]
tools: nc kill showerr on TERM/INT

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

14 years agogc: rewrite for efficiency
Jean Privat [Wed, 27 Jan 2010 18:05:11 +0000 (13:05 -0500)]
gc: rewrite for efficiency

* Major code clean
* Do only one pass (was 2 in the worst case)
* Map gc block to the page size
* Free the inactive heap

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

14 years agogc: new NIT_GC_OPTION 'malloc'
Jean Privat [Wed, 27 Jan 2010 16:55:00 +0000 (11:55 -0500)]
gc: new NIT_GC_OPTION 'malloc'

Used to have a genuine malloc thing that can be valginded.

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