-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from s-expressionists/client-3
Integrate with Incless and Inravina
- Loading branch information
Showing
46 changed files
with
4,845 additions
and
2,733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: ${{ matrix.lisp }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
lisp: | ||
- clasp | ||
- sbcl | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ghcr.io/yitzchak/archlinux-cl:latest | ||
steps: | ||
- name: Checkout trivial-stream-column | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: yitzchak/trivial-stream-column | ||
path: trivial-stream-column | ||
- name: Checkout Incless | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: s-expressionists/Incless | ||
path: incless | ||
- name: Checkout Inravina | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: s-expressionists/Inravina | ||
path: inravina | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
with: | ||
path: invistra | ||
- name: Setup Lisp Environment | ||
run: | | ||
make-rc | ||
asdf-add | ||
- name: Run Regression Tests | ||
run: | | ||
lisp -i ${{ matrix.lisp }} -e "(ql:quickload :invistra-extrinsic/test)" -e "(asdf:test-system :invistra-extrinsic)" | ||
- name: Run ANSI Tests | ||
run: | | ||
lisp -i ${{ matrix.lisp }} -e "(ql:quickload :invistra-shim/test)" -e "(asdf:test-system :invistra-shim)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ | |
*.out | ||
*-cache.yaml | ||
*~ | ||
\#*\# | ||
\#*\# | ||
dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1 Basic output | ||
|
||
(in-package #:invistra) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1.1 ~c Character | ||
|
||
(define-directive #\c c-directive nil (named-parameters-directive) ()) | ||
|
||
(define-format-directive-interpreter c-directive | ||
(let ((char (consume-next-argument 'character))) | ||
(cond ((and (not colonp) (not at-signp)) | ||
;; Neither colon nor at-sign. | ||
;; The HyperSpec says to do what WRITE-CHAR does. | ||
(write-char char *destination*)) | ||
((not at-signp) | ||
;; We have only a colon modifier. | ||
;; The HyperSpec says to do what WRITE-CHAR does for | ||
;; printing characters, and what char-name does otherwise. | ||
;; The definition of "printing char" is a graphic character | ||
;; other than space. | ||
(if (and (graphic-char-p char) (not (eql char #\Space))) | ||
(write-char char *destination*) | ||
(write-string (char-name char) *destination*))) | ||
((not colonp) | ||
;; We have only an at-sign modifier. | ||
;; The HyperSpec says to print it the way the Lisp | ||
;; reader can understand, which I take to mean "use PRIN1". | ||
;; It also says to bind *PRINT-ESCAPE* to t. | ||
(let ((*print-escape* t)) | ||
(incless:write-object client char *destination*))) | ||
(t | ||
;; We have both a colon and and at-sign. | ||
;; The HyperSpec says to do what ~:C does, but | ||
;; also to mention unusual shift keys on the | ||
;; keyboard required to type the character. | ||
;; I don't see how to do that, so we do the same | ||
;; as for ~:C. | ||
(if (and (graphic-char-p char) (not (eql char #\Space))) | ||
(write-char char *destination*) | ||
(write-string (char-name char) *destination*)))))) | ||
|
||
(define-format-directive-compiler c-directive | ||
`((let ((char (consume-next-argument 'character))) | ||
,(cond ((and (not colonp) (not at-signp)) | ||
`(write-char char *destination*)) | ||
((not at-signp) | ||
`(if (and (graphic-char-p char) (not (eql char #\Space))) | ||
(write-char char *destination*) | ||
(write-string (char-name char) *destination*))) | ||
((not colonp) | ||
`(let ((*print-escape* t)) | ||
(incless:write-object ,(incless:client-form client) char *destination*))) | ||
(t | ||
`(if (and (graphic-char-p char) (not (eql char #\Space))) | ||
(write-char char *destination*) | ||
(write-string (char-name char) *destination*))))))) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1.2 ~% Newline. | ||
|
||
(define-directive #\% percent-directive nil (named-parameters-directive no-modifiers-mixin) | ||
((how-many :type (integer 0) :default-value 1))) | ||
|
||
(define-format-directive-interpreter percent-directive | ||
(loop repeat how-many | ||
do (terpri *destination*))) | ||
|
||
(define-format-directive-compiler percent-directive | ||
(let ((how-many (compile-time-value directive 'how-many))) | ||
(case how-many | ||
(0 '()) | ||
(1 '((terpri *destination*))) | ||
(2 '((terpri *destination*) | ||
(terpri *destination*))) | ||
(otherwise | ||
`((loop repeat how-many | ||
do (terpri *destination*))))))) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1.3 ~& Fresh line and newlines. | ||
|
||
(define-directive #\& ampersand-directive nil (named-parameters-directive no-modifiers-mixin) | ||
((how-many :type (integer 0) :default-value 1))) | ||
|
||
(define-format-directive-interpreter ampersand-directive | ||
(unless (zerop how-many) | ||
(fresh-line *destination*) | ||
(loop repeat (1- how-many) | ||
do (terpri *destination*)))) | ||
|
||
(define-format-directive-compiler ampersand-directive | ||
(let ((how-many (compile-time-value directive 'how-many))) | ||
(case how-many | ||
((:argument-reference :remaining-argument-count) | ||
`((unless (zerop how-many) | ||
(fresh-line *destination*) | ||
(loop repeat (1- how-many) | ||
do (terpri *destination*))))) | ||
(0 nil) | ||
(1 `((fresh-line *destination*))) | ||
(2 `((fresh-line *destination*) | ||
(terpri *destination*))) | ||
(otherwise | ||
`((fresh-line *destination*) | ||
(loop repeat ,(1- how-many) | ||
do (terpri *destination*))))))) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1.4 ~| Page separators. | ||
|
||
(define-directive #\| vertical-bar-directive nil (named-parameters-directive no-modifiers-mixin) | ||
((how-many :type (integer 0) :default-value 1))) | ||
|
||
(define-format-directive-interpreter vertical-bar-directive | ||
(loop repeat how-many | ||
do (write-char #\Page *destination*))) | ||
|
||
(define-format-directive-compiler vertical-bar-directive | ||
(let ((how-many (compile-time-value directive 'how-many))) | ||
(case how-many | ||
(0 nil) | ||
(1 `((write-char #\Page *destination*))) | ||
(2 `((write-char #\Page *destination*) | ||
(write-char #\Page *destination*))) | ||
(otherwise | ||
`((loop repeat how-many | ||
do (write-char #\Page *destination*))))))) | ||
|
||
;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
;;; | ||
;;; 22.3.1.5 ~~ Tildes. | ||
|
||
(define-directive #\~ tilde-directive nil (named-parameters-directive no-modifiers-mixin) | ||
((how-many :type (integer 0) :default-value 1))) | ||
|
||
(define-format-directive-interpreter tilde-directive | ||
(loop repeat how-many | ||
do (write-char #\~ *destination*))) | ||
|
||
(define-format-directive-compiler tilde-directive | ||
(let ((how-many (compile-time-value directive 'how-many))) | ||
(case how-many | ||
(0 nil) | ||
(1 `((write-char #\~ *destination*))) | ||
(2 `((write-char #\~ *destination*) | ||
(write-char #\~ *destination*))) | ||
(otherwise | ||
`((loop repeat how-many | ||
do (write-char #\~ *destination*))))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.