[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yaml a47f5a8274 054/124: indent buffer
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yaml a47f5a8274 054/124: indent buffer |
Date: |
Fri, 29 Nov 2024 16:00:00 -0500 (EST) |
branch: externals/yaml
commit a47f5a8274048eec790c99209179d84fbea2b5d1
Author: Naoya Yamashita <conao3@gmail.com>
Commit: Naoya Yamashita <conao3@gmail.com>
indent buffer
---
yaml-tests.el | 20 +++----
yaml.el | 166 +++++++++++++++++++++++++++++-----------------------------
2 files changed, 93 insertions(+), 93 deletions(-)
diff --git a/yaml-tests.el b/yaml-tests.el
index aee8f78246..7df19c9663 100644
--- a/yaml-tests.el
+++ b/yaml-tests.el
@@ -429,16 +429,16 @@ foo: bar
- c"))
;; example 8.1
-;; (should (yaml-parse-string "- |
-;; \sdetected
-;; - >
-;; \s
-;; \s\s
-;; \s\s# detected
-;; - |1
-;; \s\sexplicit
-;; - >
-;; \s\t
+ ;; (should (yaml-parse-string "- |
+ ;; \sdetected
+ ;; - >
+ ;; \s
+ ;; \s\s
+ ;; \s\s# detected
+ ;; - |1
+ ;; \s\sexplicit
+ ;; - >
+ ;; \s\t
;; \sdetected"))
diff --git a/yaml.el b/yaml.el
index a858a82d76..6f2f583b7f 100644
--- a/yaml.el
+++ b/yaml.el
@@ -51,20 +51,20 @@
This flag is intended for development purposes.")
(defconst yaml--tracing-ignore '("s-space"
- "s-tab"
- "s-white"
- "l-comment"
- "b-break"
- "b-line-feed"
- "b-carriage-return"
- "s-b-comment"
- "b-comment"
- "l-comment"
- "ns-char"
- "nb-char"
- "b-char"
- "c-printable"
- "b-as-space"))
+ "s-tab"
+ "s-white"
+ "l-comment"
+ "b-break"
+ "b-line-feed"
+ "b-carriage-return"
+ "s-b-comment"
+ "b-comment"
+ "l-comment"
+ "ns-char"
+ "nb-char"
+ "b-char"
+ "c-printable"
+ "b-as-space"))
(defvar yaml--parsing-input ""
"The string content of the current item being processed.")
@@ -80,7 +80,7 @@ This flag is intended for development purposes.")
(defvar yaml--parsing-false-object nil)
(cl-defstruct (yaml--state (:constructor yaml--state-create)
- (:copier nil))
+ (:copier nil))
doc tt m name lvl beg end)
(defmacro yaml--parse (data &rest forms)
@@ -103,12 +103,12 @@ This flag is intended for development purposes.")
(while states
(let* ((top-state (car states))
(new-state (yaml--state-create :doc (yaml--state-doc top-state)
- :tt (yaml--state-tt top-state)
- :m val
- :name (yaml--state-name top-state)
- :lvl (yaml--state-lvl top-state)
- :beg (yaml--state-beg top-state)
- :end (yaml--state-end top-state))))
+ :tt (yaml--state-tt top-state)
+ :m val
+ :name (yaml--state-name top-state)
+ :lvl (yaml--state-lvl top-state)
+ :beg (yaml--state-beg top-state)
+ :end (yaml--state-end top-state))))
(setcar states new-state))
(setq states (cdr states)))))
@@ -118,12 +118,12 @@ This flag is intended for development purposes.")
(while states
(let* ((top-state (car states))
(new-state (yaml--state-create :doc (yaml--state-doc top-state)
- :tt val
- :m (yaml--state-m top-state)
- :name (yaml--state-name top-state)
- :lvl (yaml--state-lvl top-state)
- :beg (yaml--state-beg top-state)
- :end (yaml--state-end top-state))))
+ :tt val
+ :m (yaml--state-m top-state)
+ :name (yaml--state-name top-state)
+ :lvl (yaml--state-lvl top-state)
+ :beg (yaml--state-beg top-state)
+ :end (yaml--state-end top-state))))
(setcar states new-state))
(setq states (cdr states)))))
@@ -147,40 +147,40 @@ This flag is intended for development purposes.")
"Add a new state frame with NAME."
(let* ((curr-state (yaml--state-curr))
(new-state (yaml--state-create
- :doc (yaml--state-curr-doc)
- :tt (yaml--state-curr-t)
- :m (yaml--state-curr-m)
- :name name
- :lvl (1+ (yaml--state-lvl curr-state))
- :beg yaml--parsing-position
- :end nil)))
+ :doc (yaml--state-curr-doc)
+ :tt (yaml--state-curr-t)
+ :m (yaml--state-curr-m)
+ :name name
+ :lvl (1+ (yaml--state-lvl curr-state))
+ :beg yaml--parsing-position
+ :end nil)))
(push new-state yaml--states)))
(defun yaml--pop-state ()
"Pop the current state."
(let ((popped-state (car yaml--states)))
- (setq yaml--states (cdr yaml--states))
- (let ((top-state (car yaml--states)))
- (when top-state
- (setcar yaml--states
- (yaml--state-create :doc (yaml--state-doc top-state)
- :tt (yaml--state-tt top-state)
- :m (yaml--state-m top-state)
- :name (yaml--state-name top-state)
- :lvl (yaml--state-lvl top-state)
- :beg (yaml--state-beg popped-state)
- :end yaml--parsing-position))))))
+ (setq yaml--states (cdr yaml--states))
+ (let ((top-state (car yaml--states)))
+ (when top-state
+ (setcar yaml--states
+ (yaml--state-create :doc (yaml--state-doc top-state)
+ :tt (yaml--state-tt top-state)
+ :m (yaml--state-m top-state)
+ :name (yaml--state-name top-state)
+ :lvl (yaml--state-lvl top-state)
+ :beg (yaml--state-beg popped-state)
+ :end yaml--parsing-position))))))
(defun yaml--initialize-state ()
"Initialize the yaml state for parsing."
(setq yaml--states
(list (yaml--state-create :doc nil
- :tt nil
- :m nil
- :name nil
- :lvl 0
- :beg nil
- :end nil))))
+ :tt nil
+ :m nil
+ :name nil
+ :lvl 0
+ :beg nil
+ :end nil))))
(defconst yaml--grammar-resolution-rules
'(("ns-plain" . literal))
@@ -216,12 +216,12 @@ This flag is intended for development purposes.")
(char (and (< pos (length header)) (aref header pos)))
(process-char (lambda (char)
(when char
- (cond
- ((< ?0 char ?9)
- (progn (setq indentation-indicator (- char ?0))))
- ((equal char ?\-) (setq chomp-indicator :strip))
- ((equal char ?\+) (setq chomp-indicator :keep)))
- (setq pos (1+ pos))))))
+ (cond
+ ((< ?0 char ?9)
+ (progn (setq indentation-indicator (- char ?0))))
+ ((equal char ?\-) (setq chomp-indicator :strip))
+ ((equal char ?\+) (setq chomp-indicator :keep)))
+ (setq pos (1+ pos))))))
(when (or (eq char ?\|) (eq char ?\>))
(setq pos (1+ pos))
(setq char (and (< pos (length header)) (aref header pos))))
@@ -551,7 +551,7 @@ reverse order."
(if (> (length x) 1)
(substring x 1)
"'"))
- replaced)))
+ replaced)))
(yaml--scalar-event "single" (substring replaced
1 (1- (length replaced)))))))
("c-double-quoted" . (lambda (text)
(let* ((replaced (replace-regexp-in-string
@@ -665,28 +665,28 @@ reverse order."
(replace-regexp-in-string "\n" "↓" (yaml--slice
yaml--parsing-position)))))
(_ (yaml--push-state ,name))
(,res-symbol ,rule))
- (when (and yaml--parse-debug ,res-symbol (not (member ,name
yaml--tracing-ignore)))
- (message "<%s|%s %40s = '%s'"
- (make-string (length yaml--states) ?-)
- (make-string (- 70 (length yaml--states)) ?\s)
- ,name
- (replace-regexp-in-string "\n" "↓" (substring
yaml--parsing-input beg yaml--parsing-position))))
- (yaml--pop-state)
- (if (not ,res-symbol)
- nil
- (let ((res-type (cdr (assoc ,name yaml--grammar-resolution-rules)))
- (,res-symbol (if (member ,name yaml--terminal-rules)
- t ;; Ignore children if at-rule is indicated to
be terminal.
- ,res-symbol)))
- (cond
- ((or (assoc ,name yaml--grammar-events-in)
- (assoc ,name yaml--grammar-events-out))
- (list ,name
- (substring yaml--parsing-input beg yaml--parsing-position)
- ,res-symbol))
- ((equal res-type 'list) (list ,name ,res-symbol))
- ((equal res-type 'literal) (substring yaml--parsing-input beg
yaml--parsing-position))
- (t ,res-symbol)))))))
+ (when (and yaml--parse-debug ,res-symbol (not (member ,name
yaml--tracing-ignore)))
+ (message "<%s|%s %40s = '%s'"
+ (make-string (length yaml--states) ?-)
+ (make-string (- 70 (length yaml--states)) ?\s)
+ ,name
+ (replace-regexp-in-string "\n" "↓" (substring
yaml--parsing-input beg yaml--parsing-position))))
+ (yaml--pop-state)
+ (if (not ,res-symbol)
+ nil
+ (let ((res-type (cdr (assoc ,name yaml--grammar-resolution-rules)))
+ (,res-symbol (if (member ,name yaml--terminal-rules)
+ t ;; Ignore children if at-rule is indicated
to be terminal.
+ ,res-symbol)))
+ (cond
+ ((or (assoc ,name yaml--grammar-events-in)
+ (assoc ,name yaml--grammar-events-out))
+ (list ,name
+ (substring yaml--parsing-input beg yaml--parsing-position)
+ ,res-symbol))
+ ((equal res-type 'list) (list ,name ,res-symbol))
+ ((equal res-type 'literal) (substring yaml--parsing-input beg
yaml--parsing-position))
+ (t ,res-symbol)))))))
(defun yaml--end-of-stream ()
"Return non-nil if the current position is after the end of the document."
@@ -745,7 +745,7 @@ reverse order."
`(yaml--run-all
,@(mapcar (lambda (form)
`(lambda () ,form))
- forms)))
+ forms)))
(defmacro yaml--any (&rest forms)
"Pass if any of FORMS pass."
@@ -2397,8 +2397,8 @@ If AUTO-INDENT is non-nil, start the list on the current
line,
auto-detecting the indentation. Functionality defers to
`yaml--encode-list'."
(yaml--encode-list (seq-map #'identity a)
- indent
- auto-indent))
+ indent
+ auto-indent))
(defun yaml--encode-scalar (s)
- [elpa] branch externals/yaml created (now 70c4fcead9), ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 57254d464a 002/124: update schema, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml b33b2ba412 003/124: Add test file, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 891e158930 008/124: Got parser mostly working., ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 04aae95584 043/124: Fix/add pcase usages, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 67d4b64d15 022/124: Bug fixes, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 95283d460f 034/124: Add emacs 25.1 CI test, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 67e8b5f3dc 096/124: Fix off-by-one bug for storing position, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a47f5a8274 054/124: indent buffer,
ELPA Syncer <=
- [elpa] externals/yaml 164cd43d6e 087/124: Merge pull request #34 from zkry/fix-bad-anchor-map->list-conversion, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml e711e774b1 074/124: Allow parsing false and/or null as nil, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 50a3a00cb8 061/124: FIX insert symbol name when not equal to :null or :false, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml ee9001e091 063/124: Fix the escape character in parser (after /), ELPA Syncer, 2024/11/29
- [elpa] externals/yaml ee86566af1 114/124: Merge pull request #47 from tarsiiformes/typos, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a15b045399 010/124: Condense grammar functions to one, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 0bb76de608 009/124: Add YAML scalar conversion and type conversion, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 840be1b2b2 012/124: | blocks parse, initial wip, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 64c117d084 052/124: Fix encoding issues for nil, false, and arrays, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 67d86e158e 033/124: Add code documentation; remove unused code, ELPA Syncer, 2024/11/29