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
e7fd4ea
commit c87f9f7
Showing
3 changed files
with
58 additions
and
94 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 count-clause (count/sum-accumulation-clause) ()) | ||
|
@@ -32,61 +20,61 @@ | |
|
||
(define-parser count-it-into-clause-parser | ||
(consecutive (lambda (count it into var type-spec) | ||
(declare (ignore count it into)) | ||
(make-instance 'count-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore count it into)) | ||
(make-instance 'count-it-into-clause | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
(keyword-parser 'it) | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser count-it-clause-parser | ||
(consecutive (lambda (count it type-spec) | ||
(declare (ignore count it)) | ||
(make-instance 'count-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
(declare (ignore count it)) | ||
(make-instance 'count-it-clause | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
(keyword-parser 'it) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser count-form-into-clause-parser | ||
(consecutive (lambda (count form into var type-spec) | ||
(declare (ignore count into)) | ||
(make-instance 'count-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
(declare (ignore count into)) | ||
(make-instance 'count-form-into-clause | ||
:form form | ||
:into-var var | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
'anything-parser | ||
(keyword-parser 'into) | ||
(singleton #'identity | ||
(lambda (x) | ||
(and (symbolp x) (not (constantp x))))) | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser count-form-clause-parser | ||
(consecutive (lambda (count form type-spec) | ||
(declare (ignore count)) | ||
(make-instance 'count-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
(declare (ignore count)) | ||
(make-instance 'count-form-clause | ||
:form form | ||
:type-spec type-spec)) | ||
(alternative (keyword-parser 'count) | ||
(keyword-parser 'counting)) | ||
'anything-parser | ||
'optional-type-spec-parser)) | ||
|
||
(define-parser count-clause-parser | ||
(alternative 'count-it-into-clause-parser | ||
'count-it-clause-parser | ||
'count-form-into-clause-parser | ||
'count-form-clause-parser)) | ||
'count-it-clause-parser | ||
'count-form-into-clause-parser | ||
'count-form-clause-parser)) | ||
|
||
(add-clause-parser 'count-clause-parser) | ||
|
||
|
@@ -98,22 +86,22 @@ | |
(declare (ignore end-tag)) | ||
`(when ,(form clause) | ||
(setq ,*accumulation-variable* | ||
(1+ ,*accumulation-variable*)))) | ||
(1+ ,*accumulation-variable*)))) | ||
|
||
(defmethod body-form ((clause count-form-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(when ,(form clause) | ||
(setq ,(into-var clause) | ||
(1+ ,(into-var clause))))) | ||
(1+ ,(into-var clause))))) | ||
|
||
(defmethod body-form ((clause count-it-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(when ,*it-var* | ||
(setq ,*accumulation-variable* | ||
(1+ ,*accumulation-variable*)))) | ||
(1+ ,*accumulation-variable*)))) | ||
|
||
(defmethod body-form ((clause count-it-into-clause) end-tag) | ||
(declare (ignore end-tag)) | ||
`(when ,*it-var* | ||
(setq ,(into-var clause) | ||
(1+ ,(into-var clause))))) | ||
(1+ ,(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) | ||
|
||
;;;; Clause DO-CLAUSE. | ||
|
@@ -35,12 +23,12 @@ | |
|
||
(define-parser do-clause-parser | ||
(consecutive (lambda (do compound+) | ||
(declare (ignore do)) | ||
(make-instance 'do-clause | ||
:body compound+)) | ||
(alternative (keyword-parser 'do) | ||
(keyword-parser 'doing)) | ||
'compound+)) | ||
(declare (ignore do)) | ||
(make-instance 'do-clause | ||
:body compound+)) | ||
(alternative (keyword-parser 'do) | ||
(keyword-parser 'doing)) | ||
'compound+)) | ||
|
||
(add-clause-parser 'do-clause-parser) | ||
|
||
|
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) | ||
|
||
;;;; Clause FINAL-CLAUSE. | ||
|
@@ -39,11 +27,11 @@ | |
|
||
(define-parser final-clause-parser | ||
(consecutive (lambda (finally compound+) | ||
(declare (ignore finally)) | ||
(make-instance 'final-clause | ||
:form compound+)) | ||
(keyword-parser 'finally) | ||
'compound+)) | ||
(declare (ignore finally)) | ||
(make-instance 'final-clause | ||
:form compound+)) | ||
(keyword-parser 'finally) | ||
'compound+)) | ||
|
||
(add-clause-parser 'final-clause-parser) | ||
|
||
|