delocalise apply-rule

db4
Chris Double 2008-04-05 01:56:37 +13:00
parent 970f0055c2
commit a4700e072e
1 changed files with 6 additions and 10 deletions

View File

@ -188,16 +188,12 @@ C: <head> peg-head
m ans>>
] if ;
:: apply-rule ( r p -- ast )
[let* |
m [ r p recall ]
|
m [
r m apply-memo-rule
: apply-rule ( r p -- ast )
2dup recall [
nip apply-memo-rule
] [
r p apply-non-memo-rule
] if
] ; inline
apply-non-memo-rule
] if* ; inline
: with-packrat ( input quot -- result )
#! Run the quotation with a packrat cache active.