Merge branch 'master' of git://spitspat.com/git/factor into unicode
commit
eda67ed510
|
@ -28,3 +28,8 @@ DEFER: crc32-table inline
|
||||||
>r HEX: ffffffff dup r> [ (crc32) ] each bitxor ;
|
>r HEX: ffffffff dup r> [ (crc32) ] each bitxor ;
|
||||||
|
|
||||||
: file-crc32 ( path -- n ) file-contents crc32 ;
|
: file-crc32 ( path -- n ) file-contents crc32 ;
|
||||||
|
|
||||||
|
: lines-crc32 ( seq -- n )
|
||||||
|
HEX: ffffffff tuck [
|
||||||
|
[ (crc32) ] each CHAR: \n (crc32)
|
||||||
|
] reduce bitxor ;
|
||||||
|
|
|
@ -382,7 +382,7 @@ SYMBOL: parse-hook
|
||||||
dup file set
|
dup file set
|
||||||
source-file-definitions clone old-definitions set
|
source-file-definitions clone old-definitions set
|
||||||
] [ drop ] if
|
] [ drop ] if
|
||||||
contents \ contents set ;
|
lines \ lines set ;
|
||||||
|
|
||||||
: smudged-usage-warning ( usages removed -- )
|
: smudged-usage-warning ( usages removed -- )
|
||||||
parser-notes? [
|
parser-notes? [
|
||||||
|
@ -426,7 +426,7 @@ SYMBOL: parse-hook
|
||||||
file get dup [
|
file get dup [
|
||||||
[ record-form ] keep
|
[ record-form ] keep
|
||||||
[ record-modified ] keep
|
[ record-modified ] keep
|
||||||
[ \ contents get record-checksum ] keep
|
[ \ lines get record-checksum ] keep
|
||||||
record-definitions
|
record-definitions
|
||||||
forget-smudged
|
forget-smudged
|
||||||
] [
|
] [
|
||||||
|
@ -443,7 +443,7 @@ SYMBOL: parse-hook
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
start-parsing
|
start-parsing
|
||||||
\ contents get string-lines parse-fresh
|
\ lines get parse-fresh
|
||||||
dup finish-parsing
|
dup finish-parsing
|
||||||
] [ ] [ undo-parsing ] cleanup
|
] [ ] [ undo-parsing ] cleanup
|
||||||
] no-parse-hook ;
|
] no-parse-hook ;
|
||||||
|
|
|
@ -33,8 +33,8 @@ uses definitions ;
|
||||||
dup source-file-path ?resource-path file-modified
|
dup source-file-path ?resource-path file-modified
|
||||||
swap set-source-file-modified ;
|
swap set-source-file-modified ;
|
||||||
|
|
||||||
: record-checksum ( source-file contents -- )
|
: record-checksum ( source-file lines -- )
|
||||||
crc32 swap set-source-file-checksum ;
|
lines-crc32 swap set-source-file-checksum ;
|
||||||
|
|
||||||
: (xref-source) ( source-file -- pathname uses )
|
: (xref-source) ( source-file -- pathname uses )
|
||||||
dup source-file-path <pathname> swap source-file-uses
|
dup source-file-path <pathname> swap source-file-uses
|
||||||
|
@ -63,7 +63,7 @@ uses definitions ;
|
||||||
: reset-checksums ( -- )
|
: reset-checksums ( -- )
|
||||||
source-files get [
|
source-files get [
|
||||||
swap ?resource-path dup exists?
|
swap ?resource-path dup exists?
|
||||||
[ file-contents record-checksum ] [ 2drop ] if
|
[ file-lines record-checksum ] [ 2drop ] if
|
||||||
] assoc-each ;
|
] assoc-each ;
|
||||||
|
|
||||||
M: pathname where pathname-string 1 2array ;
|
M: pathname where pathname-string 1 2array ;
|
||||||
|
|
|
@ -37,9 +37,9 @@ HINTS: do-line vector string ;
|
||||||
] with-stream ;
|
] with-stream ;
|
||||||
|
|
||||||
: reverse-complement-main ( -- )
|
: reverse-complement-main ( -- )
|
||||||
"reverse-complement-in.txt"
|
"extra/benchmark/reverse-complement/reverse-complement-test-in.txt"
|
||||||
"reverse-complement-out.txt"
|
"extra/benchmark/reverse-complement/reverse-complement-test-out.txt"
|
||||||
[ home swap path+ ] 2apply
|
[ resource-path ] 2apply
|
||||||
reverse-complement ;
|
reverse-complement ;
|
||||||
|
|
||||||
MAIN: reverse-complement-main
|
MAIN: reverse-complement-main
|
||||||
|
|
Loading…
Reference in New Issue