preserve token order in list nodes

This commit is contained in:
Josh Holtrop 2018-05-20 16:24:05 -04:00
parent 4ab2032c00
commit e4b7f5335f

View File

@ -520,7 +520,7 @@ declaration_specifiers
}
| storage_class_specifier declaration_specifiers {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
| type_specifier {
$$ = new Node(NODE_TYPE_LIST);
@ -528,7 +528,7 @@ declaration_specifiers
}
| type_specifier declaration_specifiers {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
| type_qualifier {
$$ = new Node(NODE_TYPE_LIST);
@ -536,7 +536,7 @@ declaration_specifiers
}
| type_qualifier declaration_specifiers {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
| attribute_spec {
$$ = new Node(NODE_TYPE_LIST);
@ -544,7 +544,7 @@ declaration_specifiers
}
| attribute_spec declaration_specifiers {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
;
@ -655,7 +655,7 @@ struct_declaration
specifier_qualifier_list
: type_specifier specifier_qualifier_list {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
| type_specifier {
$$ = new Node(NODE_TYPE_LIST);
@ -663,7 +663,7 @@ specifier_qualifier_list
}
| type_qualifier specifier_qualifier_list {
$$ = $2;
$$->list->push_back($1);
$$->list->push_front($1);
}
| type_qualifier {
$$ = new Node(NODE_TYPE_LIST);