Skip to content
This repository was archived by the owner on Aug 20, 2025. It is now read-only.
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -264,12 +264,21 @@ private void handleStellar(String expression) {
stellarExpression = stellarExpression.trim();
}
}
Object result = executeStellar(stellarExpression);
if(result != null && variable == null) {
writeLine(result.toString());
}
if(variable != null) {
executor.assign(variable, stellarExpression, result);

try {
Object result = executor.execute(stellarExpression);
if (result != null && variable == null) {
writeLine(result.toString());
}
if (variable != null) {
executor.assign(variable, stellarExpression, result);
}
} catch (Throwable t) {
if(variable != null) {
writeLine(String.format("%s ERROR: Variable %s not assigned", ERROR_PROMPT, variable));
}
writeLine(ERROR_PROMPT + t.getMessage());
t.printStackTrace();
}
}

Expand Down Expand Up @@ -352,25 +361,6 @@ private boolean isDoc(String expression) {
return StringUtils.startsWith(expression, DOC_PREFIX);
}

/**
* Executes a Stellar expression.
* @param expression The expression to execute.
* @return The result of the expression.
*/
private Object executeStellar(String expression) {
Object result = null;

try {
result = executor.execute(expression);

} catch(Throwable t) {
writeLine(ERROR_PROMPT + t.getMessage());
t.printStackTrace();
}

return result;
}

private void write(String out) {
System.out.print(out);
}
Expand Down