Skip to content

Commit

Permalink
feat: ⏪ Narsese Automatic Analytic Simplification is now off by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ARCJ137442 committed Oct 27, 2023
1 parent 6344911 commit 99ef061
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pynars/ConsolePlus.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ def execution_F(arguments: Iterable[Term], task: Task=None, memory: Memory=None)
def toggle_simplify_parse() -> None:
'''Toggle the "automatic shorthand parsing" function of the cmd (enabled by default),
If so, the Narsese input are automatically parsed in a simplified format'''
global _parse_need_slash
_parse_need_slash = not _parse_need_slash
global _parse_simplification
_parse_simplification = not _parse_simplification
print(
f'Narsese automatic analytic simplification {"closed" if _parse_need_slash else "opened"}.')
f'Narsese automatic analytic simplification {"closed" if _parse_simplification else "opened"}.')


@cmd_register('help')
Expand Down Expand Up @@ -680,8 +680,8 @@ async def main():

# Total index and other variables #

_parse_need_slash: bool = False
'Determines whether the last input is a command'
_parse_simplification: bool = False
'Determines whether the "Narsese automatic analytic simplification" enabled'

input_history: List[str] = []
'History of inputs'
Expand Down Expand Up @@ -787,7 +787,7 @@ def execute_input(inp: str, *other_input: List[str]) -> None:

# Narsese parsing
has_slash = False # usage of backslashes: Enforce/disable "parse simplification"
if not _parse_need_slash or (has_slash := inp.startswith('\\')):
if _parse_simplification or (has_slash := inp.startswith('\\')):
if has_slash: # Remove the slash if there is a backslash
inp = inp[1:]
inp = special_narsese_parse(inp=inp)
Expand Down

0 comments on commit 99ef061

Please sign in to comment.