mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: Add ECL 16.1.3 for Sage.
* gnu/packages/sagemath.scm (ecl-16): New variable. * gnu/packages/patches/ecl-16-format-directive-limit.patch, gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch, gnu/packages/patches/ecl-16-libffi.patch: New files. * gnu/local.mk (dist_patch_DATA): Register the patches.
This commit is contained in:
parent
71153712a2
commit
5b9822cf43
5 changed files with 142 additions and 0 deletions
83
gnu/packages/patches/ecl-16-format-directive-limit.patch
Normal file
83
gnu/packages/patches/ecl-16-format-directive-limit.patch
Normal file
|
@ -0,0 +1,83 @@
|
|||
Patch backported by Sage.
|
||||
|
||||
Fix from upstream that happens to work around
|
||||
https://trac.sagemath.org/ticket/23011
|
||||
diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp
|
||||
index 77ca799..53b887c 100644
|
||||
--- a/src/lsp/format.lsp
|
||||
+++ b/src/lsp/format.lsp
|
||||
@@ -307,11 +307,13 @@
|
||||
:start (format-directive-start struct)
|
||||
:end (format-directive-end struct))))
|
||||
|
||||
+(defconstant +format-directive-limit+ (1+ (char-code #\~)))
|
||||
+
|
||||
#+formatter
|
||||
(defparameter *format-directive-expanders*
|
||||
- (make-array char-code-limit :initial-element nil))
|
||||
+ (make-array +format-directive-limit+ :initial-element nil))
|
||||
(defparameter *format-directive-interpreters*
|
||||
- (make-array char-code-limit :initial-element nil))
|
||||
+ (make-array +format-directive-limit+ :initial-element nil))
|
||||
|
||||
(defparameter *default-format-error-control-string* nil)
|
||||
(defparameter *default-format-error-offset* nil)
|
||||
@@ -550,24 +552,24 @@
|
||||
(write-string directive stream)
|
||||
(interpret-directive-list stream (cdr directives) orig-args args))
|
||||
(#-ecl format-directive #+ecl vector
|
||||
+ (multiple-value-bind
|
||||
+ (new-directives new-args)
|
||||
+ (let* ((code (char-code (format-directive-character directive)))
|
||||
+ (function
|
||||
+ (and (< code +format-directive-limit+)
|
||||
+ (svref *format-directive-interpreters* code)))
|
||||
+ (*default-format-error-offset*
|
||||
+ (1- (format-directive-end directive))))
|
||||
+ (unless function
|
||||
+ (error 'format-error
|
||||
+ :complaint "Unknown format directive."))
|
||||
(multiple-value-bind
|
||||
(new-directives new-args)
|
||||
- (let ((function
|
||||
- (svref *format-directive-interpreters*
|
||||
- (char-code (format-directive-character
|
||||
- directive))))
|
||||
- (*default-format-error-offset*
|
||||
- (1- (format-directive-end directive))))
|
||||
- (unless function
|
||||
- (error 'format-error
|
||||
- :complaint "Unknown format directive."))
|
||||
- (multiple-value-bind
|
||||
- (new-directives new-args)
|
||||
- (funcall function stream directive
|
||||
- (cdr directives) orig-args args)
|
||||
- (values new-directives new-args)))
|
||||
- (interpret-directive-list stream new-directives
|
||||
- orig-args new-args)))))
|
||||
+ (funcall function stream directive
|
||||
+ (cdr directives) orig-args args)
|
||||
+ (values new-directives new-args)))
|
||||
+ (interpret-directive-list stream new-directives
|
||||
+ orig-args new-args)))))
|
||||
args))
|
||||
|
||||
|
||||
@@ -639,11 +641,12 @@
|
||||
(values `(write-string ,directive stream)
|
||||
more-directives))
|
||||
(format-directive
|
||||
- (let ((expander
|
||||
- (aref *format-directive-expanders*
|
||||
- (char-code (format-directive-character directive))))
|
||||
- (*default-format-error-offset*
|
||||
- (1- (format-directive-end directive))))
|
||||
+ (let* ((code (char-code (format-directive-character directive)))
|
||||
+ (expander
|
||||
+ (and (< code +format-directive-limit+)
|
||||
+ (svref *format-directive-expanders* code)))
|
||||
+ (*default-format-error-offset*
|
||||
+ (1- (format-directive-end directive))))
|
||||
(if expander
|
||||
(funcall expander directive more-directives)
|
||||
(error 'format-error
|
Loading…
Add table
Add a link
Reference in a new issue