summaryrefslogtreecommitdiff
path: root/module/language/elisp
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2013-11-01 18:23:51 +0100
committerAndy Wingo <wingo@pobox.com>2013-11-01 18:23:51 +0100
commit14b9aa95e61e2d593bd96ab0a7675ed72d55503c (patch)
tree3f81adb2e268d1286ad3fc85fa0d8e35712274bf /module/language/elisp
parentb681671ede9cefcbfa9d59169030b013f5ddfc6a (diff)
downloadguile-14b9aa95e61e2d593bd96ab0a7675ed72d55503c.tar.gz
Fix order of evaluation in elisp lexer
* module/language/elisp/lexer.scm (lex): Use let*, to ensure that the port position is read before reading the next char.
Diffstat (limited to 'module/language/elisp')
-rw-r--r--module/language/elisp/lexer.scm30
1 files changed, 15 insertions, 15 deletions
diff --git a/module/language/elisp/lexer.scm b/module/language/elisp/lexer.scm
index 1933ff34d..5a0e6b3ff 100644
--- a/module/language/elisp/lexer.scm
+++ b/module/language/elisp/lexer.scm
@@ -1,6 +1,6 @@
;;; Guile Emacs Lisp
-;;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+;;; Copyright (C) 2009, 2010, 2013 Free Software Foundation, Inc.
;;;
;;; This library is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU Lesser General Public
@@ -261,20 +261,20 @@
(and=> (regexp-exec lexical-binding-regexp string)
(lambda (match)
(not (member (match:substring match 2) '("nil" "()"))))))
- (let ((return (let ((file (if (file-port? port)
- (port-filename port)
- #f))
- (line (1+ (port-line port)))
- (column (1+ (port-column port))))
- (lambda (token value)
- (let ((obj (cons token value)))
- (set-source-property! obj 'filename file)
- (set-source-property! obj 'line line)
- (set-source-property! obj 'column column)
- obj))))
- ;; Read afterwards so the source-properties are correct above
- ;; and actually point to the very character to be read.
- (c (read-char port)))
+ (let* ((return (let ((file (if (file-port? port)
+ (port-filename port)
+ #f))
+ (line (1+ (port-line port)))
+ (column (1+ (port-column port))))
+ (lambda (token value)
+ (let ((obj (cons token value)))
+ (set-source-property! obj 'filename file)
+ (set-source-property! obj 'line line)
+ (set-source-property! obj 'column column)
+ obj))))
+ ;; Read afterwards so the source-properties are correct above
+ ;; and actually point to the very character to be read.
+ (c (read-char port)))
(cond
;; End of input must be specially marked to the parser.
((eof-object? c) (return 'eof c))