Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most
[dragonfly.git] / sys / boot / ficl / softwords / ficllocal.fr
1 \ ** ficl/softwords/ficllocal.fr
2 \ ** stack comment style local syntax...
3 \ {{ a b c -- d e }}
4 \ variables before the "--" are initialized in reverse order
5 \ from the stack. Those after the "--" are zero initialized
6 \ Uses locals...
7 \ locstate: 0 = looking for -- or }}
8 \           1 = found --
9 \
10 \ $FreeBSD: src/sys/boot/ficl/softwords/ficllocal.fr,v 1.1 1999/09/29 04:43:15 dcs Exp $
11 \ $DragonFly: src/sys/boot/ficl/softwords/ficllocal.fr,v 1.2 2003/06/17 04:28:18 dillon Exp $
12
13 hide
14 0 constant zero
15
16 : ?--   s" --" compare 0= ;
17 : ?}}   s" }}" compare 0= ;
18
19 set-current
20
21 : {{
22     0 dup  locals| nLocs locstate |
23     begin
24         parse-word 
25         ?dup 0= abort" Error: out of text without seeing }}"
26         2dup 2dup  ?-- -rot ?}} or 0=
27     while
28         nLocs 1+ to nLocs
29     repeat
30
31     ?-- if 1 to locstate endif
32
33     nLocs 0 do
34         (local) 
35     loop
36
37     locstate 1 = if
38         begin
39             parse-word
40             2dup ?}} 0=
41         while
42             postpone zero  (local)
43         repeat
44         2drop
45     endif
46
47     0 0 (local)
48 ; immediate compile-only
49  
50 previous