fisheggs

amforth-shell.py.diff

Dec 29th, 2025
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.49 KB | Source Code | 0 0
  1. *** amforth-shell.py.orig   2025-12-30 11:19:04.875143287 +1100
  2. --- amforth-shell.py    2025-12-30 11:29:30.213850147 +1100
  3. ***************
  4. *** 1242,1259 ****
  5.               atexit.register(readline.write_history_file, histfn)
  6.  
  7.       def _update_words(self):
  8.           # get all words that are available in the search order      
  9.           self.send_line("base @ decimal dp u. base !")
  10.           dp = self.read_response()
  11.           if dp[-3:] != " ok":
  12. !             return  # Something went wrong, just silently ignore
  13.           dp = int(dp[:-3])
  14.           if self._amforth_dp != dp:
  15.               self._amforth_dp = dp
  16.               self.send_line("words")
  17.               words = self.read_response()
  18.               if words[-3:] != " ok":
  19. !                 return # Something went wrong, just silently ignore
  20.               self._amforth_words = words.split(" ") + self.interact_directives
  21.  
  22.       def _update_stack(self):
  23. --- 1242,1262 ----
  24.               atexit.register(readline.write_history_file, histfn)
  25.  
  26.       def _update_words(self):
  27. +         self.progress_callback("Information", None, "getting words")
  28.           # get all words that are available in the search order      
  29.           self.send_line("base @ decimal dp u. base !")
  30.           dp = self.read_response()
  31.           if dp[-3:] != " ok":
  32. !             self.progress_callback("Error", None, "setting base")
  33. !             return
  34.           dp = int(dp[:-3])
  35.           if self._amforth_dp != dp:
  36.               self._amforth_dp = dp
  37.               self.send_line("words")
  38.               words = self.read_response()
  39.               if words[-3:] != " ok":
  40. !                 self.progress_callback("Error", None, "reading words")
  41. !                 return
  42.               self._amforth_words = words.split(" ") + self.interact_directives
  43.  
  44.       def _update_stack(self):
  45. ***************
  46. *** 1261,1267 ****
  47.           self.send_line(".s")
  48.           words=self.read_response()
  49.           if words[-3:] != " ok":
  50. !             return # Something went wrong, just silently ignore
  51.           self._amforth_stack=words[:-3]
  52.              
  53.       def _update_cpu(self):
  54. --- 1264,1271 ----
  55.           self.send_line(".s")
  56.           words=self.read_response()
  57.           if words[-3:] != " ok":
  58. !             self.progress_callback("Error", None, "getting stack")
  59. !             return
  60.           self._amforth_stack=words[:-3]
  61.              
  62.       def _update_cpu(self):
  63. ***************
  64. *** 1269,1275 ****
  65.           self.send_line("s\" cpu\" environment search-wordlist drop execute itype")
  66.           words = self.read_response()
  67.           if words[-3:] != " ok":
  68. !             return # Something went wrong, just silently ignore
  69.           mcudef = words[:-3].lower()
  70.           self._amforth_regs = {}
  71.           if mcudef.startswith("msp"):
  72. --- 1273,1280 ----
  73.           self.send_line("s\" cpu\" environment search-wordlist drop execute itype")
  74.           words = self.read_response()
  75.           if words[-3:] != " ok":
  76. !             self.progress_callback("Error", None, "update CPU")
  77. !             return
  78.           mcudef = words[:-3].lower()
  79.           self._amforth_regs = {}
  80.           if mcudef.startswith("msp"):
  81. ***************
  82. *** 1347,1356 ****
  83.                                           "#timeout", "#timeout-next"]:
  84.                       self._rl_matches = []
  85.                   else:
  86. !                     self._rl_matches = [w + " "  for w in self._amforth_words+self._amforth_regs.keys()
  87.                                           if not text or w.startswith(text)]
  88.               else:
  89. !                 self._rl_matches = [w + " " for w in self._amforth_words+self._amforth_regs.keys()
  90.                                       if not text or w.startswith(text)]
  91.               if self._rl_matches:
  92.                   return self._rl_matches[0]
  93. --- 1352,1363 ----
  94.                                           "#timeout", "#timeout-next"]:
  95.                       self._rl_matches = []
  96.                   else:
  97. !                     self._rl_matches = [w + " "  for w in self._amforth_words+
  98. !                                         list(self._amforth_regs.keys())
  99.                                           if not text or w.startswith(text)]
  100.               else:
  101. !                 self._rl_matches = [w + " " for w in self._amforth_words+
  102. !                                     list(self._amforth_regs.keys())
  103.                                       if not text or w.startswith(text)]
  104.               if self._rl_matches:
  105.                   return self._rl_matches[0]
  106.  
Advertisement
Add Comment
Please, Sign In to add comment