Merge branch 'master' of git://factorcode.org/git/factor

db4
Doug Coleman 2008-02-11 17:19:40 -06:00
commit 36d1cae83e
6 changed files with 48 additions and 77 deletions

View File

@ -13,3 +13,7 @@ namespaces alien.c-types kernel system combinators ;
} cond } cond
T{ ppc-backend } compiler-backend set-global T{ ppc-backend } compiler-backend set-global
macosx? [
4 "double" c-type set-c-type-align
] when

View File

@ -261,9 +261,9 @@ windows? [
cell "ulonglong" c-type set-c-type-align cell "ulonglong" c-type set-c-type-align
] unless ] unless
macosx? [ windows? [
cell "double" c-type set-c-type-align 4 "double" c-type set-c-type-align
] when ] unless
T{ x86-backend f 4 } compiler-backend set-global T{ x86-backend f 4 } compiler-backend set-global

View File

@ -155,20 +155,21 @@ SYMBOL: load-help?
dup first vocab-heading. dup first vocab-heading.
dup second print-error dup second print-error
drop ; drop ;
! third "Traceback" swap write-object ;
: load-failures. ( failures -- ) : load-failures. ( failures -- )
[ load-error. nl ] each ; [ load-error. nl ] each ;
SYMBOL: blacklist
: require-all ( vocabs -- failures ) : require-all ( vocabs -- failures )
[ [
V{ } clone blacklist set
[ [
[ [ require ]
[ require ] [ >r vocab-name r> 2array blacklist get push ]
[ error-continuation get 3array , ] recover
recover ] each
] each blacklist get
] { } make
] with-compiler-errors ; ] with-compiler-errors ;
: do-refresh ( modified-sources modified-docs -- ) : do-refresh ( modified-sources modified-docs -- )
@ -182,7 +183,7 @@ SYMBOL: load-help?
: refresh-all ( -- ) "" refresh ; : refresh-all ( -- ) "" refresh ;
GENERIC: (load-vocab) ( name -- vocab ) GENERIC: (load-vocab) ( name -- vocab )
!
M: vocab (load-vocab) M: vocab (load-vocab)
dup vocab-root [ dup vocab-root [
dup vocab-source-loaded? [ dup load-source ] unless dup vocab-source-loaded? [ dup load-source ] unless
@ -195,8 +196,25 @@ M: string (load-vocab)
M: vocab-link (load-vocab) M: vocab-link (load-vocab)
vocab-name (load-vocab) ; vocab-name (load-vocab) ;
[ [ dup vocab [ ] [ ] ?if (load-vocab) ] with-compiler-errors ] TUPLE: blacklisted-vocab name ;
load-vocab-hook set-global
: blacklisted-vocab ( name -- * )
\ blacklisted-vocab construct-boa throw ;
M: blacklisted-vocab error.
"This vocabulary depends on the " write
blacklisted-vocab-name write
" vocabulary which failed to load" print ;
[
dup vocab-name blacklist get key? [
vocab-name blacklisted-vocab
] [
[
dup vocab [ ] [ ] ?if (load-vocab)
] with-compiler-errors
] if
] load-vocab-hook set-global
: vocab-where ( vocab -- loc ) : vocab-where ( vocab -- loc )
vocab-source-path dup [ 1 2array ] when ; vocab-source-path dup [ 1 2array ] when ;

View File

@ -12,18 +12,21 @@ IN: money
"$" % "$" %
swap number>string swap number>string
<reversed> 3 group "," join <reversed> % <reversed> 3 group "," join <reversed> %
"." % number>string 2 48 pad-left % "." % number>string 2 CHAR: 0 pad-left %
] "" make print ; ] "" make print ;
TUPLE: not-a-decimal ; TUPLE: not-a-decimal ;
: DECIMAL:
scan : not-a-decimal ( -- * )
"." split dup length 1 2 between? [ T{ not-a-decimal } throw ;
T{ not-a-decimal } throw
] unless : parse-decimal ( str -- ratio )
?first2 "." split1
>r dup ?first CHAR: - = [ drop t "0" ] [ f swap ] if r> >r dup "-" head? [ drop t "0" ] [ f swap ] if r>
[ dup empty? [ drop "0" ] when ] 2apply [ dup empty? [ drop "0" ] when ] 2apply
dup length dup length
>r [ string>number dup [ T{ not-a-decimal } throw ] unless ] 2apply r> >r [ string>number dup [ not-a-decimal ] unless ] 2apply r>
10 swap ^ / + swap [ neg ] when parsed ; parsing 10 swap ^ / + swap [ neg ] when ;
: DECIMAL:
scan parse-decimal parsed ; parsing

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
puts factor_eval(STDIN.read)</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^E</string>
<key>name</key>
<string>Eval Selection/Line</string>
<key>output</key>
<string>replaceSelectedText</string>
<key>scope</key>
<string>source.factor</string>
<key>uuid</key>
<string>8E01DDAF-959B-4237-ADB9-C133A4ACCE90</string>
</dict>
</plist>

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/env ruby
require "#{ENV["TM_BUNDLE_SUPPORT"]}/lib/tm_factor"
factor_run(STDIN.read)</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
<key>keyEquivalent</key>
<string>^~e</string>
<key>name</key>
<string>Run Selection/Line in Listener</string>
<key>output</key>
<string>discard</string>
<key>scope</key>
<string>source.factor</string>
<key>uuid</key>
<string>15A984BD-BC65-43E8-878A-267788C8DA70</string>
</dict>
</plist>