Skip to content

Commit 761ea74

Browse files
committed
Add support for chess Portable Game Notation (PGN) (#18)
commit a8e0787 Author: Roland Walker <walker@pobox.com> Date: Thu Jun 24 17:46:48 2021 -0400 add support for chess Portable Game Notation (PGN)
1 parent 453de35 commit 761ea74

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

.gitmodules

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,8 @@
151151
update = none
152152
ignore = dirty
153153
branch = master
154+
[submodule "repos/pgn"]
155+
path = repos/pgn
156+
url = https://github.com/rolandwalker/tree-sitter-pgn.git
157+
ignore = dirty
158+
branch = master

queries/pgn/highlights.scm

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
(annotation)
3+
(inline_comment)
4+
(rest_of_line_comment)
5+
(old_style_twic_section_comment)
6+
] @comment
7+
8+
(tagpair_delimiter_open) @punctuation.bracket
9+
(tagpair_delimiter_close) @punctuation.bracket
10+
(tagpair_key) @type
11+
(tagpair tagpair_value_delimiter: (double_quote) @string)
12+
(tagpair_value_contents) @string
13+
14+
(movetext (move_number) @function)
15+
(movetext (san_move) @function)
16+
17+
(variation_delimiter_open) @operator
18+
(variation_delimiter_close) @operator
19+
(variation_movetext variation_san_move: (san_move) @operator)
20+
(variation_movetext variation_move_number: (move_number) @operator)
21+
22+
(result_code) @property

repos/pgn

Submodule pgn added at 8d96463

tree-sitter-langs.el

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ See `tree-sitter-langs-repos'."
111111
(ocaml-mode . ocaml)
112112
(php-mode . php)
113113
(python-mode . python)
114+
(pygn-mode . pgn)
114115
(rjsx-mode . javascript)
115116
(ruby-mode . ruby)
116117
(rust-mode . rust)

0 commit comments

Comments
 (0)