diff options
author | Brian Templeton <bpt@hcoop.net> | 2010-06-07 16:37:24 -0400 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-12-07 13:21:01 +0100 |
commit | abcf4a9e1dc06607ddb43861e33a982e36ffac4b (patch) | |
tree | 821f899e0dedae1297093707669942d1160d65cb /module/language/elisp/parser.scm | |
parent | 9c933e1d3f72d9d8693e030c24de44adc9f9e0b9 (diff) | |
download | guile-abcf4a9e1dc06607ddb43861e33a982e36ffac4b.tar.gz |
whitespace changes
* module/language/elisp/bindings.scm:
* module/language/elisp/compile-tree-il.scm:
* module/language/elisp/lexer.scm:
* module/language/elisp/parser.scm:
* module/language/elisp/runtime.scm:
* module/language/elisp/runtime/function-slot.scm:
* module/language/elisp/runtime/macro-slot.scm: Ensure that all
top-level forms and comments are separated by exactly one newline.
Remove blank lines in most procedure bodies. Delete trailing
whitespace.
Signed-off-by: Andy Wingo <wingo@pobox.com>
Diffstat (limited to 'module/language/elisp/parser.scm')
-rw-r--r-- | module/language/elisp/parser.scm | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/module/language/elisp/parser.scm b/module/language/elisp/parser.scm index 4d9b0c32d..dee683895 100644 --- a/module/language/elisp/parser.scm +++ b/module/language/elisp/parser.scm @@ -28,14 +28,12 @@ ; lexer ((text parse-lalr) seems not to allow access to the original lexer ; token-pair) and is easy enough anyways. - ; Report a parse error. The first argument is some current lexer token ; where source information is available should it be useful. (define (parse-error token msg . args) (apply error msg args)) - ; For parsing circular structures, we keep track of definitions in a ; hash-map that maps the id's to their values. ; When defining a new id, though, we immediatly fill the slot with a promise @@ -64,6 +62,7 @@ ; Returned is a closure that, when invoked, will set the final value. ; This means both the variable the promise will return and the hash-table ; slot so we don't generate promises any longer. + (define (circular-define! token) (if (not (eq? (car token) 'circular-def)) (error "invalid token for circular-define!" token)) @@ -80,6 +79,7 @@ ; this may lead to infinite recursion with a circular structure, and ; additionally this value was already processed when it was defined. ; All deep data structures that can be parsed must be handled here! + (define (force-promises! data) (cond ((pair? data) @@ -102,7 +102,6 @@ ; Else nothing needs to be done. )) - ; We need peek-functionality for the next lexer token, this is done with some ; single token look-ahead storage. This is handled by a closure which allows ; getting or peeking the next token. @@ -128,7 +127,6 @@ result)) (else (error "invalid lexer-buffer action" action)))))))) - ; Get the contents of a list, where the opening parentheses has already been ; found. The same code is used for vectors and lists, where lists allow the ; dotted tail syntax and vectors not; additionally, the closing parenthesis @@ -159,8 +157,6 @@ (tail (get-list lex allow-dot close-square))) (cons head tail)))))) - - ; Parse a single expression from a lexer-buffer. This is the main routine in ; our recursive-descent parser. @@ -197,7 +193,6 @@ (else (parse-error token "expected expression, got" token))))) - ; Define the reader function based on this; build a lexer, a lexer-buffer, ; and then parse a single expression to return. ; We also define a circular-definitions data structure to use. |