fix millis; fix <resource-stream>
parent
fa29a1cbad
commit
9d9643850e
|
@ -1,7 +1,5 @@
|
|||
- move <resource-stream> from parser
|
||||
- quit responder breaks with multithreading
|
||||
- nicer way to combine two paths
|
||||
- -1.1 3 ^ shouldn't give a complex number
|
||||
- don't show listener on certain commands
|
||||
- plugin should not exit jEdit on fatal errors
|
||||
- wordpreview: don't show for string literals and comments
|
||||
|
@ -11,7 +9,6 @@
|
|||
- introduce ifte* and ?str-head/?str-tail where appropriate
|
||||
- namespace clone drops static var bindings
|
||||
- solaris: -lsocket -lnsl
|
||||
- unparsing: \u000c
|
||||
|
||||
+ bignums:
|
||||
|
||||
|
@ -49,8 +46,6 @@
|
|||
|
||||
- NPE in activate()/deactivate()
|
||||
- NPE in ErrorHighlight
|
||||
- caret at start of word: problem
|
||||
- don't use jEdit's word finding API
|
||||
- some way to not have previous definitions from a source file
|
||||
clutter the namespace
|
||||
- use inferior.factor for everything not just listener
|
||||
|
|
|
@ -43,10 +43,6 @@ public class ReadTable
|
|||
|
||||
DEFAULT_READTABLE.setCharacterType('\t',ReadTable.WHITESPACE);
|
||||
DEFAULT_READTABLE.setCharacterType('\n',ReadTable.WHITESPACE);
|
||||
|
||||
// ^L
|
||||
DEFAULT_READTABLE.setCharacterType((char)12,ReadTable.WHITESPACE);
|
||||
|
||||
DEFAULT_READTABLE.setCharacterType('\r',ReadTable.WHITESPACE);
|
||||
DEFAULT_READTABLE.setCharacterType(' ',ReadTable.WHITESPACE);
|
||||
|
||||
|
|
|
@ -210,13 +210,40 @@ public class FactorPlugin extends EditPlugin
|
|||
if(caret == line.length())
|
||||
caret--;
|
||||
|
||||
String noWordSep = textArea.getBuffer().getStringProperty(
|
||||
"noWordSep");
|
||||
int wordStart = TextUtilities.findWordStart(line,caret,
|
||||
noWordSep);
|
||||
int wordEnd = TextUtilities.findWordEnd(line,caret,
|
||||
noWordSep);
|
||||
return line.substring(wordStart,wordEnd);
|
||||
ReadTable readtable = ReadTable.DEFAULT_READTABLE;
|
||||
|
||||
if(readtable.getCharacterType(line.charAt(caret))
|
||||
== ReadTable.WHITESPACE)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int start = caret;
|
||||
while(start > 0)
|
||||
{
|
||||
if(readtable.getCharacterType(line.charAt(start - 1))
|
||||
== ReadTable.WHITESPACE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
start--;
|
||||
}
|
||||
|
||||
int end = caret;
|
||||
do
|
||||
{
|
||||
if(readtable.getCharacterType(line.charAt(end))
|
||||
== ReadTable.WHITESPACE)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
end++;
|
||||
}
|
||||
while(end < line.length());
|
||||
|
||||
return line.substring(start,end);
|
||||
} //}}}
|
||||
|
||||
//{{{ showStatus() method
|
||||
|
|
|
@ -34,6 +34,7 @@ USE: stack
|
|||
|
||||
! Power-related functions:
|
||||
! exp log sqrt pow
|
||||
USE: logic
|
||||
|
||||
: exp >rect swap fexp swap polar> ;
|
||||
: log >polar swap flog swap rect> ;
|
||||
|
@ -52,4 +53,8 @@ USE: stack
|
|||
[ [ >rect ] dip flog * swap ] dip * + ;
|
||||
|
||||
: ^ ( z w -- z^w )
|
||||
swap >polar 3dup ^theta [ ^mag ] dip polar> ;
|
||||
over real? over integer? and [
|
||||
fpow
|
||||
] [
|
||||
swap >polar 3dup ^theta >r ^mag r> polar>
|
||||
] ifte ;
|
||||
|
|
|
@ -39,13 +39,10 @@ USE: strings
|
|||
: run-file ( path -- )
|
||||
parse-file call ;
|
||||
|
||||
: <resource-stream> ( path -- stream )
|
||||
<rreader> f <char-stream> ;
|
||||
|
||||
: parse-resource* ( resource -- list )
|
||||
dup <rreader> swap "resource:" swap cat2 swap parse-stream ;
|
||||
|
||||
: parse-resource ( file -- )
|
||||
: parse-resource ( resource -- list )
|
||||
#! Override this to be slightly more useful for development.
|
||||
global [ "resource-path" get ] bind dup [
|
||||
swap cat2 parse-file
|
||||
|
|
|
@ -254,3 +254,6 @@ USE: strings
|
|||
#! Accept a connection from a server socket.
|
||||
[ "socket" get ] bind
|
||||
[ ] "java.net.ServerSocket" "accept" jinvoke <socket-stream> ;
|
||||
|
||||
: <resource-stream> ( path -- stream )
|
||||
<rreader> f <char-stream> ;
|
||||
|
|
|
@ -96,12 +96,6 @@ USE: strings
|
|||
#! the current interactive interpreter.
|
||||
(parse-file) call ;
|
||||
|
||||
: resource-path ( -- path )
|
||||
"resource-path" get [ "." ] unless* ;
|
||||
|
||||
: <resource-stream> ( path -- stream )
|
||||
resource-path swap cat2 <filecr> ;
|
||||
|
||||
: parse-resource ( path -- quot )
|
||||
#! Resources are loaded from the resource-path variable, or
|
||||
#! the current directory if it is not set. Words defined in
|
||||
|
|
|
@ -90,3 +90,9 @@ USE: namespaces
|
|||
#! Copy the contents of the fd-stream 'from' to the
|
||||
#! fd-stream 'to'.
|
||||
[ 2dup (fcopy) ] [ -rot fclose fclose rethrow ] catch ;
|
||||
|
||||
: resource-path ( -- path )
|
||||
"resource-path" get [ "." ] unless* ;
|
||||
|
||||
: <resource-stream> ( path -- stream )
|
||||
resource-path swap cat2 <filecr> ;
|
||||
|
|
|
@ -24,8 +24,8 @@ void primitive_millis(void)
|
|||
{
|
||||
struct timeval t;
|
||||
gettimeofday(&t,NULL);
|
||||
dpush(tag_object(s48_long_to_bignum(
|
||||
t.tv_sec * 1000 + t.tv_usec/1000)));
|
||||
dpush(tag_object(s48_long_long_to_bignum(
|
||||
(long long)t.tv_sec * 1000 + t.tv_usec/1000)));
|
||||
}
|
||||
|
||||
void primitive_init_random(void)
|
||||
|
|
Loading…
Reference in New Issue