X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/048d0b2d143b6a491ac73eed6ab972e97774391c..33b5686f788fdef21866d728395d3087d6be3cd2:/src/lexer-proto.lisp diff --git a/src/lexer-proto.lisp b/src/lexer-proto.lisp index af2e535..b7653b4 100644 --- a/src/lexer-proto.lisp +++ b/src/lexer-proto.lisp @@ -40,6 +40,9 @@ ;;;-------------------------------------------------------------------------- ;;; Indicators and error messages. +(defvar *indicator-map* (make-hash-table) + "Hash table mapping indicator objects to human-readable descriptions.") + (export 'define-indicator) (defun define-indicator (indicator description) "Associate an INDICATOR with its textual DESCRIPTION. @@ -96,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) @@ -110,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. @@ -129,6 +134,7 @@ ;;;-------------------------------------------------------------------------- ;;; Lexical analysis utilities. +(export 'scan-comment) (defun scan-comment (char-scanner) "Scan a comment (either `/* ... */' or `// ...') from CHAR-SCANNER.