[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/yaml ab86db9bb2 044/124: Merge pull request #4 from zkr
From: |
ELPA Syncer |
Subject: |
[elpa] externals/yaml ab86db9bb2 044/124: Merge pull request #4 from zkry/pcase-related-modifications |
Date: |
Fri, 29 Nov 2024 15:59:58 -0500 (EST) |
branch: externals/yaml
commit ab86db9bb27343567ec6140647765547dbf916f7
Merge: e2fe7e2e57 04aae95584
Author: Zachary Romero <zacromero@posteo.net>
Commit: GitHub <noreply@github.com>
Merge pull request #4 from zkry/pcase-related-modifications
Fix/add pcase usages
---
yaml.el | 103 +++++++++++++++++++++++++++++++++++-----------------------------
1 file changed, 56 insertions(+), 47 deletions(-)
diff --git a/yaml.el b/yaml.el
index 8468d717bc..4e4a8da547 100644
--- a/yaml.el
+++ b/yaml.el
@@ -1202,11 +1202,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
(let ((n (nth 0 args))
(c (nth 1 args)))
(yaml--frame "ns-plain"
- (cond
- ((equal c "block-key") (yaml--parse-from-grammar 'ns-plain-one-line
c))
- ((equal c "flow-in") (yaml--parse-from-grammar 'ns-plain-multi-line
n c))
- ((equal c "flow-key") (yaml--parse-from-grammar 'ns-plain-one-line
c))
- ((equal c "flow-out") (yaml--parse-from-grammar 'ns-plain-multi-line
n c))))))
+ (pcase c
+ ("block-key" (yaml--parse-from-grammar 'ns-plain-one-line c))
+ ("flow-in" (yaml--parse-from-grammar 'ns-plain-multi-line n c))
+ ("flow-key" (yaml--parse-from-grammar 'ns-plain-one-line c))
+ ("flow-out" (yaml--parse-from-grammar 'ns-plain-multi-line n c))))))
('c-printable
(yaml--frame "c-printable"
@@ -1262,10 +1262,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
('nb-single-text
(let ((n (nth 0 args)) (c (nth 1 args)))
(yaml--frame "nb-single-text"
- (cond ((equal c "block-key") (yaml--parse-from-grammar
'nb-single-one-line))
- ((equal c "flow-in") (yaml--parse-from-grammar
'nb-single-multi-line n))
- ((equal c "flow-key") (yaml--parse-from-grammar
'nb-single-one-line))
- ((equal c "flow-out") (yaml--parse-from-grammar
'nb-single-multi-line n))))))
+ (pcase c
+ ("block-key" (yaml--parse-from-grammar 'nb-single-one-line))
+ ("flow-in" (yaml--parse-from-grammar 'nb-single-multi-line n))
+ ("flow-key" (yaml--parse-from-grammar 'nb-single-one-line))
+ ("flow-out" (yaml--parse-from-grammar 'nb-single-multi-line n))))))
('s-indent-le
(let ((n (nth 0 args)))
@@ -1280,9 +1281,10 @@ Rules for this function are defined by the yaml-spec
JSON file."
(let ((n (nth 0 args))
(tt (nth 1 args)))
(yaml--frame "l-chomped-empty"
- (cond ((equal tt "clip") (yaml--parse-from-grammar 'l-strip-empty n))
- ((equal tt "keep") (yaml--parse-from-grammar 'l-keep-empty n))
- ((equal tt "strip") (yaml--parse-from-grammar 'l-strip-empty
n))))))
+ (pcase tt
+ ("clip" (yaml--parse-from-grammar 'l-strip-empty n))
+ ("keep" (yaml--parse-from-grammar 'l-keep-empty n))
+ ("strip" (yaml--parse-from-grammar 'l-strip-empty n))))))
('c-s-implicit-json-key
(let ((c (nth 0 args)))
@@ -1331,16 +1333,17 @@ Rules for this function are defined by the yaml-spec
JSON file."
('b-chomped-last
(let ((tt (nth 0 args)))
(yaml--frame "b-chomped-last"
- (cond ((equal tt "clip")
- ;; TODO: Fix this
- (yaml--any (yaml--parse-from-grammar 'b-as-line-feed)
- (yaml--end-of-stream)))
- ((equal tt "keep")
- (yaml--any (yaml--parse-from-grammar 'b-as-line-feed)
- (yaml--end-of-stream)))
- ((equal tt "strip")
- (yaml--any (yaml--parse-from-grammar 'b-non-content)
- (yaml--end-of-stream)))))))
+ (pcase tt
+ ("clip"
+ ;; TODO: Fix this
+ (yaml--any (yaml--parse-from-grammar 'b-as-line-feed)
+ (yaml--end-of-stream)))
+ ("keep"
+ (yaml--any (yaml--parse-from-grammar 'b-as-line-feed)
+ (yaml--end-of-stream)))
+ ("strip"
+ (yaml--any (yaml--parse-from-grammar 'b-non-content)
+ (yaml--end-of-stream)))))))
('l-trail-comments
(let ((n (nth 0 args)))
@@ -1549,8 +1552,9 @@ Rules for this function are defined by the yaml-spec JSON
file."
('seq-spaces
(let ((n (nth 0 args)) (c (nth 1 args)))
(yaml--frame "seq-spaces"
- (cond ((equal c "block-in") n)
- ((equal c "block-out") (yaml--sub n 1))))))
+ (pcase c
+ ("block-in" n)
+ ("block-out" (yaml--sub n 1))))))
('l-yaml-stream
(yaml--frame "l-yaml-stream"
@@ -1741,10 +1745,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
('nb-double-text
(let ((n (nth 0 args)) (c (nth 1 args)))
(yaml--frame "nb-double-text"
- (cond ((equal c "block-key") (yaml--parse-from-grammar
'nb-double-one-line))
- ((equal c "flow-in") (yaml--parse-from-grammar
'nb-double-multi-line n))
- ((equal c "flow-key") (yaml--parse-from-grammar
'nb-double-one-line))
- ((equal c "flow-out") (yaml--parse-from-grammar
'nb-double-multi-line n))))))
+ (pcase c
+ ("block-key" (yaml--parse-from-grammar 'nb-double-one-line))
+ ("flow-in" (yaml--parse-from-grammar 'nb-double-multi-line n))
+ ("flow-key" (yaml--parse-from-grammar 'nb-double-one-line))
+ ("flow-out" (yaml--parse-from-grammar 'nb-double-multi-line n))))))
('s-b-comment
(yaml--frame "s-b-comment"
@@ -1887,12 +1892,13 @@ Rules for this function are defined by the yaml-spec
JSON file."
(let ((n (nth 0 args))
(c (nth 1 args)))
(yaml--frame "s-separate"
- (cond ((equal c "block-in") (yaml--parse-from-grammar
's-separate-lines n))
- ((equal c "block-key") (yaml--parse-from-grammar
's-separate-in-line))
- ((equal c "block-out") (yaml--parse-from-grammar
's-separate-lines n))
- ((equal c "flow-in") (yaml--parse-from-grammar
's-separate-lines n))
- ((equal c "flow-key") (yaml--parse-from-grammar
's-separate-in-line))
- ((equal c "flow-out") (yaml--parse-from-grammar
's-separate-lines n))))))
+ (pcase c
+ ("block-in" (yaml--parse-from-grammar 's-separate-lines n))
+ ("block-key" (yaml--parse-from-grammar 's-separate-in-line))
+ ("block-out" (yaml--parse-from-grammar 's-separate-lines n))
+ ("flow-in" (yaml--parse-from-grammar 's-separate-lines n))
+ ("flow-key" (yaml--parse-from-grammar 's-separate-in-line))
+ ("flow-out" (yaml--parse-from-grammar 's-separate-lines n))))))
('ns-flow-pair-entry
(let ((n (nth 0 args)) (c (nth 1 args)))
@@ -1943,10 +1949,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
('s-line-prefix
(let ((n (nth 0 args)) (c (nth 1 args)))
(yaml--frame "s-line-prefix"
- (cond ((equal c "block-in") (yaml--parse-from-grammar
's-block-line-prefix n))
- ((equal c "block-out") (yaml--parse-from-grammar
's-block-line-prefix n))
- ((equal c "flow-in") (yaml--parse-from-grammar
's-flow-line-prefix n))
- ((equal c "flow-out") (yaml--parse-from-grammar
's-flow-line-prefix n))))))
+ (pcase c
+ ("block-in" (yaml--parse-from-grammar 's-block-line-prefix n))
+ ("block-out" (yaml--parse-from-grammar 's-block-line-prefix n))
+ ("flow-in" (yaml--parse-from-grammar 's-flow-line-prefix n))
+ ("flow-out" (yaml--parse-from-grammar 's-flow-line-prefix n))))))
('s-tab
(yaml--frame "s-tab" (yaml--chr ?\x09)))
@@ -2275,10 +2282,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
('ns-plain-safe
(let ((c (nth 0 args)))
(yaml--frame "ns-plain-safe"
- (cond ((equal c "block-key") (yaml--parse-from-grammar
'ns-plain-safe-out))
- ((equal c "flow-in") (yaml--parse-from-grammar
'ns-plain-safe-in))
- ((equal c "flow-key") (yaml--parse-from-grammar
'ns-plain-safe-in))
- ((equal c "flow-out") (yaml--parse-from-grammar
'ns-plain-safe-out))))))
+ (pcase c
+ ("block-key" (yaml--parse-from-grammar 'ns-plain-safe-out))
+ ("flow-in" (yaml--parse-from-grammar 'ns-plain-safe-in))
+ ("flow-key" (yaml--parse-from-grammar 'ns-plain-safe-in))
+ ("flow-out" (yaml--parse-from-grammar 'ns-plain-safe-out))))))
('ns-flow-content
(let ((n (nth 0 args)) (c (nth 1 args)))
@@ -2298,10 +2306,11 @@ Rules for this function are defined by the yaml-spec
JSON file."
('in-flow
(let ((c (nth 0 args)))
(yaml--frame "in-flow"
- (cond ((equal c "block-key") "flow-key")
- ((equal c "flow-in") "flow-in")
- ((equal c "flow-key") "flow-key")
- ((equal c "flow-out") "flow-in")))))
+ (pcase c
+ ("block-key" "flow-key")
+ ("flow-in" "flow-in")
+ ("flow-key" "flow-key")
+ ("flow-out" "flow-in")))))
('c-verbatim-tag
(yaml--frame "c-verbatim-tag"
@@ -2332,7 +2341,7 @@ Rules for this function are defined by the yaml-spec JSON
file."
(let ((n (nth 0 args)) (c (nth 1 args)))
(yaml--frame "ns-flow-yaml-content"
(yaml--parse-from-grammar 'ns-plain n c))))
- (t (error "Unknown parsing grammar state: %s %s" state args))))
+ (_ (error "Unknown parsing grammar state: %s %s" state args))))
(provide 'yaml)
- [elpa] externals/yaml 7c6c1e1abf 017/124: Rename names according to elisp standards, (continued)
- [elpa] externals/yaml 7c6c1e1abf 017/124: Rename names according to elisp standards, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 9a8ae65986 016/124: Reduce stack usage, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 9e18a714f5 006/124: completing tracer to parse basic key-value, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 0c51603d6d 018/124: Add tracing; fix linting errors, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 49f4ebd8ab 011/124: Minor bug fixes, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 70429bd21b 025/124: Fix s-l+block-indented bug; fix auto-detect-indent bug, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml ed9dded709 027/124: Fix l+block-mapping auto-detect-indent bug, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 837e3e3080 028/124: Format grammar code, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml b7cffd6d3e 021/124: Add .gitattributes file, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml e32e11be66 026/124: Fix l+block-sequence bug sequence with e-node, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml ab86db9bb2 044/124: Merge pull request #4 from zkry/pcase-related-modifications,
ELPA Syncer <=
- [elpa] externals/yaml ada133f0b1 036/124: Fix regexp to match end of string, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 9170ff5cf8 038/124: Add LICENSE; Add documentation, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 1fb0519023 039/124: Fix static check warnings, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml fbf28ffb1d 041/124: Add yaml-spec-1.2.json file, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml d8f676b54d 037/124: Add require for cl-lib, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml a90fc1580c 045/124: Update commentary file, ELPA Syncer, 2024/11/29
- [elpa] externals/yaml 79a6bbc1e1 040/124: Fix various parsing bugs; reduce stack usage of parsing strings, ELPA Syncer, 2024/11/29
- [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