File: lexerbeginnested.c

package info (click to toggle)
yodl 4.05.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,724 kB
  • sloc: ansic: 7,803; perl: 683; cpp: 570; sh: 411; xml: 190; makefile: 163
file content (29 lines) | stat: -rw-r--r-- 821 bytes parent folder | download | duplicates (10)
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
#include "lexer.ih"

/*

    When nested evaluation takes place, the current empty index of the media
stack is pushed and d_empty is set to the current d_media_st size.

    An empty media stack has size 0, which is just before the first element to
push. So, we'll set d_empty to the current size, and then push the string to
evaluate.

    d_empty_size, therefore, is in the world of counts, not offsets.

*/

void lexer_begin_nested(register Lexer *lp, register char const *txt)
{
    register StackValue stValue;
    
    stValue.u_size_t = lp->d_empty_size;
    stack_push(&lp->d_empty_st, stValue);
    lp->d_empty_size = stack_size(&lp->d_media_st);

    if (message_show(MSG_INFO))
        message("Nested media begins at stack size %u", 
                (unsigned)lp->d_empty_size);

    l_push_level(lp, txt);
}