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>> m ans>>
] if ; ] if ;
:: apply-rule ( r p -- ast ) : apply-rule ( r p -- ast )
[let* | 2dup recall [
m [ r p recall ] nip apply-memo-rule
|
m [
r m apply-memo-rule
] [ ] [
r p apply-non-memo-rule apply-non-memo-rule
] if ] if* ; inline
] ; inline
: with-packrat ( input quot -- result ) : with-packrat ( input quot -- result )
#! Run the quotation with a packrat cache active. #! Run the quotation with a packrat cache active.