From: Mark Wooding Date: Sun, 30 Aug 2015 09:58:38 +0000 (+0100) Subject: Merge branch 'master' into doc X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/1818107e8198734df843841a51bca3713bd37596?hp=2e2816d37bd3951177967d1cf5ce707b75a539fa Merge branch 'master' into doc * master: src/parser/parser-expr-impl.lisp: Compare paren tags with `eql'. src/module-impl.lisp: Expose `c-fragment' state. src/lexer-proto.lisp: Export some more symbols. src/pset-proto.lisp (default-slot-from-property): Make `slot-names' optional. src/pset-proto.lisp: Fix export of `check-unused-properties'. src/: Fix some docstrings. --- diff --git a/src/lexer-proto.lisp b/src/lexer-proto.lisp index d2181e1..b7653b4 100644 --- a/src/lexer-proto.lisp +++ b/src/lexer-proto.lisp @@ -99,6 +99,7 @@ (scanner-current-char char-scanner)) (and consumedp (file-location char-scanner)))) +(export 'skip-until) (defparse skip-until (:context (context token-scanner-context) (&key (keep-end nil keep-end-p)) &rest token-types) @@ -113,6 +114,7 @@ :keep-end ,(if keep-end-p keep-end (> (length token-types) 1)))) +(export 'error) (defparse error (:context (context token-scanner-context) (&key) sub &optional (recover t)) "Try to parse SUB; if it fails then report an error, and parse RECOVER. @@ -132,6 +134,7 @@ ;;;-------------------------------------------------------------------------- ;;; Lexical analysis utilities. +(export 'scan-comment) (defun scan-comment (char-scanner) "Scan a comment (either `/* ... */' or `// ...') from CHAR-SCANNER. diff --git a/src/module-impl.lisp b/src/module-impl.lisp index fe6b545..08679ce 100644 --- a/src/module-impl.lisp +++ b/src/module-impl.lisp @@ -144,11 +144,10 @@ ;;;-------------------------------------------------------------------------- ;;; Code fragments. -(export 'c-fragment) +(export '(c-fragment c-fragment-text)) (defclass c-fragment () - ((location :initarg :location :type file-location - :accessor c-fragment-location) - (text :initarg :text :type string :accessor c-fragment-text)) + ((location :initarg :location :type file-location :reader file-location) + (text :initarg :text :type string :reader c-fragment-text)) (:documentation "Represents a fragment of C code to be written to an output file. @@ -181,7 +180,7 @@ (defmethod print-object ((fragment c-fragment) stream) (let ((text (c-fragment-text fragment)) - (location (c-fragment-location fragment))) + (location (file-location fragment))) (if *print-escape* (print-unreadable-object (fragment stream :type t) (when location diff --git a/src/parser/parser-expr-impl.lisp b/src/parser/parser-expr-impl.lisp index 5ae4035..41c154f 100644 --- a/src/parser/parser-expr-impl.lisp +++ b/src/parser/parser-expr-impl.lisp @@ -151,7 +151,7 @@ (let ((head (car opstack))) (cond ((not (typep head 'open-parenthesis)) (apply-operator head state)) - ((not (eq (slot-value head 'tag) tag)) + ((not (eql (slot-value head 'tag) tag)) (fail)) (t (return))) diff --git a/src/parser/parser-expr-proto.lisp b/src/parser/parser-expr-proto.lisp index ec35445..929e85a 100644 --- a/src/parser/parser-expr-proto.lisp +++ b/src/parser/parser-expr-proto.lisp @@ -41,7 +41,7 @@ (:documentation "Push VALUE onto the STATE's value stack. - The default message just does that without any fuss. It's unlikely that + The default method just does that without any fuss. It's unlikely that this will need changing unless you invent some really weird values.")) (export 'apply-operator) diff --git a/src/pset-proto.lisp b/src/pset-proto.lisp index e58a928..332bcef 100644 --- a/src/pset-proto.lisp +++ b/src/pset-proto.lisp @@ -173,7 +173,7 @@ (defun pset-get (pset key) "Look KEY up in PSET and return what we find. - If there's no property by that name, return NIL." + If there's no property by that name, return nil." (values (gethash key (%pset-hash pset)))) (defun pset-store (pset prop) @@ -290,7 +290,7 @@ ((endp list) pset) (add-property pset (funcall name list) (funcall value list)))))) -(export 'check--unused-properties) +(export 'check-unused-properties) (defun check-unused-properties (pset) "Issue errors about unused properties in PSET." (when pset @@ -306,7 +306,7 @@ ;;; Utility macros. (defmacro default-slot-from-property - ((instance slot slot-names) + ((instance slot &optional (slot-names t)) (pset property type &optional (pvar (gensym "PROP-")) &rest convert-forms)