[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yaml 2aa5a6faf7 056/124: Merge pull request #16 from co
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yaml 2aa5a6faf7 056/124: Merge pull request #16 from conao3/indent |
Date: |
Fri, 29 Nov 2024 16:00:00 -0500 (EST) |
branch: externals/yaml
commit 2aa5a6faf7e45f4f1bd6e9be3541f9bce807307d
Merge: d8ac09e8ca a47f5a8274
Author: Zachary Romero <zacromero@posteo.net>
Commit: GitHub <noreply@github.com>
Merge pull request #16 from conao3/indent
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] externals/yaml 367f470203 029/124: Add github action file, (continued)
- [elpa] externals/yaml 367f470203 029/124: Add github action file, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a45f60c999 051/124: Merge pull request #8 from zkry/symbol-keys, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 10af746dad 050/124: Add option to convert string keys to symbols, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 96d3e51aeb 048/124: Add yaml-encode feature, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 51023c4551 049/124: Merge pull request #7 from zkry/add-yaml-encode, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 8903b6c7e4 055/124: return plist key as a keyword as a default, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml ed108ab526 084/124: add option for skipping processing of scalars, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a2ed8f1fd6 072/124: Fix empty single quote string bug, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 419e85fbce 094/124: fix folding block parsing error, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 0bf6a1b686 088/124: YAML anchor should match exactly how it was defined, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 2aa5a6faf7 056/124: Merge pull request #16 from conao3/indent,
ELPA Syncer <=
- [elpa] externals/yaml 5b352258f5 067/124: Merge pull request #24 from j-shilling/fix-alist-to-hash, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml d0abc17e3d 060/124: Merge pull request #18 from conao3/alist-symbol, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml e32ef2f5e5 092/124: add note to yaml-parse-string-with-pos function, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml c56d47254d 091/124: add unit test, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 69c699a15a 071/124: Minor code formatting fixes, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 1f15c0b33a 062/124: Merge pull request #20 from j-shilling/fix-encoding-symbols, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml adb3e52a21 081/124: Merge pull request #32 from zkry/fix-encoding-deeply-nested-lists, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 2500074ebf 097/124: Merge pull request #39 from zkry/fix-obob-for-storing-position, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml f9fbe392e3 065/124: Merge pull request #22 from zkry/fix-escape-char-literals, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml fdc65922c9 099/124: fix zero-column indent problems; add more unit tests, ELPA Syncer, 2024/11/29