Skip to content

Commit 36c77e0

Browse files
committed
feat: add support for 0.4 syntax
1 parent 0a09ef5 commit 36c77e0

File tree

5 files changed

+54
-12
lines changed

5 files changed

+54
-12
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,12 @@ or the keyword `"forall"` replaced with the Unicode `∀`.
187187
This package includes an [Eldev](https://github.com/emacs-eldev/eldev) file and the following MUST be run before
188188
creating any PR.
189189

190-
- `eldev lint`
191-
- `eldev doctor`
192-
- `eldev package --load-before-compiling --stop-on-failure --warnings-as-errors`
193-
- `eldev test`
194-
- `eldev test --undercover auto,coveralls,merge,dontsent -U simplecov.json`
195-
- `eldev release -nU 9.9.9`
190+
* `eldev lint`
191+
* `eldev doctor`
192+
* `eldev package --load-before-compiling --stop-on-failure --warnings-as-errors`
193+
* `eldev test`
194+
* `eldev test --undercover auto,coveralls,merge,dontsent -U simplecov.json`
195+
* `eldev release -nU 9.9.9`
196196

197197
The script [eldev-check.sh](https://gist.github.com/johnstonskj/6af5ef6866bfb1288f4962a6ba3ef418) may be useful to you if you do not have your own Eldev
198198
workflow.
@@ -204,6 +204,11 @@ file in the repository for details.
204204

205205
## Changes
206206

207+
### Version 0.2.1
208+
209+
* Feature: update the grammar support for the underlying 0.4.8 release of
210+
tree-sitter-sdml.
211+
207212
### Version 0.2.0
208213

209214
* Feature: update the grammar support for the underlying 0.4.0 release of

sdml-mode-hl.el

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;;; License:
66

7-
;; Copyright (c) 2023, 2024 Simon Johnston
7+
;; Copyright (c) 2023, 2025 Simon Johnston
88
;;
99
;; Licensed under the Apache License, Version 2.0 (the "License");
1010
;; you may not use this file except in compliance with the License.
@@ -238,6 +238,12 @@
238238
(structure_def "structure" @keyword name: (identifier) @type.definition)
239239

240240
(union_def "union" @keyword name: (identifier) @type.definition)
241+
(from_definition_clause
242+
"from" @keyword
243+
from: (identifier_reference) @type
244+
"with" @keyword)
245+
(from_definition_clause wildcard: (_) @type.builtin)
246+
(from_definition_clause member: (identifier) @variable)
241247

242248
(source_entity "source" @keyword entity: (identifier_reference) @type)
243249
(source_entity "with" @keyword)

sdml-mode-hydra.el

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
;;; sdml-mode-hydra.el --- Hydra for SDML -*- lexical-binding: t; -*-
2+
3+
;; Author: Simon Johnston <[email protected]>
4+
5+
;;; License:
6+
7+
;; Copyright (c) 2025 Simon Johnston
8+
;;
9+
;; Licensed under the Apache License, Version 2.0 (the "License");
10+
;; you may not use this file except in compliance with the License.
11+
;; You may obtain a copy of the License at
12+
;;
13+
;; http://www.apache.org/licenses/LICENSE-2.0
14+
;;
15+
;; Unless required by applicable law or agreed to in writing, software
16+
;; distributed under the License is distributed on an "AS IS" BASIS,
17+
;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
;; See the License for the specific language governing permissions and
19+
;; limitations under the License.
20+
21+
;;; Commentary:
22+
23+
;; Definition of a Hydra interface for SDML actions.
24+
25+
;;; Code:
126

227
(require 'sdml-mode)
328
(require 'sdml-mode-ctags)
@@ -29,9 +54,8 @@
2954
"Debug"
3055
(("h d" tree-sitter-debug-mode "Toggle ts debug tree mode" :toggle t)
3156
("h q" tree-sitter-query-builder "Open ts query builder"))))
32-
(bind-key "C-c C-s h" 'sdml-mode-hydra/body)
33-
(bind-key "<f9> s" 'sdml-mode-hydra/body))
34-
57+
(define-key sdml-mode-map (kbd "C-c C-s h") 'sdml-mode-hydra/body)
58+
(define-key sdml-mode-map (kbd "f9 s") 'sdml-mode-hydra/body))
3559

3660
;; ((featurep 'hydra) (message "plain")
3761
;; (defhydra sdml-mode-hydra (:color pink :hint nil)
@@ -53,3 +77,7 @@
5377
;; ("q" tree-sitter-query-builder)))
5478
(t
5579
(message "Install 'hydra or 'pretty-hydra")))
80+
81+
(provide 'sdml-mode-hydra)
82+
83+
;;; sdml-mode-hydra.el ends here

sdml-mode-indent.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
;;; License:
66

7-
;; Copyright (c) 2023, 2024 Simon Johnston
7+
;; Copyright (c) 2023, 2025 Simon Johnston
88
;;
99
;; Licensed under the Apache License, Version 2.0 (the "License");
1010
;; you may not use this file except in compliance with the License.
@@ -49,6 +49,7 @@
4949
function_body
5050
informal_constraint
5151
constraint_sentence
52+
from_definition_clause
5253
source_entity
5354
dimension_parent))
5455

@@ -67,6 +68,8 @@
6768
union_body
6869
type_class_body
6970
function_body
71+
from_definition_clause
72+
source_entity
7073
entity_identity
7174
sequence_of_values
7275
sequence_of_predicate_values

sdml-mode.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
;;; sdml-mode.el --- Major mode for SDML -*- lexical-binding: t; -*-
22

33
;; Author: Simon Johnston <[email protected]>
4-
;; Version: 0.2.0
4+
;; Version: 0.2.1
55
;; Package-Requires: ((emacs "28.1") (tree-sitter "0.18.0") (tree-sitter-indent "0.4"))
66
;; URL: https://github.com/johnstonskj/emacs-sdml-mode
77
;; Keywords: languages tools

0 commit comments

Comments
 (0)