pkg update and first config fix
org-brain not working, add org-roam
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
(define-package "js2-mode" "20211229.135" "Improved JavaScript editing mode"
|
||||
(define-package "js2-mode" "20221028.1819" "Improved JavaScript editing mode"
|
||||
'((emacs "24.1")
|
||||
(cl-lib "0.5"))
|
||||
:commit "997cac4c80a03062145b541b006c51cc91ee0c24" :authors
|
||||
:commit "a297ec2c2d9aa50ddc6c06959bb5a054e17b692a" :authors
|
||||
'(("Steve Yegge" . "steve.yegge@gmail.com")
|
||||
("mooz" . "stillpedant@gmail.com")
|
||||
("Dmitry Gutov" . "dgutov@yandex.ru"))
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
;;; js2-mode.el --- Improved JavaScript editing mode -*- lexical-binding: t -*-
|
||||
|
||||
;; Copyright (C) 2009, 2011-2021 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2009, 2011-2022 Free Software Foundation, Inc.
|
||||
|
||||
;; Author: Steve Yegge <steve.yegge@gmail.com>
|
||||
;; mooz <stillpedant@gmail.com>
|
||||
;; Dmitry Gutov <dgutov@yandex.ru>
|
||||
;; URL: https://github.com/mooz/js2-mode/
|
||||
;; http://code.google.com/p/js2-mode/
|
||||
;; Version: 20211229
|
||||
;; Version: 20220710
|
||||
;; Keywords: languages, javascript
|
||||
;; Package-Requires: ((emacs "24.1") (cl-lib "0.5"))
|
||||
|
||||
@@ -1974,6 +1974,15 @@ the correct number of ARGS must be provided."
|
||||
"not a valid default namespace statement. "
|
||||
"Syntax is: default xml namespace = EXPRESSION;")
|
||||
|
||||
(js2-msg "msg.no.trailing.numeric.literal"
|
||||
"underscore cannot appear after last digit")
|
||||
|
||||
(js2-msg "msg.no.consecutive.numeric.literal"
|
||||
"underscores cannot be next to each other")
|
||||
|
||||
(js2-msg "msg.no.numeric.separator.after.leading.zero"
|
||||
"underscore cannot appear after leading zero")
|
||||
|
||||
;; TokensStream warnings
|
||||
(js2-msg "msg.bad.octal.literal"
|
||||
"illegal octal literal digit %s; "
|
||||
@@ -5677,13 +5686,17 @@ A buffer can only have one scanner active at a time, which yields
|
||||
dramatically simpler code than using a defstruct. If you need to
|
||||
have simultaneous scanners in a buffer, copy the regions to scan
|
||||
into temp buffers."
|
||||
(with-current-buffer (or buf (current-buffer))
|
||||
(save-excursion
|
||||
(and buf (set-buffer buf))
|
||||
(goto-char (point-min))
|
||||
(when (looking-at "#!/")
|
||||
(forward-line 1))
|
||||
(setq js2-ts-dirty-line nil
|
||||
js2-ts-hit-eof nil
|
||||
js2-ts-line-start 0
|
||||
js2-ts-lineno (or line 1)
|
||||
js2-ts-line-end-char -1
|
||||
js2-ts-cursor (point-min)
|
||||
js2-ts-cursor (point)
|
||||
js2-ti-tokens (make-vector js2-ti-ntokens nil)
|
||||
js2-ti-tokens-cursor 0
|
||||
js2-ti-lookahead 0
|
||||
@@ -5898,6 +5911,22 @@ the token is flagged as such."
|
||||
(string-to-number str base)
|
||||
(overflow-error -1)))
|
||||
|
||||
(defun js2-handle-numeric-separator ()
|
||||
"Detect and handle numeric separator ?_."
|
||||
(let ((buffer (nreverse js2-ts-string-buffer))
|
||||
(res nil))
|
||||
(while (> (length buffer) 0)
|
||||
(let ((current-c (car buffer))
|
||||
(next-c (cadr buffer)))
|
||||
(if (eq current-c ?_)
|
||||
(if (or (= (length buffer) 1) (memq next-c '(?. ?e ?E)))
|
||||
(js2-report-scan-error "msg.no.trailing.numeric.literal")
|
||||
(when (= (cadr buffer) ?_)
|
||||
(js2-report-scan-error "msg.no.consecutive.numeric.literal")))
|
||||
(push (car buffer) res)))
|
||||
(setq buffer (cdr buffer)))
|
||||
(setq js2-ts-string-buffer res)))
|
||||
|
||||
(defun js2-get-token-internal-1 (modifier)
|
||||
"Return next JavaScript token type, an int such as js2-RETURN.
|
||||
During operation, creates an instance of `js2-token' struct, sets
|
||||
@@ -6025,6 +6054,7 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
(when (eq c ?0)
|
||||
(setq c (js2-get-char))
|
||||
(cond
|
||||
((eq c ?_) (js2-report-scan-error "msg.no.numeric.separator.after.leading.zero"))
|
||||
((or (eq c ?x) (eq c ?X))
|
||||
(setq base 16)
|
||||
(setq c (js2-get-char)))
|
||||
@@ -6045,23 +6075,23 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
((eq base 16)
|
||||
(if (> 0 (js2-x-digit-to-int c 0))
|
||||
(js2-report-scan-error "msg.missing.hex.digits")
|
||||
(while (<= 0 (js2-x-digit-to-int c 0))
|
||||
(while (or (<= 0 (js2-x-digit-to-int c 0)) (= c ?_))
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char)))))
|
||||
((eq base 2)
|
||||
(if (not (memq c '(?0 ?1)))
|
||||
(js2-report-scan-error "msg.missing.binary.digits")
|
||||
(while (memq c '(?0 ?1))
|
||||
(while (memq c '(?0 ?1 ?_))
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char)))))
|
||||
((eq base 8)
|
||||
(if (or (> ?0 c) (< ?7 c))
|
||||
(js2-report-scan-error "msg.missing.octal.digits")
|
||||
(while (and (<= ?0 c) (>= ?7 c))
|
||||
(while (or (and (<= ?0 c) (>= ?7 c)) (= c ?_))
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char)))))
|
||||
(t
|
||||
(while (and (<= ?0 c) (<= c ?9))
|
||||
(while (or (and (<= ?0 c) (<= c ?9)) (= c ?_))
|
||||
;; We permit 08 and 09 as decimal numbers, which
|
||||
;; makes our behavior a superset of the ECMA
|
||||
;; numeric grammar. We might not always be so
|
||||
@@ -6080,7 +6110,7 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
(cl-loop do
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char))
|
||||
while (js2-digit-p c)))
|
||||
while (or (js2-digit-p c) (= c ?_))))
|
||||
(when (memq c '(?e ?E))
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char))
|
||||
@@ -6092,8 +6122,15 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
(cl-loop do
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char))
|
||||
while (js2-digit-p c))))
|
||||
while (or (js2-digit-p c) (= c ?_)))))
|
||||
(js2-unget-char)
|
||||
(js2-handle-numeric-separator)
|
||||
(let ((string js2-ts-string-buffer))
|
||||
(while (> (length string) 0)
|
||||
(when (and (eq (car string) ?_))
|
||||
(if (= (length string) 1)
|
||||
(js2-report-scan-error "msg.no.trailing.numeric.literal")))
|
||||
(setq string (cdr string))))
|
||||
(let ((str (js2-set-string-from-buffer token)))
|
||||
(setf (js2-token-number token) (js2-string-to-number str base)
|
||||
(js2-token-number-base token) base
|
||||
@@ -6304,15 +6341,16 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
(catch 'break
|
||||
(while (/= c quote-char)
|
||||
(catch 'continue
|
||||
(when (eq c js2-EOF_CHAR)
|
||||
(cond
|
||||
((eq c js2-EOF_CHAR)
|
||||
(js2-unget-char)
|
||||
(js2-report-error "msg.unterminated.string.lit")
|
||||
(throw 'break nil))
|
||||
(when (and (eq c ?\n) (not (eq quote-char ?`)))
|
||||
((and (eq c ?\n) (not (eq quote-char ?`)))
|
||||
(js2-unget-char)
|
||||
(js2-report-error "msg.unterminated.string.lit")
|
||||
(throw 'break nil))
|
||||
(when (eq c ?\\)
|
||||
((eq c ?\\)
|
||||
;; We've hit an escaped character
|
||||
(setq c (js2-get-char))
|
||||
(cl-case c
|
||||
@@ -6390,10 +6428,10 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
c (js2-get-char))))
|
||||
(js2-unget-char)
|
||||
(setq c val)))))
|
||||
(when (and (eq quote-char ?`) (eq c ?$))
|
||||
((and (eq quote-char ?`) (eq c ?$))
|
||||
(when (eq (setq nc (js2-get-char)) ?\{)
|
||||
(throw 'break nil))
|
||||
(js2-unget-char))
|
||||
(js2-unget-char)))
|
||||
(js2-add-to-string c)
|
||||
(setq c (js2-get-char)))))
|
||||
(js2-set-string-from-buffer token)
|
||||
@@ -6444,12 +6482,16 @@ its relevant fields and puts it into `js2-ti-tokens'."
|
||||
'syntax-table (string-to-syntax "\"/")))
|
||||
(while continue
|
||||
(cond
|
||||
((js2-match-char ?d)
|
||||
(push ?d flags))
|
||||
((js2-match-char ?g)
|
||||
(push ?g flags))
|
||||
((js2-match-char ?i)
|
||||
(push ?i flags))
|
||||
((js2-match-char ?m)
|
||||
(push ?m flags))
|
||||
((js2-match-char ?s)
|
||||
(push ?s flags))
|
||||
((and (js2-match-char ?u)
|
||||
(>= js2-language-version 200))
|
||||
(push ?u flags))
|
||||
@@ -8022,7 +8064,7 @@ string is NAME. Returns nil and keeps current token otherwise."
|
||||
nil)
|
||||
;; The parse was successful, so process and return the "await".
|
||||
(js2-record-face 'font-lock-keyword-face current-token)
|
||||
(unless (js2-inside-async-function)
|
||||
(unless (or (js2-inside-async-function) (equal js2-nesting-of-function 0))
|
||||
(js2-report-error "msg.bad.await" nil
|
||||
beg (- end beg)))
|
||||
pn))))
|
||||
@@ -10336,11 +10378,11 @@ Returns the list in reverse order. Consumes the right-paren token."
|
||||
pn pos target args beg end init)
|
||||
(if (/= tt js2-NEW)
|
||||
(setq pn (js2-parse-primary-expr))
|
||||
(setq pos (js2-current-token-beg)
|
||||
beg pos)
|
||||
;; parse a 'new' expression
|
||||
(js2-get-token)
|
||||
(setq pos (js2-current-token-beg)
|
||||
beg pos
|
||||
target (js2-parse-member-expr)
|
||||
(setq target (js2-parse-member-expr)
|
||||
end (js2-node-end target)
|
||||
pn (make-js2-new-node :pos pos
|
||||
:target target
|
||||
@@ -11719,7 +11761,7 @@ highlighting features of `js2-mode'."
|
||||
(defun js2-minor-mode-exit ()
|
||||
"Turn off `js2-minor-mode'."
|
||||
(setq next-error-function nil)
|
||||
(remove-hook 'after-change-functions #'js2-mode-edit t)
|
||||
(remove-hook 'after-change-functions #'js2-minor-mode-edit t)
|
||||
(remove-hook 'change-major-mode-hook #'js2-minor-mode-exit t)
|
||||
(when js2-mode-node-overlay
|
||||
(delete-overlay js2-mode-node-overlay)
|
||||
|
||||
Reference in New Issue
Block a user