Minor cleanup.
This commit is contained in:
parent
efd77a2ffd
commit
94bcd2aa51
|
|
@ -79,27 +79,6 @@ my_callback(GC_PTR void_obj, __attribute__((unused)) GC_PTR void_environment) {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
JoyList
|
|
||||||
push_integer_from_str(char *str, JoyList tail)
|
|
||||||
{
|
|
||||||
JoyList el = newJoyList;
|
|
||||||
el->head = newJoyType;
|
|
||||||
el->head->kind = joyInt;
|
|
||||||
mpz_init_set_str(el->head->value.i, str, 10);
|
|
||||||
GC_register_finalizer(el->head->value.i, my_callback, NULL, NULL, NULL);
|
|
||||||
el->tail = tail;
|
|
||||||
return el;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
char *
|
|
||||||
trim_leading_blanks(char *str)
|
|
||||||
{
|
|
||||||
size_t offset = strspn(str, BLANKS);
|
|
||||||
return (offset == strlen(str)) ? NULL : (str + offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
JoyList
|
JoyList
|
||||||
make_non_list_node(char *text, size_t size)
|
make_non_list_node(char *text, size_t size)
|
||||||
{
|
{
|
||||||
|
|
@ -229,17 +208,6 @@ pop_list(JoyListPtr stack)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
push_quote_onto_expression(JoyList el, JoyListPtr expression)
|
|
||||||
{
|
|
||||||
JoyList node;
|
|
||||||
if (!el) return;
|
|
||||||
node = make_list_node(el);
|
|
||||||
node->tail = *expression;
|
|
||||||
*expression = node;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
JoyList
|
JoyList
|
||||||
newIntNode(void) {
|
newIntNode(void) {
|
||||||
JoyList node = newJoyList;
|
JoyList node = newJoyList;
|
||||||
|
|
@ -361,6 +329,14 @@ print_stack(JoyList el)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
char *
|
||||||
|
trim_leading_blanks(char *str)
|
||||||
|
{
|
||||||
|
size_t offset = strspn(str, BLANKS);
|
||||||
|
return (offset == strlen(str)) ? NULL : (str + offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JoyList
|
JoyList
|
||||||
parse_list(char **text)
|
parse_list(char **text)
|
||||||
{
|
{
|
||||||
|
|
@ -505,6 +481,17 @@ concatenating them.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
push_quote_onto_expression(JoyList el, JoyListPtr expression)
|
||||||
|
{
|
||||||
|
JoyList node;
|
||||||
|
if (!el) return;
|
||||||
|
node = make_list_node(el);
|
||||||
|
node->tail = *expression;
|
||||||
|
*expression = node;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
JoyTypePtr
|
JoyTypePtr
|
||||||
next_term(JoyListPtr expression)
|
next_term(JoyListPtr expression)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue