[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/julia-mode faee243 179/352: Implementing julia-in-string a
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/julia-mode faee243 179/352: Implementing julia-in-string and julia-in-char. |
Date: |
Sun, 29 Aug 2021 11:22:40 -0400 (EDT) |
branch: elpa/julia-mode
commit faee243e6fad50a949da02a8f1a55e1aa5451c54
Author: Wilfred Hughes <me@wilfred.me.uk>
Commit: Yichao Yu <yyc1992@gmail.com>
Implementing julia-in-string and julia-in-char.
---
julia-mode.el | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
diff --git a/julia-mode.el b/julia-mode.el
index b1cfa67..a5b6d94 100644
--- a/julia-mode.el
+++ b/julia-mode.el
@@ -222,6 +222,35 @@ This function provides equivalent functionality, but makes
no efforts to optimis
Handles both single-line and multi-line comments."
(nth 4 (syntax-ppss)))
+(defun julia-in-string ()
+ "Return non-nil if point is inside a string."
+ (nth 3 (syntax-ppss)))
+
+(defun julia-in-char ()
+ "Return non-nil if point is inside a character."
+ (cond
+ ((julia-in-comment) nil)
+ ((julia-in-string) nil)
+ (:else
+ (save-excursion
+ ;; See if point is inside a character, e.g. '|x'
+ ;;
+ ;; Move back past the single quote.
+ (backward-char 1)
+ ;; Move back one more character, as julia-char-regex checks
+ ;; for whitespace/paren/etc before the single quote.
+ (backward-char 1)
+
+ (if (looking-at julia-char-regex)
+ t
+ ;; If point was in a \ character (i.e. we started at '\|\'),
+ ;; we need to move back once more.
+ (if (looking-at (rx "'\\"))
+ (progn
+ (backward-char 1)
+ (looking-at julia-char-regex))
+ nil))))))
+
(defun julia-strcount (str chr)
(let ((i 0)
(c 0))
- [nongnu] elpa/julia-mode 5144c31 149/352: Highlight types in all type annotations., (continued)
- [nongnu] elpa/julia-mode 5144c31 149/352: Highlight types in all type annotations., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 3caccea 148/352: `in` is a keyword, so highlight it., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 6105b93 151/352: Header improvements to conform to MELPA's standards., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 8442201 152/352: All julia functions and variables should be prefixed., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 662e153 169/352: Update .mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e4f0b02 167/352: Ensure ! in a macro invocation is highlighted correctly., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 47ad8e4 158/352: add 1607 new LaTeX tab completions from the unicode-math package (closes #7657), ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 0b96ff5 170/352: Revert "Update .mailmap", ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode d74b8a3 171/352: Use the syntax table to detect if point is in a comment., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 747176f 177/352: fix latex symbol \bot, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode faee243 179/352: Implementing julia-in-string and julia-in-char.,
ELPA Syncer <=
- [nongnu] elpa/julia-mode ab58fb7 193/352: Update mailmap, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 96d6597 194/352: Fixing highlighting of long character escape sequences., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ca2fe4b 195/352: Removing julia-in-char., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode ea54e19 196/352: Fontify strings and chars as strings, not keywords., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 80c6754 197/352: Silencing byte-compiler warning., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode e4d0e09 199/352: Highlight quoted symbols, e.g. :foo., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode 4b22a79 205/352: julia-mode.el: remove types that are removed or deprecated, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f84a425 219/352: Clean up stagedfunction, ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f378cbc 208/352: Mailmap update., ELPA Syncer, 2021/08/29
- [nongnu] elpa/julia-mode f3b490b 210/352: Added inferior-julia comint mode, ELPA Syncer, 2021/08/29