Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit d715ee4

Browse files
Fixed hidden NullType returned not hidden
1 parent a308989 commit d715ee4

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

mathscript.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2039,6 +2039,7 @@ class NullType(Value):
20392039
def __init__(self, value = None):
20402040
super().__init__()
20412041
self.value = value or 'null'
2042+
self._value = value
20422043
self.hidden = value is None
20432044

20442045
def get_comparison_eq(self, other):
@@ -2069,7 +2070,7 @@ def notted(self):
20692070
return Boolean(1), None
20702071

20712072
def copy(self):
2072-
copy = NullType(self.value)
2073+
copy = NullType(self._value)
20732074
copy.set_pos(self.pos_start, self.pos_end)
20742075
copy.set_context(self.context)
20752076

@@ -2426,7 +2427,7 @@ def execute_exec(self, exec_ctx):
24262427
))
24272428

24282429
code_or_filename = code_or_filename.value
2429-
is_filename = re.match('((^([a-z]|[A-Z]):(?=\\(?![\0-\37<>:"/\\|?*])|\/(?![\0-\37<>:"/\\|?*])|$)|^\\(?=[\\\/][^\0-\37<>:"/\\|?*]+)|^(?=(\\|\/)$)|^\.(?=(\\|\/)$)|^\.\.(?=(\\|\/)$)|^(?=(\\|\/)[^\0-\37<>:"/\\|?*]+)|^\.(?=(\\|\/)[^\0-\37<>:"/\\|?*]+)|^\.\.(?=(\\|\/)[^\0-\37<>:"/\\|?*]+))((\\|\/)[^\0-\37<>:"/\\|?*]+|(\\|\/)$)*()$)|(^\/$|(^(?=\/)|^\.|^\.\.)(\/(?=[^/\0])[^/\0]+)*\/?$)', code_or_filename)
2430+
is_filename = re.match(r'((^([a-z]|[A-Z]):(?=\\(?![\0-\37<>:"/\\|?*])|\/(?![\0-\37<>:"/\\|?*])|$)|^\\(?=[\\\/][^\0-\37<>:"/\\|?*]+)|^(?=(\\|\/)$)|^\.(?=(\\|\/)$)|^\.\.(?=(\\|\/)$)|^(?=(\\|\/)[^\0-\37<>:"/\\|?*]+)|^\.(?=(\\|\/)[^\0-\37<>:"/\\|?*]+)|^\.\.(?=(\\|\/)[^\0-\37<>:"/\\|?*]+))((\\|\/)[^\0-\37<>:"/\\|?*]+|(\\|\/)$)*()$)|(^\/$|(^(?=\/)|^\.|^\.\.)(\/(?=[^/\0])[^/\0]+)*\/?$)', code_or_filename)
24302431
filename = code_or_filename if is_filename else '<code>'
24312432

24322433
if is_filename:
@@ -2452,8 +2453,8 @@ def execute_exec(self, exec_ctx):
24522453
))
24532454

24542455
return RTResult().success(NullType())
2455-
execute_run.positional_arg_names = ["code_or_filename"] # type: ignore
2456-
execute_run.optional_arg_names = {} # type: ignore
2456+
execute_exec.positional_arg_names = ["code_or_filename"] # type: ignore
2457+
execute_exec.optional_arg_names = {} # type: ignore
24572458

24582459
def execute_length(self, exec_ctx):
24592460
iterable = exec_ctx.symbol_table.get('iterable')
@@ -2854,7 +2855,7 @@ def run(fn, text):
28542855

28552856
if debug_mode == debug_modes_list[3]:
28562857
if result.value is not None:
2857-
print("Multiline list:", result.value, [repr(x) for x in result.value.elements if x is not None], sep='\n ')
2858+
print("Multiline list:", result.value, [repr(x) for x in result.value.elements if not getattr(x, 'hidden', False)], sep='\n ')
28582859
else:
28592860
print("Multiline list:", result.value, sep='\n ')
28602861

shell.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
git_release_tag = 'latest'
2-
git_commit_hash = 'latest'
3-
git_commit_date = None
1+
git_release_tag = 'v1.0.0-17-ga308989'
2+
git_commit_hash = 'a308989'
3+
git_commit_date = 'Aug 9 2024, 17:55:15'
44

55
import platform
66
import mathscript

0 commit comments

Comments
 (0)