glsl: add _token_list_prepend() helper to the parser
This will be used in the following patch. Cc: mesa-stable Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
This commit is contained in:

committed by
Marge Bot

parent
2c40215ab9
commit
6e29dce291
@@ -99,6 +99,9 @@ _token_create_ival(glcpp_parser_t *parser, int type, int ival);
|
||||
static token_list_t *
|
||||
_token_list_create(glcpp_parser_t *parser);
|
||||
|
||||
static void
|
||||
_token_list_prepend(glcpp_parser_t *parser, token_list_t *list, token_t *token);
|
||||
|
||||
static void
|
||||
_token_list_append(glcpp_parser_t *parser, token_list_t *list, token_t *token);
|
||||
|
||||
@@ -1090,6 +1093,18 @@ _token_list_create(glcpp_parser_t *parser)
|
||||
return list;
|
||||
}
|
||||
|
||||
void
|
||||
_token_list_prepend(glcpp_parser_t *parser, token_list_t *list, token_t *token)
|
||||
{
|
||||
token_node_t *node;
|
||||
|
||||
node = linear_alloc_child(parser->linalloc, sizeof(token_node_t));
|
||||
node->token = token;
|
||||
node->next = list->head;
|
||||
|
||||
list->head = node;
|
||||
}
|
||||
|
||||
void
|
||||
_token_list_append(glcpp_parser_t *parser, token_list_t *list, token_t *token)
|
||||
{
|
||||
|
Reference in New Issue
Block a user