forked from robert-strandh/SICL
-
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.
Remove copyright notice and untabify.
- Loading branch information
1 parent
b2a7fdd
commit a1cf1f7
Showing
3 changed files
with
222 additions
and
258 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 |
---|---|---|
@@ -1,15 +1,3 @@ | ||
;;;; Copyright (c) 2014 | ||
;;;; | ||
;;;; Robert Strandh ([email protected]) | ||
;;;; | ||
;;;; all rights reserved. | ||
;;;; | ||
;;;; Permission is hereby granted to use this software for any | ||
;;;; purpose, including using, modifying, and redistributing it. | ||
;;;; | ||
;;;; The software is provided "as-is" with no warranty. The user of | ||
;;;; this software assumes any responsibility of the consequences. | ||
|
||
(cl:in-package #:sicl-loop) | ||
|
||
(defclass append-clause (list-accumulation-clause) ()) | ||
|
@@ -32,53 +20,53 @@ | |
|
||
(define-parser append-it-into-clause-parser | ||
(consecutive (lambda (append it into var) | ||
(declare (ignore append it into)) | ||
(make-instance 'append-it-into-clause | ||
:into-var var)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
(declare (ignore append it into)) | ||
(make-instance 'append-it-into-clause | ||
:into-var var)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
|
||
(define-parser append-it-clause-parser | ||
(consecutive (lambda (append it) | ||
(declare (ignore append it)) | ||
(make-instance 'append-it-clause)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
(keyword-parser 'it))) | ||
(declare (ignore append it)) | ||
(make-instance 'append-it-clause)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
(keyword-parser 'it))) | ||
|
||
(define-parser append-form-into-clause-parser | ||
(consecutive (lambda (append form into var) | ||
(declare (ignore append into)) | ||
(make-instance 'append-form-into-clause | ||
:form form | ||
:into-var var)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
(declare (ignore append into)) | ||
(make-instance 'append-form-into-clause | ||
:form form | ||
:into-var var)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
|
||
(define-parser append-form-clause-parser | ||
(consecutive (lambda (append form) | ||
(declare (ignore append)) | ||
(make-instance 'append-form-clause | ||
:form form)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
'anything-parser)) | ||
(declare (ignore append)) | ||
(make-instance 'append-form-clause | ||
:form form)) | ||
(alternative (keyword-parser 'append) | ||
(keyword-parser 'appending)) | ||
'anything-parser)) | ||
|
||
(define-parser append-clause-parser | ||
(alternative 'append-it-into-clause-parser | ||
'append-it-clause-parser | ||
'append-form-into-clause-parser | ||
'append-form-clause-parser)) | ||
'append-it-clause-parser | ||
'append-form-into-clause-parser | ||
'append-form-clause-parser)) | ||
|
||
(add-clause-parser 'append-clause-parser) | ||
|
||
|
@@ -90,46 +78,46 @@ | |
(declare (ignore end-tag)) | ||
`(if (null ,*list-tail-accumulation-variable*) | ||
(progn (setq ,*accumulation-variable* | ||
(copy-list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*accumulation-variable*))) | ||
(copy-list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*accumulation-variable*))) | ||
(progn (rplacd ,*list-tail-accumulation-variable* | ||
(copy-list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*list-tail-accumulation-variable*))))) | ||
(copy-list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*list-tail-accumulation-variable*))))) | ||
|
||
(defmethod body-form ((clause append-form-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(tail-variable (into-var clause))) | ||
(progn (setq ,(into-var clause) | ||
(copy-list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(into-var clause)))) | ||
(copy-list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(into-var clause)))) | ||
(progn (rplacd ,(tail-variable (into-var clause)) | ||
(copy-list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(tail-variable (into-var clause))))))) | ||
(copy-list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(tail-variable (into-var clause))))))) | ||
|
||
(defmethod body-form ((clause append-it-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,*list-tail-accumulation-variable*) | ||
(progn (setq ,*accumulation-variable* | ||
(copy-list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*accumulation-variable*))) | ||
(copy-list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*accumulation-variable*))) | ||
(progn (rplacd ,*list-tail-accumulation-variable* | ||
(copy-list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*list-tail-accumulation-variable*))))) | ||
(copy-list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(last ,*list-tail-accumulation-variable*))))) | ||
|
||
(defmethod body-form ((clause append-it-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(tail-variable (into-var clause))) | ||
(progn (setq ,(into-var clause) | ||
(copy-list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(into-var clause)))) | ||
(copy-list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(into-var clause)))) | ||
(progn (rplacd ,(tail-variable (into-var clause)) | ||
(copy-list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(tail-variable (into-var clause))))))) | ||
(copy-list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(last ,(tail-variable (into-var clause))))))) |
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 |
---|---|---|
@@ -1,15 +1,3 @@ | ||
;;;; Copyright (c) 2014 | ||
;;;; | ||
;;;; Robert Strandh ([email protected]) | ||
;;;; | ||
;;;; all rights reserved. | ||
;;;; | ||
;;;; Permission is hereby granted to use this software for any | ||
;;;; purpose, including using, modifying, and redistributing it. | ||
;;;; | ||
;;;; The software is provided "as-is" with no warranty. The user of | ||
;;;; this software assumes any responsibility of the consequences. | ||
|
||
(cl:in-package #:sicl-loop) | ||
|
||
(defclass collect-clause (list-accumulation-clause) ()) | ||
|
@@ -32,53 +20,53 @@ | |
|
||
(define-parser collect-it-into-clause-parser | ||
(consecutive (lambda (collect it into var) | ||
(declare (ignore collect it into)) | ||
(make-instance 'collect-it-into-clause | ||
:into-var var)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
(declare (ignore collect it into)) | ||
(make-instance 'collect-it-into-clause | ||
:into-var var)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
|
||
(define-parser collect-it-clause-parser | ||
(consecutive (lambda (collect it) | ||
(declare (ignore collect it)) | ||
(make-instance 'collect-it-clause)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
(keyword-parser 'it))) | ||
(declare (ignore collect it)) | ||
(make-instance 'collect-it-clause)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
(keyword-parser 'it))) | ||
|
||
(define-parser collect-form-into-clause-parser | ||
(consecutive (lambda (collect form into var) | ||
(declare (ignore collect into)) | ||
(make-instance 'collect-form-into-clause | ||
:form form | ||
:into-var var)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
(declare (ignore collect into)) | ||
(make-instance 'collect-form-into-clause | ||
:form form | ||
:into-var var)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))))) | ||
|
||
(define-parser collect-form-clause-parser | ||
(consecutive (lambda (collect form) | ||
(declare (ignore collect)) | ||
(make-instance 'collect-form-clause | ||
:form form)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
'anything-parser)) | ||
(declare (ignore collect)) | ||
(make-instance 'collect-form-clause | ||
:form form)) | ||
(alternative (keyword-parser 'collect) | ||
(keyword-parser 'collecting)) | ||
'anything-parser)) | ||
|
||
(define-parser collect-clause-parser | ||
(alternative 'collect-it-into-clause-parser | ||
'collect-it-clause-parser | ||
'collect-form-into-clause-parser | ||
'collect-form-clause-parser)) | ||
'collect-it-clause-parser | ||
'collect-form-into-clause-parser | ||
'collect-form-clause-parser)) | ||
|
||
(add-clause-parser 'collect-clause-parser) | ||
|
||
|
@@ -90,46 +78,46 @@ | |
(declare (ignore end-tag)) | ||
`(if (null ,*list-tail-accumulation-variable*) | ||
(progn (setq ,*list-tail-accumulation-variable* | ||
(list ,(form clause))) | ||
(setq ,*accumulation-variable* | ||
,*list-tail-accumulation-variable*)) | ||
(list ,(form clause))) | ||
(setq ,*accumulation-variable* | ||
,*list-tail-accumulation-variable*)) | ||
(progn (rplacd ,*list-tail-accumulation-variable* | ||
(list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(cdr ,*list-tail-accumulation-variable*))))) | ||
(list ,(form clause))) | ||
(setq ,*list-tail-accumulation-variable* | ||
(cdr ,*list-tail-accumulation-variable*))))) | ||
|
||
(defmethod body-form ((clause collect-form-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(tail-variable (into-var clause))) | ||
(progn (setq ,(tail-variable (into-var clause)) | ||
(list ,(form clause))) | ||
(setq ,(into-var clause) | ||
,(tail-variable (into-var clause)))) | ||
(list ,(form clause))) | ||
(setq ,(into-var clause) | ||
,(tail-variable (into-var clause)))) | ||
(progn (rplacd ,(tail-variable (into-var clause)) | ||
(list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(cdr ,(tail-variable (into-var clause))))))) | ||
(list ,(form clause))) | ||
(setq ,(tail-variable (into-var clause)) | ||
(cdr ,(tail-variable (into-var clause))))))) | ||
|
||
(defmethod body-form ((clause collect-it-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,*list-tail-accumulation-variable*) | ||
(progn (setq ,*list-tail-accumulation-variable* | ||
(list ,*it-var*)) | ||
(setq ,*accumulation-variable* | ||
,*list-tail-accumulation-variable*)) | ||
(list ,*it-var*)) | ||
(setq ,*accumulation-variable* | ||
,*list-tail-accumulation-variable*)) | ||
(progn (rplacd ,*list-tail-accumulation-variable* | ||
(list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(cdr ,*list-tail-accumulation-variable*))))) | ||
(list ,*it-var*)) | ||
(setq ,*list-tail-accumulation-variable* | ||
(cdr ,*list-tail-accumulation-variable*))))) | ||
|
||
(defmethod body-form ((clause collect-it-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(if (null ,(tail-variable (into-var clause))) | ||
(progn (setq ,(tail-variable (into-var clause)) | ||
(list ,*it-var*)) | ||
(setq ,(into-var clause) | ||
,(tail-variable (into-var clause)))) | ||
(list ,*it-var*)) | ||
(setq ,(into-var clause) | ||
,(tail-variable (into-var clause)))) | ||
(progn (rplacd ,(tail-variable (into-var clause)) | ||
(list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(cdr ,(tail-variable (into-var clause))))))) | ||
(list ,*it-var*)) | ||
(setq ,(tail-variable (into-var clause)) | ||
(cdr ,(tail-variable (into-var clause))))))) |
Oops, something went wrong.