Merge branch 'master' of git://spitspat.com/git/factor into unicode

db4
Daniel Ehrenberg 2008-01-09 17:22:55 -06:00
commit eda67ed510
6 changed files with 14 additions and 9 deletions

View File

@ -28,3 +28,8 @@ DEFER: crc32-table inline
>r HEX: ffffffff dup r> [ (crc32) ] each bitxor ;
: file-crc32 ( path -- n ) file-contents crc32 ;
: lines-crc32 ( seq -- n )
HEX: ffffffff tuck [
[ (crc32) ] each CHAR: \n (crc32)
] reduce bitxor ;

View File

@ -382,7 +382,7 @@ SYMBOL: parse-hook
dup file set
source-file-definitions clone old-definitions set
] [ drop ] if
contents \ contents set ;
lines \ lines set ;
: smudged-usage-warning ( usages removed -- )
parser-notes? [
@ -426,7 +426,7 @@ SYMBOL: parse-hook
file get dup [
[ record-form ] keep
[ record-modified ] keep
[ \ contents get record-checksum ] keep
[ \ lines get record-checksum ] keep
record-definitions
forget-smudged
] [
@ -443,7 +443,7 @@ SYMBOL: parse-hook
[
[
start-parsing
\ contents get string-lines parse-fresh
\ lines get parse-fresh
dup finish-parsing
] [ ] [ undo-parsing ] cleanup
] no-parse-hook ;

View File

@ -33,8 +33,8 @@ uses definitions ;
dup source-file-path ?resource-path file-modified
swap set-source-file-modified ;
: record-checksum ( source-file contents -- )
crc32 swap set-source-file-checksum ;
: record-checksum ( source-file lines -- )
lines-crc32 swap set-source-file-checksum ;
: (xref-source) ( source-file -- pathname uses )
dup source-file-path <pathname> swap source-file-uses
@ -63,7 +63,7 @@ uses definitions ;
: reset-checksums ( -- )
source-files get [
swap ?resource-path dup exists?
[ file-contents record-checksum ] [ 2drop ] if
[ file-lines record-checksum ] [ 2drop ] if
] assoc-each ;
M: pathname where pathname-string 1 2array ;

View File

@ -37,9 +37,9 @@ HINTS: do-line vector string ;
] with-stream ;
: reverse-complement-main ( -- )
"reverse-complement-in.txt"
"reverse-complement-out.txt"
[ home swap path+ ] 2apply
"extra/benchmark/reverse-complement/reverse-complement-test-in.txt"
"extra/benchmark/reverse-complement/reverse-complement-test-out.txt"
[ resource-path ] 2apply
reverse-complement ;
MAIN: reverse-complement-main