Skip to content
Merged
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
4 changes: 2 additions & 2 deletions runtime/src/main/java/dev/ionfusion/fusion/ProvideForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ private void expandProvideSexp(Evaluator eval,
// but is needed for syntax analysis and origin tracking.
SyntaxSymbol allDefinedSym =
syntaxTrackOrigin(eval,
SyntaxSymbol.make(specId.getLocation(),
SyntaxSymbol.make(specId.getPosition(),
makeSymbol(eval, "all_defined")),
specForm, specId);
expanded.add(specForm.copyReplacingChildren(eval, allDefinedSym));
Expand Down Expand Up @@ -180,7 +180,7 @@ else if (b == globalState.myKernelRenameOutBinding)

SyntaxSymbol renameSym =
syntaxTrackOrigin(eval,
SyntaxSymbol.make(specId.getLocation(),
SyntaxSymbol.make(specId.getPosition(),
makeSymbol(eval, "rename")),
specForm, specId);

Expand Down
4 changes: 2 additions & 2 deletions runtime/src/main/java/dev/ionfusion/fusion/RequireForm.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private SyntaxSymbol expandRequireSpecNameToPrimitiveImportName(Evaluator eval,
{
SyntaxSymbol specId = spec.firstIdentifier(eval);
return syntaxTrackOrigin(eval,
SyntaxSymbol.make(specId.getLocation(),
SyntaxSymbol.make(specId.getPosition(),
makeSymbol(eval, primitiveImportName)),
spec,
specId);
Expand Down Expand Up @@ -320,7 +320,7 @@ private CompiledRequireSpec compileSpec(Evaluator eval,
FusionSymbol.BaseSymbol name = id.getName();

// Mint a fresh identifier with only the context from the module path.
SyntaxSymbol localId = SyntaxSymbol.make(id.getLocation(), name);
SyntaxSymbol localId = SyntaxSymbol.make(id.getPosition(), name);
localId = (SyntaxSymbol) Syntax.applyContext(eval, context, localId);

mappings[i] = new RequireRenameMapping(localId, name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Object visit(Visitor v) throws FusionException
@Override
SyntaxValue copyReplacingProperties(Object[] properties)
{
return new SimpleSyntaxValue(getLocation(), properties, myDatum);
return new SimpleSyntaxValue(getPosition(), properties, myDatum);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ static SyntaxKeyword make(Evaluator eval, ResourcePosition pos, BaseSymbol symbo
SyntaxKeyword copyReplacingWraps(SyntaxWraps wraps)
{
return new SyntaxKeyword(wraps,
getLocation(),
getPosition(),
getProperties(),
(BaseSymbol) myDatum);
}
Expand All @@ -69,7 +69,7 @@ SyntaxKeyword copyReplacingWraps(SyntaxWraps wraps)
SyntaxKeyword copyReplacingProperties(Object[] properties)
{
return new SyntaxKeyword(myWraps,
getLocation(),
getPosition(),
properties,
(BaseSymbol) myDatum);
}
Expand Down
10 changes: 4 additions & 6 deletions runtime/src/main/java/dev/ionfusion/fusion/SyntaxList.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,20 @@ SyntaxList copyReplacingChildren(Evaluator eval,
BaseList datum = (children == null
? nullList(eval, annotations)
: immutableList(eval, annotations, children));
return new SyntaxList(getLocation(), getProperties(), myWraps, datum);
return new SyntaxList(getPosition(), getProperties(), myWraps, datum);
}


@Override
SyntaxList copyReplacingProperties(Object[] properties)
{
return new SyntaxList(getLocation(), properties, myWraps,
myImmutableList);
return new SyntaxList(getPosition(), properties, myWraps, myImmutableList);
}

@Override
SyntaxList copyReplacingWraps(SyntaxWraps wraps)
{
return new SyntaxList(getLocation(), getProperties(), wraps,
myImmutableList);
return new SyntaxList(getPosition(), getProperties(), wraps, myImmutableList);
}


Expand Down Expand Up @@ -163,7 +161,7 @@ SyntaxSequence stripWraps(Evaluator eval)

BaseSymbol[] annotations = myImmutableList.getAnnotations();
BaseList newList = immutableList(eval, annotations, children);
return new SyntaxList(getLocation(), getProperties(), null, newList);
return new SyntaxList(getPosition(), getProperties(), null, newList);
}


Expand Down
8 changes: 4 additions & 4 deletions runtime/src/main/java/dev/ionfusion/fusion/SyntaxSexp.java
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,14 @@ SyntaxSexp copyReplacingChildren(Evaluator eval,
BaseSexp datum = (children == null
? nullSexp(eval, annotations)
: immutableSexp(eval, annotations, children));
return new SyntaxSexp(getLocation(), getProperties(), myWraps, datum);
return new SyntaxSexp(getPosition(), getProperties(), myWraps, datum);
}


@Override
SyntaxSexp copyReplacingProperties(Object[] properties)
{
return new SyntaxSexp(getLocation(), properties, myWraps, mySexp);
return new SyntaxSexp(getPosition(), properties, myWraps, mySexp);
}


Expand All @@ -151,7 +151,7 @@ SyntaxSexp copyReplacingWraps(SyntaxWraps wraps)
throws FusionException
{
assert ! hasNoChildren() && wraps != null;
return new SyntaxSexp(getLocation(), getProperties(), wraps, mySexp);
return new SyntaxSexp(getPosition(), getProperties(), wraps, mySexp);
}


Expand Down Expand Up @@ -289,7 +289,7 @@ SyntaxSequence stripWraps(Evaluator eval)
if (hasNoChildren()) return this; // No children, no marks, all okay!

BaseSexp newSexp = stripWraps(eval, (ImmutablePair) mySexp);
return new SyntaxSexp(getLocation(), getProperties(), null, newSexp);
return new SyntaxSexp(getPosition(), getProperties(), null, newSexp);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static SyntaxString make(Evaluator eval,
SyntaxString copyReplacingWraps(SyntaxWraps wraps)
{
return new SyntaxString(wraps,
getLocation(),
getPosition(),
getProperties(),
(BaseString) myDatum);
}
Expand All @@ -50,7 +50,7 @@ SyntaxString copyReplacingWraps(SyntaxWraps wraps)
SyntaxString copyReplacingProperties(Object[] properties)
{
return new SyntaxString(myWraps,
getLocation(),
getPosition(),
properties,
(BaseString) myDatum);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ boolean hasNoChildren()
@Override
SyntaxStruct copyReplacingProperties(Object[] properties)
{
return new SyntaxStruct(getLocation(), properties, myWraps, myStruct);
return new SyntaxStruct(getPosition(), properties, myWraps, myStruct);
}

@Override
SyntaxStruct copyReplacingWraps(SyntaxWraps wraps)
{
return new SyntaxStruct(getLocation(), getProperties(), wraps,
myStruct);
return new SyntaxStruct(getPosition(), getProperties(), wraps, myStruct);
}


Expand All @@ -105,7 +104,7 @@ public Object visit(String name, Object value)
ImmutableStruct s = myStruct.transformFields(eval, visitor);
if (s == myStruct) return this;

return new SyntaxStruct(getLocation(), getProperties(), null, s);
return new SyntaxStruct(getPosition(), getProperties(), null, s);
}


Expand Down Expand Up @@ -199,7 +198,7 @@ public Object visit(String name, Object value)
ImmutableStruct s = myStruct.transformFields(eval, visitor);

// Wraps have been pushed down so the copy doesn't need them.
return new SyntaxStruct(getLocation(), s);
return new SyntaxStruct(getPosition(), s);
}


Expand Down
11 changes: 4 additions & 7 deletions runtime/src/main/java/dev/ionfusion/fusion/SyntaxSymbol.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,8 @@ Object visit(Visitor v) throws FusionException
@Override
SyntaxSymbol copyReplacingProperties(Object[] properties)
{
SyntaxSymbol id = new SyntaxSymbol(myWraps,
getLocation(),
properties,
getName());
SyntaxSymbol id =
new SyntaxSymbol(myWraps, getPosition(), properties, getName());
id.myBoundId = myBoundId;
return id;
}
Expand All @@ -121,15 +119,14 @@ SyntaxSymbol copyReplacingWraps(SyntaxWraps wraps)
{
// We intentionally don't copy the binding, since the wraps are
// probably different, so the binding may be different.
return new SyntaxSymbol(wraps, getLocation(), getProperties(), getName());
return new SyntaxSymbol(wraps, getPosition(), getProperties(), getName());
}


SyntaxSymbol copyReplacingBinding(Binding binding)
{
SyntaxSymbol copy =
new SyntaxSymbol(myWraps, getLocation(), getProperties(),
getName());
new SyntaxSymbol(myWraps, getPosition(), getProperties(), getName());
copy.myBoundId = uncachedResolveBoundIdentifier().copyReplacingBinding(binding);
return copy;
}
Expand Down
Loading