Merge branch 'master' of git://factorcode.org/git/factor
commit
36d1cae83e
|
@ -13,3 +13,7 @@ namespaces alien.c-types kernel system combinators ;
|
|||
} cond
|
||||
|
||||
T{ ppc-backend } compiler-backend set-global
|
||||
|
||||
macosx? [
|
||||
4 "double" c-type set-c-type-align
|
||||
] when
|
||||
|
|
|
@ -261,9 +261,9 @@ windows? [
|
|||
cell "ulonglong" c-type set-c-type-align
|
||||
] unless
|
||||
|
||||
macosx? [
|
||||
cell "double" c-type set-c-type-align
|
||||
] when
|
||||
windows? [
|
||||
4 "double" c-type set-c-type-align
|
||||
] unless
|
||||
|
||||
T{ x86-backend f 4 } compiler-backend set-global
|
||||
|
||||
|
|
|
@ -155,20 +155,21 @@ SYMBOL: load-help?
|
|||
dup first vocab-heading.
|
||||
dup second print-error
|
||||
drop ;
|
||||
! third "Traceback" swap write-object ;
|
||||
|
||||
: load-failures. ( failures -- )
|
||||
[ load-error. nl ] each ;
|
||||
|
||||
SYMBOL: blacklist
|
||||
|
||||
: require-all ( vocabs -- failures )
|
||||
[
|
||||
V{ } clone blacklist set
|
||||
[
|
||||
[
|
||||
[ require ]
|
||||
[ error-continuation get 3array , ]
|
||||
recover
|
||||
] each
|
||||
] { } make
|
||||
[ require ]
|
||||
[ >r vocab-name r> 2array blacklist get push ]
|
||||
recover
|
||||
] each
|
||||
blacklist get
|
||||
] with-compiler-errors ;
|
||||
|
||||
: do-refresh ( modified-sources modified-docs -- )
|
||||
|
@ -182,7 +183,7 @@ SYMBOL: load-help?
|
|||
: refresh-all ( -- ) "" refresh ;
|
||||
|
||||
GENERIC: (load-vocab) ( name -- vocab )
|
||||
|
||||
!
|
||||
M: vocab (load-vocab)
|
||||
dup vocab-root [
|
||||
dup vocab-source-loaded? [ dup load-source ] unless
|
||||
|
@ -195,8 +196,25 @@ M: string (load-vocab)
|
|||
M: vocab-link (load-vocab)
|
||||
vocab-name (load-vocab) ;
|
||||
|
||||
[ [ dup vocab [ ] [ ] ?if (load-vocab) ] with-compiler-errors ]
|
||||
load-vocab-hook set-global
|
||||
TUPLE: blacklisted-vocab name ;
|
||||
|
||||
: 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-source-path dup [ 1 2array ] when ;
|
||||
|
|
|
@ -12,18 +12,21 @@ IN: money
|
|||
"$" %
|
||||
swap number>string
|
||||
<reversed> 3 group "," join <reversed> %
|
||||
"." % number>string 2 48 pad-left %
|
||||
"." % number>string 2 CHAR: 0 pad-left %
|
||||
] "" make print ;
|
||||
|
||||
TUPLE: not-a-decimal ;
|
||||
: DECIMAL:
|
||||
scan
|
||||
"." split dup length 1 2 between? [
|
||||
T{ not-a-decimal } throw
|
||||
] unless
|
||||
?first2
|
||||
>r dup ?first CHAR: - = [ drop t "0" ] [ f swap ] if r>
|
||||
|
||||
: not-a-decimal ( -- * )
|
||||
T{ not-a-decimal } throw ;
|
||||
|
||||
: parse-decimal ( str -- ratio )
|
||||
"." split1
|
||||
>r dup "-" head? [ drop t "0" ] [ f swap ] if r>
|
||||
[ dup empty? [ drop "0" ] when ] 2apply
|
||||
dup length
|
||||
>r [ string>number dup [ T{ not-a-decimal } throw ] unless ] 2apply r>
|
||||
10 swap ^ / + swap [ neg ] when parsed ; parsing
|
||||
>r [ string>number dup [ not-a-decimal ] unless ] 2apply r>
|
||||
10 swap ^ / + swap [ neg ] when ;
|
||||
|
||||
: DECIMAL:
|
||||
scan parse-decimal parsed ; parsing
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue