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 t for 'wrap-program'....It is required for cross-compilation. * gnu/packages/vpn.scm (protonvpn-cli)[inputs]: Add 'bash-minimal'. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: I4390f79230e25fdb64dba96c57b7f32905245bc6 Maxime Devos 2024-07-24gnu: sshuttle: Improve package style....* gnu/packages/vpn.scm (sshuttle) [arguments]: Use G-expressions. Change-Id: Ia8961e3382116d0f1e67a7feb181f1e0fd6a5caf jgart 2024-07-24gnu: sshuttle: Update to 1.1.2....* gnu/packages/vpn.scm (sshuttle): Update to 1.1.2. [build-system]: Use pyproject-build-system. [native-inputs]: Add python-poetry-core. Change-Id: I353b8e1206d5d73bf94cb46e98ec7869fbd49fcb jgart 2024-05-12gnu: strongswan: Skip rsa test on i686-linux....* gnu/packages/vpn.scm (strongswan)[arguments]: Adjust custom 'set-up-test-environment phase to skip the rsa tests on i686-linux. Change-Id: If4aff3f710f2eb4e0dfbad58deb41838421db89f Efraim Flashner 2024-05-06gnu: strongswan: Remove pre-generated files....* gnu/packages/vpn.scm (strongswan)[source]: Add snippet to remove some pre-generated files. [native-inputs]: Add bison, flex, perl. Change-Id: Ifc316a1c309f8687418455189457cee83b06bfa1 Efraim Flashner 2024-05-06gnu: strongswan: Fix building on non-x86 architectures....* gnu/packages/vpn.scm (strongswan)[arguments]: When building for not-x86 architectures disable aesni support. Also adjust the test suite so we skip the RSA tests. Change-Id: Idbc7bb229b83b0f43f3286b94fa4da077711c0ed Efraim Flashner