Skip to content
Open
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
7 changes: 1 addition & 6 deletions Config/b_star_interpreter/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,5 @@ def Expression(block: bstarparser.Property, codebase):


def findFunction(name: str, codebase): # -> Union[Callable[[List, Codebase], None], List[str]]:
# This tries to find a user-made function first, then tries the built-in ones.
functionWanted = globals.codebase.functions[name]
# if functionWanted is None:
# functionWanted = Commands.src.interpreter.tempFunctionsFile.functions.get(name)

return functionWanted
return globals.codebase.functions[name]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function findFunction refactored with the following changes:

This removes the following comments ( why? ):

# if functionWanted is None:
#     functionWanted = Commands.src.interpreter.tempFunctionsFile.functions.get(name)
# This tries to find a user-made function first, then tries the built-in ones.


2 changes: 1 addition & 1 deletion Config/b_star_interpreter/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Returns true if the value is not "None" or "Infinite"
def isUniqueValue(value: Any):
return False if value is (None or math.inf) else True
return value is not (None or math.inf)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function isUniqueValue refactored with the following changes:



class Function:
Expand Down
2 changes: 1 addition & 1 deletion Config/b_star_interpreter/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def runCodeSandbox(code: Tree, user: Union[discord.User, None] = None, arguments
globals.codebase = Codebase(parsed_code, user, arguments)
globals.codebase.functions = globals.codebase.functions | functions

for i, statement in enumerate(parsed_code):
for statement in parsed_code:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function runCodeSandbox refactored with the following changes:

globals.codebase.output += "\n"

try:
Expand Down