emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/julia-mode 099ca3b 006/352: clarifying some types; using S


From: ELPA Syncer
Subject: [nongnu] elpa/julia-mode 099ca3b 006/352: clarifying some types; using Size and Index where appropriate
Date: Sun, 29 Aug 2021 11:22:05 -0400 (EDT)

branch: elpa/julia-mode
commit 099ca3b9cdb677f7e840caa11c0c1e0768d5dd1b
Author: Jeff Bezanson <bezanson@post.harvard.edu>
Commit: Yichao Yu <yyc1992@gmail.com>

    clarifying some types; using Size and Index where appropriate
    making buffers invariant, fixes to allow buffers of both boxed and
      unboxed types
    adding basic List type and functions. so far only List[Any] is supported.
    fixing bug in varargs with 0 arguments
    fixing bug in julia-mode on else/elseif
    fixing bug parsing empty blocks
---
 julia-mode.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/julia-mode.el b/julia-mode.el
index 952df85..bb252b7 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -38,7 +38,7 @@
   "Syntax table for julia-mode")
 
 (defconst julia-font-lock-keywords
-  (list 
'("\\<\\(true\\|false\\|\\|Uint\\(8\\|16\\|32\\|64\\)\\|Int\\(8\\|16\\|32\\|64\\)\\|Float\\|Double\\|Boolean\\|Scalar\\|Real\\|Int\\|Tensor\\|Array\\|Tuple\\|Buffer\\|Size\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|Any\\|Bottom\\)\\>"
 .
+  (list 
'("\\<\\(true\\|false\\|\\|Uint\\(8\\|16\\|32\\|64\\)\\|Int\\(8\\|16\\|32\\|64\\)\\|Float\\|Double\\|Boolean\\|Scalar\\|Real\\|Int\\|Tensor\\|Array\\|Tuple\\|Buffer\\|Size\\|Index\\|Symbol\\|Function\\|Vector\\|Matrix\\|Union\\|Type\\|Any\\|Bottom\\)\\>"
 .
       font-lock-type-face)
     (cons
      (concat "\\<\\("
@@ -57,6 +57,9 @@
 (defconst julia-block-other-keywords
   (list "else" "elseif"))
 
+(defconst julia-block-end-keywords
+  (list "end" "else" "elseif"))
+
 (defun member (item lst)
   (if (null lst)
       nil
@@ -124,7 +127,7 @@
            (let ((endtok (progn
                            (beginning-of-line)
                            (forward-to-indentation 0)
-                           (equal (current-word) "end"))))
+                           (member (current-word) julia-block-end-keywords))))
              (error2nil (+ (last-open-block (point-min) 0)
                            (if endtok -4 0)))))
 ; take same indentation as previous line
@@ -140,7 +143,8 @@
                                          (equal (char-after (point)) ?=)))
                           4 nil))
          0))
-       (when (equal (current-word) "end") (forward-word 1)))
+       (when (member (current-word) julia-block-end-keywords)
+         (forward-word 1)))
 
 (defun julia-mode ()
   "Major mode for editing julia code"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]