]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/wisi/wisi.el
Merge commit '37c46180280f10fa5120a017acd04f7022d124e4'
[gnu-emacs-elpa] / packages / wisi / wisi.el
old mode 100755 (executable)
new mode 100644 (file)
index 5a7c17d..a748f62
@@ -1,4 +1,4 @@
-;;; wisi.el --- Utilities for implementing an indentation/navigation engine using a generalized LALR parser
+;;; wisi.el --- Utilities for implementing an indentation/navigation engine using a generalized LALR parser -*- lexical-binding:t -*-
 ;;
 ;; Copyright (C) 2012 - 2015  Free Software Foundation, Inc.
 ;;
 
 (defun wisi-number-p (token-text)
   "Return t if TOKEN-TEXT plus text after point matches the
-syntax for a real literal; otherwise nil. point is after
+syntax for a real literal; otherwise nil.  Point is after
 TOKEN-TEXT; move point to just past token."
-  ;; typical literals:
+  ;; Typical literals:
   ;; 1234
   ;; 1234.5678
   ;; _not_ including non-decimal base, or underscores (see ada-wisi-number-p)
   ;;
-  (let ((end (point)))
-    ;; starts with a simple integer
-    (when (string-match "^[0-9]+$" token-text)
-      (when (looking-at "\\.[0-9]+")
-       ;; real number
-       (goto-char (setq end (match-end 0)))
-       (when (looking-at  "[Ee][+-][0-9]+")
-         ;; exponent
-         (goto-char (setq end (match-end 0)))))
-
-      t
-      )))
+  ;; Starts with a simple integer
+  (when (string-match "^[0-9]+$" token-text)
+    (when (looking-at "\\.[0-9]+")
+      ;; real number
+      (goto-char (match-end 0))
+      (when (looking-at  "[Ee][+-][0-9]+")
+        ;; exponent
+        (goto-char (match-end 0))))
+
+    t
+    ))
 
 (defun wisi-forward-token ()
   "Move point forward across one token, skipping leading whitespace and comments.
@@ -720,7 +719,7 @@ If accessing cache at a marker for a token as set by `wisi-cache-tokens', POS mu
          (message "%s done" msg)))
       )))
 
-(defun wisi-fontify-region (begin end)
+(defun wisi-fontify-region (_begin end)
   "For `jit-lock-functions'."
   (when (< (point-max) wisi-size-threshold)
     (wisi-validate-cache end)))