Skip to content

Commit

Permalink
ExecutionEnv file formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
FourteenBrush committed Jun 10, 2024
1 parent 1eb57c5 commit 46fb491
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@ private ExecutionEnv() {
}

/**
* Creates an empty {@link ExecutionEnv}, no symbols are bound.
* @return an empty {@link ExecutionEnv}, no symbols are bound.
*/
public static ExecutionEnv empty() {
return new ExecutionEnv();
}

/**
*
* @return a {@link ExecutionEnv} populated with all default symbols.
*/
@ApiStatus.Experimental
public static ExecutionEnv createDefault() {
// delegate to BuiltinSymbols to not clutter this class
// delegate to BuiltinSymbols to not clutter up this class
return BuiltinSymbols.createExecutionEnv();
}

Expand Down Expand Up @@ -87,17 +86,19 @@ public void insertFunction(String name, int numArgs, ToDoubleFunction<FunctionCo

/**
* Inserts a function with a certain amount of parameters, which correspond to parameters in the function context.
* @param name the function name
*
* @param name the function name
* @param minArgs the minimum amount of arguments
* @param maxArgs the maximum amount of arguments
* @param fn the function
* @param fn the function
*/
public void insertFunction(String name, int minArgs, int maxArgs, ToDoubleFunction<FunctionContext> fn) {
insertSymbol(new FunctionCallSite(name, minArgs, maxArgs, fn));
}

/**
* Inserts a symbol into this environment.
*
* @param symbol the symbol to be inserted.
* @throws SyntaxException if the symbol was already inserted, either as a function or as a variable.
*/
Expand All @@ -107,6 +108,7 @@ public void insertSymbol(Symbol symbol) {

/**
* Looks up a symbol based on an input
*
* @param buf the input as a char array
* @param pos the position to start searching at
* @return the found symbol
Expand Down

0 comments on commit 46fb491

Please sign in to comment.