1*afc2ba1dSToomas Soome\ ** ficl/softwords/ficllocal.fr
2*afc2ba1dSToomas Soome\ ** stack comment style local syntax...
3*afc2ba1dSToomas Soome\ {{ a b c -- d e }}
4*afc2ba1dSToomas Soome\ variables before the "--" are initialized in reverse order
5*afc2ba1dSToomas Soome\ from the stack. Those after the "--" are zero initialized
6*afc2ba1dSToomas Soome\ Uses locals...
7*afc2ba1dSToomas Soome\ locstate: 0 = looking for -- or }}
8*afc2ba1dSToomas Soome\           1 = found --
9*afc2ba1dSToomas Soomehide
10*afc2ba1dSToomas Soome0 constant zero
11*afc2ba1dSToomas Soome
12*afc2ba1dSToomas Soome: ?--   s" --" compare 0= ;
13*afc2ba1dSToomas Soome: ?}}   s" }}" compare 0= ;
14*afc2ba1dSToomas Soome
15*afc2ba1dSToomas Soomeset-current
16*afc2ba1dSToomas Soome
17*afc2ba1dSToomas Soome: {{
18*afc2ba1dSToomas Soome    0 dup  locals| nLocs locstate |
19*afc2ba1dSToomas Soome    begin
20*afc2ba1dSToomas Soome        parse-word
21*afc2ba1dSToomas Soome        ?dup 0= abort" Error: out of text without seeing }}"
22*afc2ba1dSToomas Soome        2dup 2dup  ?-- -rot ?}} or 0=
23*afc2ba1dSToomas Soome    while
24*afc2ba1dSToomas Soome        nLocs 1+ to nLocs
25*afc2ba1dSToomas Soome    repeat
26*afc2ba1dSToomas Soome
27*afc2ba1dSToomas Soome    ?-- if 1 to locstate endif
28*afc2ba1dSToomas Soome
29*afc2ba1dSToomas Soome    nLocs 0 do
30*afc2ba1dSToomas Soome        (local)
31*afc2ba1dSToomas Soome    loop
32*afc2ba1dSToomas Soome
33*afc2ba1dSToomas Soome    locstate 1 = if
34*afc2ba1dSToomas Soome        begin
35*afc2ba1dSToomas Soome            parse-word
36*afc2ba1dSToomas Soome            2dup ?}} 0=
37*afc2ba1dSToomas Soome        while
38*afc2ba1dSToomas Soome            postpone zero  (local)
39*afc2ba1dSToomas Soome        repeat
40*afc2ba1dSToomas Soome        2drop
41*afc2ba1dSToomas Soome    endif
42*afc2ba1dSToomas Soome
43*afc2ba1dSToomas Soome    0 0 (local)
44*afc2ba1dSToomas Soome; immediate compile-only
45*afc2ba1dSToomas Soome
46*afc2ba1dSToomas Soomeprevious
47