File tree Expand file tree Collapse file tree 3 files changed +677
-156
lines changed
Expand file tree Collapse file tree 3 files changed +677
-156
lines changed Original file line number Diff line number Diff line change 1111from mathicsscript .termshell import (
1212 ShellEscapeException ,
1313 TerminalShell ,
14- wl_replace_dict_esc ,
15- wl_replace_pattern ,
1614)
1715
1816from mathicsscript .format import format_output
1917
18+ from mathics import replace_wl_with_unicode
2019from mathics .core .parser import FileLineFeeder
2120from mathics .core .definitions import Definitions
2221from mathics .core .expression import Symbol , SymbolTrue , SymbolFalse
3332from mathicsscript .version import __version__
3433
3534
36- def replace_wl_to_unicode (wl_input : str ) -> str :
37- """WL uses some non-unicode character for various things.
38- Replace them with the unicode equivalent.
39- Two known items are directed arrow and undirected arrow.
40- """
41- return wl_replace_pattern .sub (
42- lambda m : wl_replace_dict_esc [re .escape (m .group (0 ))], wl_input
43- )
44-
45-
4635def ensure_settings ():
4736 home = Path .home ()
4837 base_config_dir = home / ".config"
@@ -339,7 +328,7 @@ def main(
339328 current_pos = GNU_readline .get_current_history_length ()
340329 for pos in range (last_pos , current_pos - 1 ):
341330 GNU_readline .remove_history_item (pos )
342- wl_input = replace_wl_to_unicode (source_code .rstrip ())
331+ wl_input = replace_wl_with_unicode (source_code .rstrip ())
343332 GNU_readline .add_history (wl_input )
344333
345334 if query is None :
You can’t perform that action at this time.
0 commit comments