]> code.delx.au - gnu-emacs/blob - test/etags/forth-src/test-forth.fth
* etc/AUTHORS: Update the AUTHORS file
[gnu-emacs] / test / etags / forth-src / test-forth.fth
1 \
2 \ This is a file that tests Forth tags
3 \
4 \ You should get:
5 \ a-forth-word (twice)
6 \ a-forth-constant!
7 \ a-forth-value?
8 \ :a-forth-dictionary-entry
9 \ #a-defer-word
10 \ (another-forth-word)
11 \ (a-forth-constant
12 \ #some-storage
13 \ assemby-code-word
14
15
16 \ This is a forth comment
17
18 ( Another forth comment )
19
20 : a-forth-word ( a b c -- a*b+c ) + * ;
21
22 99 constant a-forth-constant!
23 55 value a-forth-value?
24 create :a-forth-dictionary-entry
25 0 c, 9 c, 5 c, 7 c, 999999 ,
26
27 defer #a-defer-word
28
29 : (another-forth-word) ( -- )
30 ." Hello world"
31 ;
32
33 ' (another-forth-word) to #a-defer-word
34
35 struct
36 9 field >field1
37 5 field >field2
38 constant (a-forth-constant
39
40
41 2000 buffer: #some-storage
42
43 code assemby-code-word ( dunno what it does )
44 g1 g2 mov \ Move from here to there
45 sc2 h# 13 sc2 sllx \ shift stuff 'round
46 c;
47
48 \ And for the heck of it, redefine a-forth-word.
49
50 : a-forth-word ( a b c -- )
51 a-forth-word dup 200 > abort" Eek. The number is too big"
52 ." Result is " . cr
53 ;