branch: externals/poke
commit e71f9cea1af218bf84daff81339366d9d9c66df4
Author: Jose E. Marchesi <[email protected]>
Commit: Jose E. Marchesi <[email protected]>
pkl: immutable declarations in compiler bootstrapping
2022-03-14 Jose E. Marchesi <[email protected]>
* libpoke/pkl-env.c (_decl): Do not allow re-defining immutable
declarations.
* libpoke/pkl-rt.pk: Mark declarations as immutable.
* libpoke/pkl-tab.y: Allow IMMUTABLE declarations at the
top-level.
* libpoke/pkl-ast.c (pkl_ast_make_decl): Initialize immutable_p to
0.
(pkl_ast_print_1): Print immutable_p.
* libpoke/pkl-ast.h (PKL_AST_DECL_IMMUTABLE_P): Define.
(struct pkl_ast_decl): New field `immutable_p'.
* libpoke/pkl-tab.y: New token IMMUTABLE.
* libpoke/pkl-lex.l: Handle __IMMUTABLE__.
* testsuite/poke.pkl/immutable-func-1.pk: Likewise.
* testsuite/poke.pkl/immutable-diag-2.pk: Likewise.
* testsuite/poke.pkl/immutable-diag-1.pk: New test.
* testsuite/Makefile.am (EXTRA_DIST): Add new tests.
---
poke.el | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/poke.el b/poke.el
index 5d2ccd74ef..f5a6028adb 100644
--- a/poke.el
+++ b/poke.el
@@ -120,7 +120,7 @@
(setq poke-poked-process
(make-process :name "poked"
:buffer "*poked*"
- :command (list poke-poked-program)))
+ :command (list poke-poked-program "--debug")))
(set-process-query-on-exit-flag poke-poked-process nil)))
;;;; pokelet protocol
@@ -652,7 +652,7 @@ fun plet_elval = (string s) void:
*poke-ios* buffer."
(interactive)
(let ((ios-id (tabulated-list-get-id)))
- (poke-code-send "set_ios (" + (number-to-string ios-id) ")")))
+ (poke-code-send (concat "set_ios (" (number-to-string ios-id) ");"))))
(defun poke-ios-open (ios iohandler ioflags iosize)
(unless (assoc ios poke-ios-alist)
@@ -672,14 +672,18 @@ fun plet_elval = (string s) void:
(defun poke-ios-set (ios)
;; Select the right line in *poke-ios*.
+ ;; XXX
;; Change prompt in *poke-repl*.
(let ((ios-data (assoc ios poke-ios-alist)))
(when ios-data
- (poke-repl-set-prompt (concat "#!" (cadr ios-data) "!# ")))))
+ (poke-repl-set-prompt (concat "#!" (cadr ios-data) "!# "))))
+ ;; Update VU
+ (poke-vu-refresh))
(defvar poke-ios-mode-map
(let ((map (make-sparse-keymap)))
(define-key map [return] 'poke-ios-set-ios)
+ (define-key map (kbd "RET") 'poke-ios-set-ios)
map)
"Local keymap for `poke-ios-mode' buffers.")
@@ -733,7 +737,7 @@ fun plet_elval = (string s) void:
fun poke_el_banner = void:
{
/* XXX include libpoke version. */
- print \"Welcome to GNU poke.\\n\";
+ printf (\"Welcome to GNU poke %s.\\n\", poked_libpoke_version);
}
fun poke_el_ios_open = (int<32> ios) void:
@@ -797,11 +801,9 @@ fun quit = void:
(poke-code-send poke-pk)
(poke-repl)
(poke-vu)
- (poke-ios)
(delete-other-windows)
(switch-to-buffer "*poke-vu*")
(switch-to-buffer-other-window "*poke-out*")
- (switch-to-buffer-other-window "*poke-ios*")
(switch-to-buffer-other-window "*poke-repl*"))
(defun poke-exit ()