better plugin tools

cvs
Slava Pestov 2005-01-24 02:53:55 +00:00
parent af40535556
commit 4a6f404cc2
5 changed files with 15 additions and 29 deletions

View File

@ -27,12 +27,10 @@
+ listener/plugin:
- update plugin docs
- extract word puts stuff in the wrong place
- extract word keeps indent
- word preview for remote words
- WordPreview calls markTokens() -> NPE
- listener should be multithreaded
- compile all commands
- faster completion
- NPE in ErrorHighlight
- maple-like: press enter at old commands to evaluate there

View File

@ -94,16 +94,12 @@
</ACTION>
<ACTION NAME="factor-infer-effects">
<CODE>
InferBufferProcessor.createInferUnitTests(view,buffer,
FactorPlugin.getExternalInstance());
InferBufferProcessor.createInferUnitTests(view,buffer);
</CODE>
</ACTION>
<ACTION NAME="factor-compile-all">
<CODE>
wm.showDockableWindow("console");
CompileBufferProcessor.compileWordsInBuffer(view,buffer,
FactorPlugin.getExternalInstance(),
wm.getDockableWindow("console"));
new CompileBufferProcessor(view,buffer);
</CODE>
</ACTION>
</ACTIONS>

View File

@ -38,22 +38,11 @@ import org.gjt.sp.util.*;
public class CompileBufferProcessor extends FactorBufferProcessor
{
//{{{ compileWordsInBuffer() method
public static void compileWordsInBuffer(View view,
Buffer buffer,
ExternalFactor factor,
Output output) throws Exception
{
String results = new CompileBufferProcessor(
buffer,factor).getResults();
output.print(null,results);
} //}}}
//{{{ CompileBufferProcessor constructor
public CompileBufferProcessor(Buffer buffer, ExternalFactor factor)
public CompileBufferProcessor(View view, Buffer buffer)
throws Exception
{
super(buffer,factor);
super(view,buffer,true);
} //}}}
//{{{ processWord() method

View File

@ -31,6 +31,7 @@ package factor.jedit;
import factor.*;
import org.gjt.sp.jedit.Buffer;
import org.gjt.sp.jedit.View;
/**
* A class used to compile all words in a file, or infer stack effects of all
@ -41,8 +42,8 @@ public abstract class FactorBufferProcessor
private String results;
//{{{ FactorBufferProcessor constructor
public FactorBufferProcessor(Buffer buffer, ExternalFactor factor)
throws Exception
public FactorBufferProcessor(View view, Buffer buffer,
boolean evalInListener) throws Exception
{
StringBuffer buf = new StringBuffer();
@ -56,7 +57,10 @@ public abstract class FactorBufferProcessor
buf.append("! ");
buf.append(expr);
buf.append('\n');
buf.append(factor.eval(expr));
if(evalInListener)
FactorPlugin.evalInListener(view,expr);
else
buf.append(FactorPlugin.evalInWire(expr));
words = words.next();
}

View File

@ -44,11 +44,10 @@ public class InferBufferProcessor extends FactorBufferProcessor
{
//{{{ createInferUnitTests() method
public static void createInferUnitTests(View view,
final Buffer buffer,
final ExternalFactor factor)
final Buffer buffer)
throws Exception
{
final String results = new InferBufferProcessor(buffer,factor)
final String results = new InferBufferProcessor(view,buffer)
.getResults();
final Buffer newBuffer = jEdit.newFile(view);
@ -70,10 +69,10 @@ public class InferBufferProcessor extends FactorBufferProcessor
} //}}}
//{{{ InferBufferProcessor constructor
public InferBufferProcessor(Buffer buffer, ExternalFactor factor)
public InferBufferProcessor(View view, Buffer buffer)
throws Exception
{
super(buffer,factor);
super(view,buffer,false);
} //}}}
//{{{ processWord() method