unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
blob ce4069dfa8f6d53d7cf1d6626a944210dad049c3 987 bytes (raw)
name: test/manual/etags/forth-src/test-forth.fth 	 # note: path name is non-authoritative(*)

 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
 
\
\ This is a file that tests Forth tags
\
\ You should get:
\	a-forth-word		(twice)
\	a-forth-constant!
\	a-forth-value?
\	:a-forth-dictionary-entry
\	#a-defer-word
\	(another-forth-word)
\	(a-forth-constant
\	#some-storage
\	assemby-code-word


\ This is a forth comment

( Another forth comment )

: a-forth-word ( a b c -- a*b+c )  + * ;

99 constant a-forth-constant!
55 value a-forth-value?
create :a-forth-dictionary-entry
0 c, 9 c, 5 c, 7 c, 999999 ,

defer #a-defer-word

: (another-forth-word) ( -- )
    ." Hello world"
;

' (another-forth-word) to #a-defer-word

struct
   9   field   >field1
   5   field   >field2
constant (a-forth-constant


2000 buffer: #some-storage

code assemby-code-word ( dunno what it does )
    g1 g2 mov		\ Move from here to there
    sc2 h# 13 sc2 sllx	\ shift stuff 'round
c;

\ And for the heck of it, redefine a-forth-word.

: a-forth-word ( a b c -- )
    a-forth-word dup 200 > abort" Eek.  The number is too big"
    ." Result is " . cr
;

debug log:

solving ce4069d ...
found ce4069d in https://git.savannah.gnu.org/cgit/emacs.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).