File: pendnested.c

package info (click to toggle)
yodl 4.04.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,720 kB
  • sloc: ansic: 7,803; perl: 683; cpp: 570; sh: 411; xml: 190; makefile: 164
file content (34 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "parser.ih"

char *p_end_nested(register Parser *pp, HANDLER_SET_ELEMENTS newSet)
{
    register char *text = 0;

    switch (newSet)
    {
        case COLLECT_SET:
        case DEFAULT_SET:
            text = string_grab(&pp->d_string_ptr);
            pp->d_string_ptr = stack_tos(&pp->d_string_st)->u_Stringp;
            stack_pop(&pp->d_string_st);
        break;

        case NOTRANS_SET:
        case NOEXPAND_SET:
            parser_pop_ws_level(pp);
        break;

        default:
        break;
    }

                                            /* restore the inserter         */
    pp->d_insert = stack_tos(&pp->d_insert_st)->u_Pfun2p;
    stack_pop(&pp->d_insert_st);

                                            /* restore the handler set      */
    pp->d_handler = stack_tos(&pp->d_handler_st)->u_Pfun1p;
    stack_pop(&pp->d_handler_st);

    return text;
}