Support syntax error feedback in parser.

Now, parser correctly finishes parse procedure if syntax of source code is incorrect (syntax correctness is indicated using return value):
 - parser-internal memory management is performed using jsp_mm_alloc / jsp_mm_free;
 - upon detection of incorrect syntax, all parser-allocated memory regions are deallocated using jsp_mm_free_all and parse finishes with corresponding return value.

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-19 00:11:31 +03:00
parent 85f12de139
commit a4e54e736e
46 changed files with 227 additions and 173 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ jsp_mm_recommend_size (size_t minimum_size) /**< minimum required size */
void*
jsp_mm_alloc (size_t size) /**< size of block to allocate */
{
void *ptr_p = mem_heap_alloc_block (size, MEM_HEAP_ALLOC_SHORT_TERM);
void *ptr_p = mem_heap_alloc_block (size + sizeof (jsp_mm_header_t), MEM_HEAP_ALLOC_SHORT_TERM);
jsp_mm_header_t *tmem_header_p = (jsp_mm_header_t*) ptr_p;