Skip to content

Commit 168f72b

Browse files
committed
Pass block exits up the tree
1 parent 5d4da7c commit 168f72b

File tree

4 files changed

+242
-116
lines changed

4 files changed

+242
-116
lines changed

include/prism/node.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@
2424
* this function returns false, otherwise it returns true.
2525
*
2626
* @param list The list to grow.
27+
* @param size The number of nodes to grow the list by.
2728
* @return True if the list was successfully grown, false otherwise.
2829
*/
29-
bool pm_node_list_grow(pm_node_list_t *list);
30+
bool pm_node_list_grow(pm_node_list_t *list, size_t size);
3031

3132
/**
3233
* Append a new node onto the end of the node list.
@@ -42,8 +43,15 @@ void pm_node_list_append(pm_node_list_t *list, pm_node_t *node);
4243
* @param list The list to prepend to.
4344
* @param node The node to prepend.
4445
*/
45-
void
46-
pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node);
46+
void pm_node_list_prepend(pm_node_list_t *list, pm_node_t *node);
47+
48+
/**
49+
* Concatenate the given node list onto the end of the other node list.
50+
*
51+
* @param list The list to concatenate onto.
52+
* @param other The list to concatenate.
53+
*/
54+
void pm_node_list_concat(pm_node_list_t *list, pm_node_list_t *other);
4755

4856
/**
4957
* Free the internal memory associated with the given node list.

include/prism/parser.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ typedef enum {
358358
/** a singleton class definition */
359359
PM_CONTEXT_SCLASS,
360360

361+
/** a ternary expression */
362+
PM_CONTEXT_TERNARY,
363+
361364
/** an unless statement */
362365
PM_CONTEXT_UNLESS,
363366

0 commit comments

Comments
 (0)