aboutsummaryrefslogtreecommitdiff
path: root/amforth-6.5/examples/rec-name.frt
blob: 39571337bc9e82619eef00fe170bcaa00d9bf6fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

\ #require recognizer.frt
\ #require find-name.frt

\ from forth 2012
:noname name>interpret execute ;
:noname name>compile execute ;
:noname postpone literal ;
recognizer: r:name

\ the parsing word
: rec:name ( addr len -- nt r:name | r:fail)
    find-name ?dup
    if r:name else r:fail then
;

\ replace rec:word with rec:name
\ everthing else should work as before