Skip to content

Commit

Permalink
Remove copyright notice and untabify.
Browse files Browse the repository at this point in the history
  • Loading branch information
robert-strandh committed Sep 23, 2020
1 parent e7fd4ea commit c87f9f7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 94 deletions.
106 changes: 47 additions & 59 deletions Code/Loop/count-clause.lisp
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) ())
Expand All @@ -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)

Expand All @@ -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)))))
24 changes: 6 additions & 18 deletions Code/Loop/do-clause.lisp
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.
Expand All @@ -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)

Expand Down
22 changes: 5 additions & 17 deletions Code/Loop/final-clause.lisp
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.
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit c87f9f7

Please sign in to comment.