parser: move stable content of `parser.nit` into `parser_work.nit

What is still generated is thus more minimal.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: move stable content of `lexer.nit` into `lexer_work.nit

What is still generated is thus even more minimal.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: add `SourceFile::first_token` and `SourceFile::last_token`

This helps to manipulate the token list.

Signed-off-by: Jean Privat <jean@pryen.org>
parser: add some basic tree services in ANode

* `ANode::root` to get the root node
* `ANode::common_parent` to get the smallest common parent of two nodes
* `ANode::depth` to get the distance beween root and self

Signed-off-by: Jean Privat <jean@pryen.org>
parser: `ANode::debug` outputs on stderr instead of stdin

Signed-off-by: Jean Privat <jean@pryen.org>
parser: add `Token::blank_before`

Signed-off-by: Jean Privat <jean@pryen.org>
parser: dot dotdot and dotdotdot are not operators

Signed-off-by: Jean Privat <jean@pryen.org>
src: new module astutil.nit

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update highlight and cie because `.` is no more an operator

Signed-off-by: Jean Privat <jean@pryen.org>
Merge: more feature for the AST

New services for client of the AST who care about the real text representation of the code (eg. highlighter or pretty-printers).

A better nitlighter should follow once this is reviewed and accepted.

The two first commits move some code in new modules.
The folowing commits add some features and nitpickfixes
The last commit introduces a new module, `astutil`, that will be used by the new highlighter (instead of the current ugly double cursor mechanism).

The method `astutil::ANode::to_xml` is not that useful but presents an exemple of a basic implementation of the targeted clients.

Pull-Request: #473
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
lib/html: add `HTMLTag::open`

Signed-off-by: Jean Privat <jean@pryen.org>
lib/html: `HTMLTag::add` returs self for fluent programming

Signed-off-by: Jean Privat <jean@pryen.org>
nitlight: add a title on the html document

Signed-off-by: Jean Privat <jean@pryen.org>
highlight: rewrite using astutil and with infoboxes

Signed-off-by: Jean Privat <jean@pryen.org>
nitlight: enable boostrap in generated pages

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

Signed-off-by: Jean Privat <jean@pryen.org>
parser: do not crash on tokens without location

Do not insert them in the linked lis of tokens
Do not use them to compute locations on productions

Signed-off-by: Jean Privat <jean@pryen.org>
parser_util: drop injected tokens

Do not locate them so they are excluded by the parser.
Remove parents in the result of parse_something so injected tokens
become unaccesible.

Signed-off-by: Jean Privat <jean@pryen.org>
astutil: do not crash if the AST is just a token

Signed-off-by: Jean Privat <jean@pryen.org>
tests: update test_markdown because the new highligther

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