[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode fc44ae6 026/352: more work on type inference; a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode fc44ae6 026/352: more work on type inference; adding isbound() |
Date: |
Sun, 29 Aug 2021 11:22:09 -0400 (EDT) |
branch: elpa/julia-mode
commit fc44ae63709d0560e4ed83caa6d551e4ddf1c07c
Author: Jeff Bezanson <bezanson@post.harvard.edu>
Commit: Yichao Yu <yyc1992@gmail.com>
more work on type inference; adding isbound()
convert for Bool, removing non-numeric definitions of bool()
adding Complex(real), simplifying ^
don't indent based on keywords used as field names (e.g. e.type)
---
julia-mode.el | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/julia-mode.el b/julia-mode.el
index fbbe950..09b26e8 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -67,14 +67,19 @@
(or (equal item (car lst))
(member item (cdr lst)))))
-; TODO: skip keywords inside strings
+; TODO: skip keywords inside strings and comments
+
+(defun at-keyword (kw-list)
+ (and (or (= (point) 1)
+ (not (equal (char-before (point)) ?.)))
+ (member (current-word) kw-list)))
; get the column of the last open block
(defun last-open-block (min count)
(cond ((> count 0) (+ 4 (current-indentation)))
((<= (point) min) nil)
(t (backward-word 1)
- (cond ((member (current-word) julia-block-start-keywords)
+ (cond ((at-keyword julia-block-start-keywords)
(last-open-block min (+ count 1)))
((equal (current-word) "end")
(last-open-block min (- count 1)))
@@ -85,14 +90,13 @@
(forward-line -1)
(end-of-line)
(backward-sexp)
- (if (member (current-word) julia-block-other-keywords)
+ (if (at-keyword julia-block-other-keywords)
(+ 4 (current-indentation))
(if (char-equal (char-after (point)) ?\()
(progn
(backward-word 1)
- (let ((cur (current-indentation))
- (cw (current-word)))
- (if (member cw julia-block-start-keywords)
+ (let ((cur (current-indentation)))
+ (if (at-keyword julia-block-start-keywords)
(+ 4 cur)
nil)))
nil)))
@@ -130,7 +134,7 @@
(let ((endtok (progn
(beginning-of-line)
(forward-to-indentation 0)
- (member (current-word) julia-block-end-keywords))))
+ (at-keyword julia-block-end-keywords))))
(error2nil (+ (last-open-block (point-min) 0)
(if endtok -4 0)))))
; take same indentation as previous line
@@ -146,7 +150,7 @@
(equal (char-after (point)) ?=)))
4 nil))
0))
- (when (member (current-word) julia-block-end-keywords)
+ (when (at-keyword julia-block-end-keywords)
(forward-word 1)))
(defun julia-mode ()
- [nongnu] elpa/julia-mode f288f0d 007/352: giving functions proper function types instead of just opaque tags, (continued)
- [nongnu] elpa/julia-mode f288f0d 007/352: giving functions proper function types instead of just opaque tags, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 274e4c5 009/352: adding convert() and conversion syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d678dc6 005/352: this is the promised round of type system changes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0e556ea 011/352: a bit of file reorganization, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e758c85 001/352: initial empty commit, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 099ca3b 006/352: clarifying some types; using Size and Index where appropriate, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode adaaa34 010/352: fixing parser bug when a file ends with comments, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0a0b373 008/352: adding some conversion machinery, refactoring generic functions, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3525c74 012/352: implementing typed locations: field, buffer elt, declared local var, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 89e42a4 023/352: Minor updates to julia-mode for Ptr and eval., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode fc44ae6 026/352: more work on type inference; adding isbound(),
ELPA Syncer <=
- [nongnu] elpa/julia-mode 06ff69e 027/352: type does not use block syntax, fix emacs mode, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 02d443b 034/352: fixing type inference for builtin cases of convert(), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode c01429b 044/352: fixing some integer sizes, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3ae6315 046/352: improving indenting of block syntax inside parens, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode dbe56c0 050/352: Work on sparse binary operators, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0bd625b 028/352: misc. stuff:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode efce160 032/352: adding bitstype syntax, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 29c7950 033/352: adding boot.j, allowing us to move more primitive definitions to julia, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6ae7fab 043/352: improvements to julia-mode indenting:, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 2f7441b 058/352: AbstractArray, AbstractVector, AbstractMatrix highlighting in julia-mode.el, ELPA Syncer, 2021/08/29