Skip to content
Merged

Tidy #384

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions runtime/src/main/java/dev/ionfusion/fusion/BaseValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
* <p>
* The following capabilities are aggregated here:
* <ul>
* <li>Annotations</li>
* <li>Checks for nullness, truthiness</li>
* <li>Equality</li>
* <li>Syntax Object construction</li>
Expand Down Expand Up @@ -85,9 +84,10 @@ SyntaxValue makeOriginalSyntax(Evaluator eval, SourceLocation loc)
* is pushed eagerly.
* <p>
* TODO This needs to do cycle detection.
* https://github.com/ion-fusion/fusion-java/issues/65
*
* @return null if something in this datum can't be converted into syntax.
*
* @see <a href="https://github.com/ion-fusion/fusion-java/issues/65">#65</a>
*/
SyntaxValue datumToSyntaxMaybe(Evaluator eval,
SyntaxSymbol context,
Expand Down Expand Up @@ -148,7 +148,9 @@ abstract void write(Evaluator eval, Appendable out)

/**
* Builder for temporary IonWriters needed for {@link #write}ing
* lazily-injected lists and structs.
* lazily injected lists and structs.
*
* @see <a href="https://github.com/ion-fusion/fusion-java/issues/96">#96</a>
*
* @deprecated Try to avoid this.
*/
Expand Down
8 changes: 4 additions & 4 deletions runtime/src/main/java/dev/ionfusion/fusion/FusionList.java
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ abstract static class BaseList
{
/**
* The elements within this list.
*
* <p>
* <b>WARNING!</b> The {@link LazyInjectingList} subclass may mutate
* elements of this list while still appearing immutable. Every method
* that reads from this array MUST be overridden there and properly
Expand Down Expand Up @@ -603,9 +603,10 @@ SyntaxValue makeOriginalSyntax(Evaluator eval, SourceLocation loc)

/**
* TODO This needs to do cycle detection.
* https://github.com/ion-fusion/fusion-java/issues/65
*
* @return null if an element can't be converted into syntax.
*
* @see <a href="https://github.com/ion-fusion/fusion-java/issues/65">#65</a>
*/
@Override
SyntaxValue datumToSyntaxMaybe(Evaluator eval,
Expand Down Expand Up @@ -1067,7 +1068,7 @@ BaseList appendM(Evaluator eval, Object[] args)
@Override
Iterator<?> javaIterate(Evaluator eval)
{
Iterator<Object> iterator = new Iterator<Object>()
return new Iterator<Object>()
{
private int i = 0;

Expand All @@ -1090,7 +1091,6 @@ public void remove()
throw new UnsupportedOperationException();
}
};
return iterator;
}
}

Expand Down
4 changes: 0 additions & 4 deletions runtime/src/main/java/dev/ionfusion/fusion/FusionValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@

package dev.ionfusion.fusion;

import static dev.ionfusion.fusion.FusionSymbol.BaseSymbol.internSymbols;
import static dev.ionfusion.fusion.FusionBool.falseBool;
import static dev.ionfusion.fusion.FusionUtils.EMPTY_OBJECT_ARRAY;
import static dev.ionfusion.fusion.FusionUtils.EMPTY_STRING_ARRAY;

import com.amazon.ion.IonValue;
import com.amazon.ion.ValueFactory;
import dev.ionfusion.fusion.FusionSymbol.BaseSymbol;
import dev.ionfusion.fusion.FusionBool.BaseBool;
import dev.ionfusion.fusion.FusionSymbol.BaseSymbol;
import java.io.IOException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

/**
* Extended prepare-time {@link Namespace} that knows it's a module.
* This exists to create special bindings that can refer module variables that
* This exists to create special bindings that can refer to module variables that
* are not exported (but that are accessible through macro-generated code).
*/
final class ModuleNamespace
Expand Down Expand Up @@ -433,7 +433,7 @@ Binding resolveMaybe(BaseSymbol name,


/**
* Helper to work-around inability of constructors to invoke virtual methods.
* Helper to work around inability of constructors to invoke virtual methods.
*/
private static final Function<Namespace, SyntaxWraps> MAKE_SYNTAX_WRAPS =
new Function<Namespace, SyntaxWraps>() {
Expand Down Expand Up @@ -499,8 +499,7 @@ public SyntaxWraps apply(Namespace ns)


/**
* Constructs a module that uses no other module. Any bindings will need to
* be created via {@link #bind(String, Object)}.
* Constructs a module that uses no other module.
*
* @param moduleId identifies this module.
*/
Expand Down Expand Up @@ -592,7 +591,7 @@ public Object doEval(Evaluator eval, Store store)


/**
* A reference to a module-level variable in the lexically-enclosing
* A reference to a module-level variable in the lexically enclosing
* namespace.
*/
static final class CompiledModuleVariableReference
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/main/java/dev/ionfusion/fusion/Namespace.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,8 +672,8 @@ void attachModule(Evaluator eval, Namespace srcNamespace, String modulePath)
ModuleNameResolver resolver = eval.findResolver();

// Resolve the path WRT the *source* registry, so we can locate
// manually-declared modules loaded into it.
// See the file rkt/ns-attach.rkt for demonstration test case.
// manually declared modules loaded into it.
// See the file rkt/ns-attach.rkt for a demonstration test case.
eval = eval.parameterizeCurrentNamespace(srcNamespace);

ModuleIdentity id =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package dev.ionfusion.fusion;

import static com.amazon.ion.IntegerSize.BIG_INTEGER;
import static dev.ionfusion.fusion.FusionBool.makeBool;
import static dev.ionfusion.fusion.FusionList.immutableList;
import static dev.ionfusion.fusion.FusionList.nullList;
Expand All @@ -17,16 +18,16 @@
import static dev.ionfusion.fusion.FusionTimestamp.makeTimestamp;
import static dev.ionfusion.fusion.SourceLocation.forCurrentSpan;
import static dev.ionfusion.fusion.SyntaxValue.STX_PROPERTY_ORIGINAL;
import static com.amazon.ion.IntegerSize.BIG_INTEGER;
import static java.lang.Boolean.TRUE;
import dev.ionfusion.fusion.FusionList.BaseList;
import dev.ionfusion.fusion.FusionSexp.BaseSexp;

import com.amazon.ion.Decimal;
import com.amazon.ion.IntegerSize;
import com.amazon.ion.IonException;
import com.amazon.ion.IonReader;
import com.amazon.ion.IonType;
import com.amazon.ion.Timestamp;
import dev.ionfusion.fusion.FusionList.BaseList;
import dev.ionfusion.fusion.FusionSexp.BaseSexp;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
Expand Down