ariatemplates/editor-backend — pull request #31 by flongo (2013-10-07 07:53:59+00:00)
Title: Creation of a parser for AT templates and HTML

Parser - AT-HTML grammar
A new grammar has been created.
* It allows to parse at the same time AT templating language and HTML.
* It should parse any input string and output the AST representation. There should be no case in which the parsing fails.
* It decorates the tree with validation errors and warnings.
* It interacts with aria templates source code in order to retrieve the list of statements and validate their usage.
A stylesheet has been added for the highlight based on the new grammar.

Build
* build and watch npm scripts have been updated for the new grammar

Tests utility
The test utility test/node_modules/parserTester.js has been improved. It allows to
* test failures
* execute multiple tests whose input is in the same file
* test the duration of a parsing operation (useful for performance monitoring)
* output the expected result in a file

Tests
* test.js: Tests for the AT-HTML parser have been added.

Node/graph utility
The following methods have been added:
* merge: merges consecutive nodes updating the location information
* addError and addWarning in order to decorate a node with validation messages
* moveLocation: moves the location of a node by a specified offset. Useful for nesting parsing operations
In order to improve performances, traverse operations have been reduced, namely the whole tree elements are no longer endowed with an id or decorated with the reference to a shared node.

Front-end application
* The AT-HTML mode has been set as default.
* Parse, fold and outline actions on source change have been inhibited. Only highlight has been kept. Outiline is done only upon clicking on the right tab.
* Validate action has been introduced in order to decorate the ACE editor with warnings and messages.
* The update is niot done at every code change, but every two seconds and only if something has changed.

Close #3